virtualenv -p python2 --prompt="(cdr-viewer)" venv
. venv/bin/activate
pip install --upgrade pip
django-admin startproject cdr .
python manage.py migrate
python manage.py createsuperuser
python manage.py collectstatic
python manage.py makemigrations cdr
python manage.py migrate
python manage.py migrate --database pbx cdr
django-admin.py startapp customuseradmin
# -*- coding:utf-8 -*-
from django.contrib import admin
from django.contrib.auth.models import User, Group
from django.contrib.auth.admin import UserAdmin
admin.site.unregister(User)
class CustomUserAdmin(UserAdmin):
list_display = ('username', 'email', 'is_staff','is_active',)
list_filter = ('is_staff', 'is_superuser', 'is_active',)
admin.site.register(User, CustomUserAdmin)
python -m smtpd -n -c DebuggingServer localhost:1025
. venv/bin/activate
cd cdr
[ -d locale ] || mkdir locale
python ../manage.py makemessages --locale=ru_RU --no-location
python ../manage.py compilemessages --locale=ru_RU
. venv/bin/activate
cd cdr
python ../manage.py makemessages --locale=ru_RU --no-location
python ../manage.py compilemessages --locale=ru_RU
python ../manage.py makemessages --locale=ru_RU --no-location
CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.
sudo apt install gettext
find accounts/locale -name *.po | sed 's/\.po$//g' | xargs -i{} msgfmt {}.po -o {}.mo
Be careful! This will overwrite your existing tags.
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch cdr/settings.py' \
--prune-empty --tag-name-filter cat -- --all
- http://stackoverflow.com/questions/8600843/serving-large-files-with-high-loads-in-django
- https://toster.ru/q/208755
- http://csscompressor.com/
- http://wiki.nginx.org/XSendfile
- https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/
- https://djangosnippets.org/snippets/2728/
X-Accel-Limit-Rate: 1024
X-Accel-Buffering: yes|no
X-Accel-Charset: utf-8
Content-Type
Content-Disposition
Accept-Ranges
Set-Cookie
Cache-Control
Expires
/media_nginx/
cant be equal/media/
, because/media_nginx/
is internal and nginx not accept request from external network from users nginx will be accep only internal responses from backed application