In brief: Admin extensions to make theming django sites easier for end users of django sites.
- Serve themes for django using built-in Django FileStorage api - this means themes can be served from FileSystem, Cloud storage (such as Amazon S3) or from the database
- Follow django admin design, to help it feel like a Django-native process
- Above all: Give end users more control over how their django apps look and behave, without having to change the code used to deploy the app.
Install it from PyPI
Add Django themes to your
INSTALLED_APPS
. Django-themes doesn't override anything, so you can put this anywhere in the order:INSTALLED_APPS = ( # ... your other apps 'django_themes', )
Add theme directives:
THEMES_FILE_ROOT = os.getenv('DJANGO_THEMES_ROOT', os.path.join(BASE_DIR, "themes")) # Where your themes are THEMES_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' # Or whatever storage you need
If you want to be able to preview themes live, add the appropriate middleware after everything else. Note: to get the current user during template loading, this needs to store the user of a request in
_thread_locals
. I've read that some Django core devs consider this a security issue, but most people are ok with it.:MIDDLEWARE_CLASSES = ( 'django_themes.middleware.PreviewWithCurrentUserMiddleware', )
Drag-and-drop files to add them
Preview changes to themes before they are active
This package uses the following open-source resources:
- AceJS Code Editor v1.2.7 - Editing widget
- DropzoneJS v5.0.0 - Drag-and-drop uploading
- GitHub Octicons v4.3.0 - Font Icons