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

Django settings improvements: also look at MIDDLEWARE and so #138

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

reinout
Copy link
Owner

@reinout reinout commented Apr 10, 2024

No description provided.

@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 7d5f4cc on reinout-django-settings-improvements
into 6edfff0 on master.

@reinout reinout requested a review from gforcada April 10, 2024 16:38
@reinout
Copy link
Owner Author

reinout commented Apr 10, 2024

In a project I'm working on I have a django settings file with this in it:

MIDDLEWARE = [
    "django.middleware.security.SecurityMiddleware",
    "whitenoise.middleware.WhiteNoiseMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
    "corsheaders.middleware.CorsMiddleware",
]

whitenoise isn't recognised as a required package, though it is. By treating MIDDLEWARE as similar to INSTALLED_APPS, fixing this was easy :-)

Copy link
Collaborator

@gforcada gforcada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@reinout reinout merged commit 845d5a7 into master Apr 11, 2024
13 checks passed
@reinout reinout deleted the reinout-django-settings-improvements branch April 11, 2024 16:05
@reinout
Copy link
Owner Author

reinout commented Apr 11, 2024

I released 2.15.

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 this pull request may close these issues.

3 participants