**Django 3.***
"user_name__icontains"
"user_name__iregex"
"user_name__startswith"
'contained_by': <class 'django.contrib.postgres.fields.ranges.RangeContainedBy'>,
'gte': <class 'django.db.models.lookups.IntegerGreaterThanOrEqual'>,
'lt': <class 'django.db.models.lookups.IntegerLessThan'>,
'contains': <class 'django.db.models.lookups.Contains'>,
'endswith': <class 'django.db.models.lookups.EndsWith'>,
'exact': <class 'django.db.models.lookups.Exact'>,
'gt': <class 'django.db.models.lookups.GreaterThan'>,
'gte': <class 'django.db.models.lookups.GreaterThanOrEqual'>,
'icontains': <class 'django.db.models.lookups.IContains'>,
'iendswith': <class 'django.db.models.lookups.IEndsWith'>,
'iexact': <class 'django.db.models.lookups.IExact'>,
'in': <class 'django.db.models.lookups.In'>,
'iregex': <class 'django.db.models.lookups.IRegex'>,
'isnull': <class 'django.db.models.lookups.IsNull'>,
'istartswith': <class 'django.db.models.lookups.IStartsWith'>,
'lt': <class 'django.db.models.lookups.LessThan'>,
'lte': <class 'django.db.models.lookups.LessThanOrEqual'>,
'range': <class 'django.db.models.lookups.Range'>,
'regex': <class 'django.db.models.lookups.Regex'>,
'startswith': <class 'django.db.models.lookups.StartsWith'>,
SublimeText3 Anaconda (Python plugin)
https://sublime-text.zeef.com/zeefcom Anaconda config:
{ "pep8_ignore": [
"E501",
"E402",
"UnusedImport",
"W291",
"E722",
"E111"
] ,
"pyflakes_explicit_ignore": [
"UnusedImport",
],
"auto_formatting": true,
"autoformat_ignore":
[
"E309",
"E501",
],
"auto_complete": true,
"auto_complete_commit_on_tab": true,
}
1. Create clear.sh file with:
#!/bin/sh
FILES=$(find . -name "*.py" -not -path "./env/*")
for FILE in $FILES
do
sed '/""".*"""/d;s/#.*$//;s/^\n$/\n/' $FILE > temp.txt && mv temp.txt $FILE
echo "Processed file: $FILE"
done
exit 0
2. Copy in in /your_project_root_foder/ and run:
sh clear.sh
pip install -r requirements.txt
(same: cat requirements.txt | xargs -n 1 pip install)
python manage.py makemigrations
python manage.py migrate
python manage.py seed all
python manage.py seed all --refresh
admin
admin (or `SUPERUSER_PASS={password}` in env)
first install:
pip install django==2.2
then install:
pip install django==3.0.2
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9
python3.9 --version
sudo apt install python3.9-venv
python3.9 -m pip install --user --upgrade pip
python3.9 -m pip install --user virtualenv
python3.9 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install --upgrade -r requirements.txt # upgrade all packages
deactivate
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
pip freeze > requirements.txt
pip install pipupgrade
pipupgrade --verbose --latest --yes
pip freeze > requirements.txt
cd {django-project-folder}/
find . -path "*/migrations/*.py" -not -name "__init__.py" -not -path "*/geodata/*" -delete
find . -path "*/migrations/*.pyc" -not -path "*/geodata/*" -delete
celery -A core_backend worker --loglevel=DEBUG
sudo add-apt-repository ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get install redis-server
https://github.com/django/daphne/issues/262 https://stackoverflow.com/questions/55916808/django-channels-reader-at-end-of-file-exception