Skip to content

Commit

Permalink
django-upgrade --target-version=5.1 **/*.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Oct 17, 2024
1 parent 433b43e commit 13f8930
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion testproj/testproj/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True

# Static files (CSS, JavaScript, Images)
Expand Down
9 changes: 8 additions & 1 deletion testproj/testproj/settings/heroku.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
# Simplified static file serving.
# https://warehouse.python.org/project/whitenoise/

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": 'whitenoise.storage.CompressedManifestStaticFilesStorage',
},
}
MIDDLEWARE.insert(0, 'whitenoise.middleware.WhiteNoiseMiddleware')

# Database
Expand Down
2 changes: 1 addition & 1 deletion testproj/testproj/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def plain_view(request):


def root_redirect(request):
user_agent_string = request.META.get('HTTP_USER_AGENT', '')
user_agent_string = request.headers.get('user-agent', '')
user_agent = user_agents.parse(user_agent_string)

if user_agent.is_mobile:
Expand Down

0 comments on commit 13f8930

Please sign in to comment.