Category: Django

66 posts · Page 3
Django
2017-02-26 10:25 (9 years ago)
Creating Custom Filters in Django Admin

Using SimpleListFilter for Easy Implementation

Django
2017-01-26 04:11 (9 years ago)
Mistakes When Searching MySQL with datetime in Django Due to Time Zone Mismatch

Since I often make mistakes, here's a note.

DjangoLinux
2016-09-16 03:24 (10 years ago)
Failure of Django CSRF Token Authentication: ELB -> Apache2 -> uwsgi

Fix Django CSRF token failure on an AWS ELB → Apache2 → uWSGI stack. The pitfall is the HTTP/HTTPS scheme detection when switching from mod_wsgi to uWSGI.

DjangoPython
2016-06-20 08:35 (10 years ago)
Outputting Shift-JIS CSV with Django

How to return a Shift-JIS (CP932) CSV download response from Django on Python 3 — write to StringIO as Unicode first, then encode to cp932 in one shot.

Django
2015-12-22 09:57 (10 years ago)
Using Django RedirectView Inline in URLs to Redirect While Preserving URL Path

I want to redirect people who access /url-path-before/feature/hoge/ to /url-path-after/feature/hoge/.

Django
2015-11-27 00:40 (10 years ago)
Decorator to Prevent Duplicate Execution of Django Management Commands

If your Twitter Developer API account is banned / suspended, how to write an appeal to Twitter support and what to include in the reappeal.

Django
2015-10-29 08:35 (11 years ago)
Trying Out Django TemplateView with Extensive Use of @cached_property

Sample remote interpreter / SSH setup for developing Rails inside a Vagrant VM using RubyMine.

Django
2015-10-15 10:10 (11 years ago)
Paging Django Model Instances Queried with Complex Filters Using Paginator

Page through Django model instances retrieved via a complex query (raw SQL or composed Q objects) using Paginator, with a working implementation pattern.

Django
2015-09-03 11:48 (11 years ago)
Create a Full-Text Index in Migration Files with Django 1.7

This is a method to create a full-text index in MySQL using the DB migration feature in Django 1.7 and above.

Django
2015-07-07 05:38 (11 years ago)
How to Replace Strings in Django TemplateView

```html Here are two methods to output an HTML template as it is using Django's TemplateView class, but replacing strings in the output result at once.

Django
2015-05-29 11:31 (11 years ago)
Create a Simple Login URL with Django

url(r'^login/', 'django.contrib.auth.views.login', name='login', kwargs={'template_name': 'admin/login.html', 'extra_context': {'next': '/'}}), Write this link in the template as follows,

Django
2015-05-10 07:19 (11 years ago)
Using reStructuredText with Mezzanine

There is a system called Mezzanine for building a CMS on Python + Django. By default, blog entries are written using a WYSIWYG HTML editor, but I wanted to write them using reStructured Text (reST, rst), so I did some research.

Django
2013-09-21 04:04 (13 years ago)
Add Custom HTML to Django Admin Form Templates

1. Define change_form_template in the admin.py module Specify the location of the custom template

Django
2011-09-10 11:32 (15 years ago)
recreate-migration: BASH Function to Recreate Migration

Rollback the migration, delete all migration scripts, and then redo the schema migrations.

Django
2011-09-10 11:20 (15 years ago)
Template Tags for Time Branching: ifbefore, ifafter, ifafterbefore

```python

Django
2011-06-21 06:24 (15 years ago)
Creating Dummy Text with Lorem Ipsum

```html Using template tags like lorem, you can create dummy data for articles utilizing the django.contrib.webdesign.lorem_ipsum package.

Django
2011-06-20 17:14 (15 years ago)
Django admin sets default form field values based on GET parameters

When you pass a GET query like

Django
2011-06-17 07:09 (15 years ago)
Management Command to Visualize Model Relationships

```python

Django
2011-06-17 01:10 (15 years ago)
Remove the Delete Button from the Django Admin Interface

Disable Deletion from List Checkboxes Create a file like common/admins.py