1. pip install django
  2. django-admin
  3. django-admin startproject project-name
  4. python manage.py runserver
  5. python manage.py startapp app-name
  6. python manage.py migrate
  7. python manage.py createsuperuser
  8. python manage.py makemigrations
  9. python manage.py migrate
  10. After applying migration we need to register the migrated model with the admin of that app:
    1. from . models import *
    2. admin.site.register(model-name)
  11. python manage.py shell
  12. pip install psycopg2 –> This library makes django communicate with postgresql
  13. $ pip install django-user-activity-log2 –> This django app intended for writing HTTP log to database and/or watch last user activity.
    1. Source: https://pypi.org/project/django-user-activity-log2/
  14. Model Data Types: https://www.geeksforgeeks.org/django-model-data-types-and-fields-list/
  15. Bootstrap modals with Django plugin: https://pypi.org/project/django-bootstrap-modal-forms/
  16. Install gentellela Admin Panel with Django: https://github.com/GiriB/django-gentelella
  17. How to use RAW SQL Queries in Django Views: https://medium.com/@MicroPyramid/django-raw-sql-queries-9e09deab85c
  18. Django Select2 –> https://pypi.org/project/django-select2-forms/
  19. How to display flash messages in django –> https://pythoncircle.com/post/700/how-to-display-flash-messages-in-django-templates/
  20. Flash Messges: import in views.py –> from django.contrib import messages
    1. messages.debug(request, ‘%s SQL statements were executed.’ % count)
    2. messages.info(request, ‘Three credits remain in your account.’)
    3. messages.success(request, ‘Profile details updated.’)
    4. messages.warning(request, ‘Your account expires in three days.’)
    5. messages.error(request, ‘Document deleted.’)
  21. To add a message call –> messages.add_message(request, messages.INFO, ‘Hello world.’)
  22. Add Breadcrums to Django: https://pypi.org/project/django-view-breadcrumbs/
  23. Django Library to manage forms in html templates rather than views.py –> pip install django-widget-tweaks
  24. Dealing with foreign keys referencing large tables: https://riptutorial.com/django/example/7415/dealing-with-foreign-keys-referencing-large-tables
  25. Django Modal Forms: https://github.com/trco/django-bootstrap-modal-forms
  26. Django Packages: https://djangopackages.org/grids/g/document-management/

Leave a Reply