Django Curated List from Yoandre
- Classy Class-Based Views
- Classy Rest-Class
- Interested Links
- Deploy
- Database
- Django Rest Framework Tricks
- Url to Path
- Tips
- Server
- https://books.agiliq.com/projects/django-admin-cookbook/en/latest/index.html
- https://medium.com/beginners-guide-to-mobile-web-development/convert-django-website-to-a-progressive-web-app-3536bc4f2862
- https://apuntes-snicoper.readthedocs.io/es/latest/programacion/python/django/django_signals.html
https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
Run manage.py check --deploy Some of the checks described below can be automated using the check --deploy option. Be sure to run it against your production settings file as described in the option’s documentation.
https://django-rest-framework-tricks.readthedocs.io/en/latest/
from: https://consideratecode.com/2018/05/02/django-2-0-url-to-path-cheatsheet/
https://books.agiliq.com/projects/django-orm-cookbook/en/latest/index.html
To merge exist migration files into one file:
- Remove
django_migration
records table (manually) - Remove all migration files
- run
python manage.py migrate --fake
command - run
python manage.py makemigrations
command - run
python manage.py migrate --fake-initial
command - run
python manage.py migrate contenttypes
command - and finally, for chacking if everything is just fine, run
python manage.py migrate
command
Now, check django_migration
table and make sure all new files added in this table
En el shell de django
from django.core.cache import cache cache.clear()
Error: ModuleNotFoundError: No module named 'django.db.migrations.migration' Solution: reinstall becouse copy of django is corrupted
python -m django --version
pip install --upgrade --force-reinstall Django==3.2.2
find . -path "/migrations/.py" -not -name "init.py" -delete find . -path "/migrations/.pyc" -delete
python manage.py flush
python manage.py reset_db
python manage.py showmigrations
python manage.py changepassword user
1 - Nueva BD en la tabla django_migrations eliminar las rows menos las 2 de contentypes al inicio. 2 - Eliminar todos los ficheros migrations. 3 - correr manage.py makemigrations 4 - correr manage.py migrate --fake
- https://doordash.news/company/tips-for-building-high-quality-django-apps-at-scale/
- https://steelkiwi.com/blog/best-practices-working-django-models-python/
- https://medium.com/beginners-guide-to-mobile-web-development/convert-django-website-to-a-progressive-web-app-3536bc4f2862
- https://apuntes-snicoper.readthedocs.io/es/latest/programacion/python/django/django_signals.html
- https://alexanderae.com/django-best-practices.html
- https://isaacsapple.github.io/awesome-django/
- https://hakibenita.com/how-to-manage-concurrency-in-django-models
- https://django-best-practices.readthedocs.io/en/latest/projects.html
-
Run/Stop Services $ sudo systemctl status/start/stop/restart gunicorn/nginx
-
Ver logs $ journalctl --unit=gunicorn | tail -n 50
-
Ver la configuracion de Nginx $ sudo nginx -T