All Posts Create a Post  
0
votes
146
views
How to create Django Language Middleware
Posted at 2 weeks, 5 days ago / Oct. 11, 2020, 8:04 a.m.

This example below to setup default language code as id (Indonesian). Your file middleware.py # -*- coding: utf-8 -*- from django.conf import settings from django.utils import translation from django.utils.deprecation import …

101 1 1 0
0
votes
140
views
Change backend gmail to Postmarkapp for Django
Posted at 2 weeks, 5 days ago / Oct. 11, 2020, 8:04 a.m.

1. Install module of Python Postmark Install this module manually from souce inside your environtment: https://github.com/themartorana/python-postmark If you work on Django==1.9.*, requirements only mock. 2. Register and Put the Server …

101 1 1 0
0
votes
137
views
Django: Redirect HTTP to HTTPS
Posted at 2 weeks, 5 days ago / Oct. 11, 2020, 8:04 a.m.

Django: Redirect HTTP to HTTPS, basically the Django already support to handle this redirection at https://docs.djangoproject.com/en/dev/topics/security/#ssl-https Edit in your settings.py # Redirecting from `HTTP` to `HTTPS` for Django 1.8 or …

101 1 1 0
0
votes
164
views
How to implement the ForeignKey for multi databases Django
Posted at 2 weeks, 5 days ago / Oct. 11, 2020, 8:04 a.m.

Previously i had confused how to handle this problem, this problem also already asked by someone on stackoverflow (Cross Database foreign key error) and has the best answered by someone …

101 1 1 0
0
votes
163
views
Step by step how to use multiple databases with database routers in Django
Posted at 2 weeks, 5 days ago / Oct. 11, 2020, 8:04 a.m.

1. Please create a new superuser for the second/default/current database. Because you will getting this issue that i already asked before: https://gitter.im/django/django?at=5810b0b5806316005dc11f46 i use multiple site, multiple env, multiple project, …

101 1 1 0