Skip to content

Commit

Permalink
Add Django 4.2 Support (#295)
Browse files Browse the repository at this point in the history
* playing around

* add current version

* proper storage settings

* bump version
  • Loading branch information
FinalAngel authored May 31, 2023
1 parent 60280ee commit c57febb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions aldryn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@ def storage_settings_for_media(self, settings, env):
storage_dsn = str(dsn)
settings[DEFAULT_STORAGE_KEY] = storage_dsn

settings['DEFAULT_FILE_STORAGE'] = 'aldryn_django.storage.DefaultStorage'
settings['STORAGES']['default'] = {
"BACKEND": "aldryn_django.storage.DefaultStorage"
}

# Handle MEDIA_URL
settings['MEDIA_URL'] = env('MEDIA_URL', '/media/')
Expand Down Expand Up @@ -452,7 +454,8 @@ def storage_settings_for_static(self, data, settings, env):
storage = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
else:
storage = 'django.contrib.staticfiles.storage.StaticFilesStorage'
settings['STATICFILES_STORAGE'] = storage

settings['STORAGES']['staticfiles'] = {"BACKEND": storage}

settings['STATIC_URL'] = env('STATIC_URL', '/static/')
static_host = furl.furl(settings['STATIC_URL']).host
Expand Down Expand Up @@ -565,7 +568,7 @@ def migration_settings(self, settings, env):
mcmds.append('python manage.py migrate --noinput')

if not boolean_ish(env('DISABLE_S3_MEDIA_HEADERS_UPDATE')):
if settings['DEFAULT_FILE_STORAGE'] == storage.SCHEMES['s3']:
if settings['STORAGES']['default'] == storage.SCHEMES['s3']:
mcmds.append('python manage.py aldryn_update_s3_media_headers')

def gis_settings(self, settings, env):
Expand Down
2 changes: 1 addition & 1 deletion aldryn_django/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.2.1.0'
__version__ = '4.2.1.2'

0 comments on commit c57febb

Please sign in to comment.