Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if default_app_config is used on Django 1.7+ #39

Open
denizdogan opened this issue May 4, 2019 · 3 comments
Open

Check if default_app_config is used on Django 1.7+ #39

denizdogan opened this issue May 4, 2019 · 3 comments

Comments

@denizdogan
Copy link
Contributor

From https://docs.djangoproject.com/en/2.2/ref/applications/#configuring-applications:

default_app_config allows applications that predate Django 1.7 such as django.contrib.admin to opt-in to AppConfig features without requiring users to update their INSTALLED_APPS.
New applications should avoid default_app_config. Instead they should require the dotted path to the appropriate AppConfig subclass to be configured explicitly in INSTALLED_APPS.

Unless someone opposes this idea, I'll try to throw together a PR for this soon.

@stefan6419846
Copy link

As recent Django versions are going to remove the default_app_config support, this might not be required anymore in the future: https://docs.djangoproject.com/en/4.0/ref/applications/#configuring-applications, django/django#12310.

@denizdogan
Copy link
Contributor Author

@stefan6419846 Sorry, I'm not sure I understand what you mean. :) My PR/issue was created to warn users about using default_app_config if they do use it. It's been about three years since I made it, so if it's obsolete, I'll happily close the issue and PR, I just don't understand if it is obsolete?

@stefan6419846
Copy link

Since Django 3.2, Django will detect the AppConfig from apps.py automatically without the user to require to set default_app_config (ultimately deprecating it). For this reason, your proposed check should become obsolete with Django 3.2, as Django would not use it anyway. Upstream documentation on this is available from https://docs.djangoproject.com/en/4.0/releases/3.2/#automatic-appconfig-discovery.

According to https://www.djangoproject.com/download/#supported-versions, Django 3.2 is the oldest release still supported. In theory this check should be obsolete, although versions < 3.2 probably are still in use.

One might argue that this check might make more sense now to finally remove it, as this value will not be used any more at all, but I am not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants