Skip to content

Instantly share code, notes, and snippets.

View teury's full-sized avatar

Teury Diaz teury

View GitHub Profile
@teury
teury / Nginx_uwsig_django.md
Created October 19, 2021 03:22 — forked from junstrix/Nginx_uwsig_django.md
Nginx, Uwsgi, Virtualenv and Django
@teury
teury / language_query_string.py
Last active November 9, 2019 23:40
Django Middleware language change query string ?hl=langcode
import django
from django.utils import translation
from django.shortcuts import redirect, reverse
def is_django_greater_than_1_10():
main_version = django.VERSION[0]
if main_version > 1:
return True
@teury
teury / config.py
Created January 31, 2018 17:08 — forked from jerivas/config.py
One-click Django language select
# settings.py
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.i18n',
)
# urls.py (outside i18n_patterns)
(r'^i18n/', include('django.conf.urls.i18n')),