0
votes
34
views
How to fix the XSS injection on Django
posted at July 30, 2019, 3:07 p.m. - 3 weeks ago

In django, I think the better way to handle the XSS injection is when you save the object. It is inside your models.py, and using strip_tags If value is "<b>Joel</b> …

1
votes
34
views
How to Install SSL Certificate on NGINX
posted at July 19, 2019, 4:30 p.m. - 1 month ago

How to Install SSL Certificate on NGINX 1. Generate file .key and .csr Don’t miss to set Common Name as *.mydomain.com because we use GlobalSign Wildcard AlphaSSL. $ openssl req …

ssl server linux security
0
votes
68
views
Understanding Google reCAPTCHA in Django
posted at July 12, 2018, 10:13 p.m. - 1 year, 1 month ago

Understanding Google reCAPTCHA in Django. I found this awesome answer to simply understand how to use API from Google reCAPTCHA. import urllib, urllib2 def recaptcha(request, postdata): rc_challenge = postdata.get('recaptcha_challenge_field', '') …

python django api security
0
votes
68
views
Understanding @user_passes_test Django
posted at July 12, 2018, 10:13 p.m. - 1 year, 1 month ago

Django decorator has a function to manage the user, once of it is user_passes_test. But, in my implementation i found this problem: ERR_TOO_MANY_REDIRECTS, or ‘AnonymousUser’ object is not iterable. I …

django python security
0
votes
58
views
Django: Custom safe excludes from dangerous XSS Injection
posted at July 12, 2018, 10:13 p.m. - 1 year, 1 month ago

Django Custom safe excludes from dangerous XSS Injection. Answered from: http://stackoverflow.com/a/41434870/6396981 from bs4 import BeautifulSoup from django import template from django.utils.html import escape register = template.Library() INVALID_TAGS = ['script', 'style'] …