Django: Custom safe excludes from dangerous XSS Injection

By: summonagus ● at Jan. 3, 2017, 7:44 a.m. ● Posted under: #Tricks, #Templates, #Problem, #Django, #Security, #Solution

Django Custom safe excludes from dangerous XSS Injection. Answered from: from bs4 import BeautifulSoup from django import template from django.utils.html import escape register = template.Library() INVALID_TAGS = ['script', 'style'] def clean_html(value): soup = BeautifulSoup(value) for tag in soup.findAll(True): if in INVALID_TAGS: #tag.hidden = True # you also can ...

Read More →

DracEditor - Django Markdown Editor built for Dracos Linux

By: summonagus ● at Jan. 1, 2017, 9:18 p.m. ● Posted under: #Module, #APP, #Django, #Project

DracEditor - Django Markdown Editor built for Dracos Linux. Few days ago i created package django markdown editor. I created this plugin specially to handle the new forum of Dracos Linux. Demo Video: Integrated with Ace Editor Integrated with Semantic-UI Live Preview Upload Image to (via API) Emoji ...

Read More →

Top 10 Python libraries of 2016

By: summonagus ● at Dec. 24, 2016, 10:31 a.m. ● Posted under: #Module, #News, #Project

Last year, we did a recap with what we thought were the best Python libraries of 2015, which was widely shared within the Python community (see post inr/Python). A year has gone by, and again it is time to give due credit for the awesome work that has been done ...

Read More →

How to custom html choose image upload for django markdownx

By: summonagus ● at Dec. 19, 2016, 9:38 p.m. ● Posted under: #Tricks, #Templates, #Problem, #Django, #Solution, #Ajax

Django markdownx is a Markdown editor built for Django Previously i already created isssue before:, as the owner says: There is no easy way to do it "quick", I think. You could change JS script a bit to be able to send images. This should be a simple ...

Read More →

Command to handle deploy Django with quickly

By: summonagus ● at Dec. 19, 2016, 5:44 a.m. ● Posted under: #Tricks, #Database, #Django, #Solution

Hello guys, this morning i want to share simply how to custom command to handle deploy Django with quickly. ./ deploy --yes <username> <password> <email> ./ deploy --yes --username=myusername --password=mypassword Let see, the `email` has default empty string, so you can fill with your email or just passed it.For example, ...

Read More →

Djipsum already in new version 1.0.9

By: summonagus ● at Dec. 2, 2016, 4:56 a.m. ● Posted under: #Module, #APP, #Django, #News

Djipsum already in new version 1.0.9. Djipsum is awesome command plugin to generate fake content for Django. What news? Fixed ManyToManyField (return the random objects from many to many field). Fixed ForeignKey Field (return the random object from foreign field). Install:$ pip install djipsum I never test this tool with ...

Read More →

Understanding @user_passes_test Django

By: summonagus ● at Nov. 28, 2016, 10:05 p.m. ● Posted under: #Tricks, #Problem, #Django, #Security, #Solution

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 need to custom the user by instancing from user models, for example: from django.db import models from django.contrib.auth.models import User ...

Read More →

How to implement Django Internationalization

By: summonagus ● at Nov. 17, 2016, 8:27 p.m. ● Posted under: #Tricks, #Database, #Settings, #Module, #Django, #Project, #Solution, #Internationalization, #Multi Languages

Django is real fucking awesome, this morning i want to share a basic tutorial how to implement the django internationalization with GeoIP. Of course this tutorial if you need to make a site with multiple languages. Default django already integrated with common / modern translation system. as the docs warning ...

Read More →

Implement Realtime Search using Django and Ajax

By: summonagus ● at Nov. 13, 2016, 12:17 a.m. ● Posted under: #Tricks, #Templates, #Django, #Solution, #Ajax

Hello guys and welcome back, this night i want to share a simply tutorial how to Implement Realtime Search using Django and Ajax. Lets goo... ^_^1. yourapp/models.pyfrom django.db import models class Post(models.Model): title = models.CharField(max_length=200) description = models.TextField() 2. yourapp/views.pyfrom django.shortcuts import render from django.db.models import Q from yourapp.models import ...

Read More →

Django Contact Form Widget

By: summonagus ● at Nov. 3, 2016, 2:42 p.m. ● Posted under: #APP, #Django, #Project, #Ajax

Django contact widget is once of plugin i already released. This is simple contact widget plugin for Django. inspired from, but made more simple and easy to use. Demo Contact Widget is available directly from PyPI: $ pip install django-contact-widget *). And don't forget to add "contact_widget" to your ...

Read More →