django-background-tasks/background_task/apps.py
Anna Sirota 2e60c4ec2f Set default_auto_field on app level
This is necessary to avoid generating unexpected migrations
in the projects that have a `DEFAULT_AUTO_FIELD` that differs
from data type of generated `id` columns in `blender_id_oauth_client`'s
initial migration.

E.g. if `default_auto_field` is omitted here and
`DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'` in a project's `settings.py`,
then `makemigrations` will generate a migration that will attempt to
change `id` column to a new data type, recreating a table and copying
its data, which is not desired for existing projects.
2024-04-02 17:15:12 +02:00

12 lines
355 B
Python

from django.apps import AppConfig
class BackgroundTasksAppConfig(AppConfig):
name = 'background_task'
from background_task import __version__ as version_info
verbose_name = 'Background Tasks ({})'.format(version_info)
default_auto_field = 'django.db.models.AutoField'
def ready(self):
import background_task.signals # noqa