Skip to content

Commit

Permalink
Update to django 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchrisadams committed May 3, 2024
1 parent e642d22 commit 4a112ae
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
10 changes: 8 additions & 2 deletions greenweb/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,20 @@
LANGUAGE_CODE = "en-us"
TIME_ZONE = "UTC"
USE_I18N = True
USE_L10N = True

# Email settings
DEFAULT_FROM_EMAIL = "[email protected]"

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/dev/howto/static-files/
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
},
}
STATIC_URL = "/static/"

STATICFILES_DIRS = [
Expand Down
11 changes: 8 additions & 3 deletions greenweb/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@

MEDIA_ROOT = ROOT("media")
MEDIA_URL = "/media/"
DEFAULT_FILE_STORAGE = "django.core.files.storage.FileSystemStorage"
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}
DOMAIN_SNAPSHOT_BUCKET = "tgwf-green-domains-test"

STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
9 changes: 8 additions & 1 deletion greenweb/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@

DOMAIN_SNAPSHOT_BUCKET = "tgwf-green-domains-live"
# Used by django storages for storing files
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
STORAGES = {
"default": {
"BACKEND": "storages.backends.s3boto3.S3Boto3Storage",
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}

# Scaleway deets
AWS_ACCESS_KEY_ID = env("OBJECT_STORAGE_ACCESS_KEY_ID") # noqa
Expand Down
9 changes: 8 additions & 1 deletion greenweb/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
DOMAIN_SNAPSHOT_BUCKET = "tgwf-green-domains-test"

# http://whitenoise.evans.io/en/stable/django.html#WHITENOISE_MANIFEST_STRICT
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}

# override settings, so we don't need to run rabbitmq in testing
# For more, see https://github.com/Bogdanp/django_dramatiq#testing
Expand Down

0 comments on commit 4a112ae

Please sign in to comment.