Menerima Jasa Konsultasi & Pembuatan Website Django(klik disini)
0
votes
117
views
Custom redirect urls django
posted at July 12, 2018, 10:13 p.m. - 2 years, 2 months ago

Example in this problem we need redirect the url http://localhost:8000/a/b/C/123/4/5/ to http://localhost:8000/abC12345 without / slash. 1. In your views.py from django.http import HttpResponse from django.views.generic.base import RedirectView from django.core.urlresolvers import …

0
votes
118
views
E11000 duplicate key error index in mongodb
posted at July 12, 2018, 10:13 p.m. - 2 years, 2 months ago

E11000 duplicate key error index in mongodb. I found this error after migrating my field from “unique” to “non-unique”. And in this problem we use mongoengine for flask. First, i …

0
votes
129
views
How to minify HTML output in Django
posted at July 12, 2018, 10:13 p.m. - 2 years, 2 months ago

So, you want to compress the size of the HTML that Django generates? Here is the Django way to do it. In order to do this, you’ll have to write …

0
votes
139
views
Django: Remove Duplicates Filter for Related Posts
posted at July 12, 2018, 10:13 p.m. - 2 years, 2 months ago

Django: Remove Duplicates Filter for Related Posts. In yourapp/models.py class Post(models.Model): title = models.CharField(max_length=200) slug = models.SlugField(max_length=200, unique=True) tags = models.ManyToManyField('Tag') In yourapp/views.py class DetailPostView(generic.DetailView): model = Post template_name = …