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

Removal of default_app_config on Django 3.2+ #139

Closed
browniebroke opened this issue May 3, 2022 · 2 comments · Fixed by #140
Closed

Removal of default_app_config on Django 3.2+ #139

browniebroke opened this issue May 3, 2022 · 2 comments · Fixed by #140

Comments

@browniebroke
Copy link
Contributor

browniebroke commented May 3, 2022

Description

Django 3.2 introduced an automatic app config discovery mechanism. Do you think django-upgrade could remove the deprecated default_app_config application configuration variable?

@adamchainz
Copy link
Owner

I guess so, I didn't think about it. I found this change affects installable apps more than projects, for which I used this pattern, rather than just deleting:

import django

if django.VERSION < (3, 2):
    default_app_config = "django_linear_migrations.apps.DjangoLinearMigrationsAppConfig"

but yeah we could add a fixer, if a django-upgrade user specifies --target-version 3.2, that means their code should only support 3.2 as a minimum.

Are you offering to write a PR?

@browniebroke
Copy link
Contributor Author

I can take a look at that, yes. I might have some free time later this week.

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