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