Categories
Signal | Description |
Django.db.models.signals.pre_save(or)django.db.models.signals.post_save | Sent before or after a model’s save() method calls. |
django.db.models.signals.pre_delete (or)django.db.models.signals.post_delete | Sent before or after a model’s delete() method or query set’s delete() method calls. |
django.db.models.signals.m2m_changed | We use this signal when ManyToManyField on a model changes. |
Django.core.signals.request_started(or)django.core.signals.request_finished | We use this signal when Django starts or finishes an HTTP request. |
Exception | Description |
AppRegistryNotReady | This class raises for using models before loading the app process. |
ObjectDoesNotExist | It’s a base class for DoesNotExist exceptions. |
EmptyResultSet | This exception arises when the query fails to return results. |
FieldDoesNotExist | When the requested file does not exist, this exception arises. |
MultipleObjectsReturned | It raises by the query multiple objects returned when we expect only one object. |
SuspiciousOperation | It raises when the user has performed some operation, which is considered suspicious from a security perspective. |
PermissionDenied | It arises when a user does not have permission to execute a specific action requested. |
ViewDoesNotExist | When the requested view does not exist, this exception raises. |
When the requested view does not exist, this exception raises. | When the requested view does not exist, this exception raises. |
MiddlewareNotUsed | When there is no middleware in server configuration, this exception arises. |
ImproperlyConfigured | When Django configuration is improper, this exception arises. |
FieldError | When there is a problem with the model field, this exception arises. |
Exception | Description |
AppRegistryNotReady | This class raises for using models before loading the app process. |
ObjectDoesNotExist | It’s a base class for DoesNotExist exceptions. |
EmptyResultSet | This exception arises when the query fails to return results. |
FieldDoesNotExist | When the requested file does not exist, this exception arises. |
MultipleObjectsReturned | It raises by the query multiple objects returned when we expect only one object. |
SuspiciousOperation | It raises when the user has performed some operation, which is considered suspicious from a security perspective. |
PermissionDenied | It arises when a user does not have permission to execute a specific action requested. |
ViewDoesNotExist | When the requested view does not exist, this exception raises. |
When the requested view does not exist, this exception raises. | When the requested view does not exist, this exception raises. |
MiddlewareNotUsed | When there is no middleware in server configuration, this exception arises. |
ImproperlyConfigured | When Django configuration is improper, this exception arises. |
FieldError | When there is a problem with the model field, this exception arises. |
Command | Task |
django-admin help | Displays the usage of the information and commands list provided by each application. |
django-admin help –command | Displays available commands |
django-admin help <command> | Displays the command description and its available options |
django-admin version | Determines Django’s version |
django-admin make migrations | Depending on the changes done in the model creates new migrations |
django-admin migrate | Synchronizes the database state with the present set of models and migrations |
django-admin runserver | Starts the development server |
django-admin sendtestemail | A test mail sent to confirm Django email working status |
django-admin shell | Starts the Python interactive interpreter |
django-admin showmigrations | Displays all the project’s migrations |
Strategy | Description |
Memcached | The most efficient and faster memory-based cache server |
Filesystem caching | Cache files store in serial order in separate files. |
Local-memory caching | If you have not specified any other, this is the default cache. It’s per-process and threads safe as well. |
Database caching | Cache data will be stored in the database and works OK if you have a well-indexed database server. |