This enables the administrator of a django website to change the theme on the fly.
Project description
Django Dynamic Theme
This allows an administrator of a django website to change the theme on the fly.
Installation
pip install django-dynamic-theme
Quickstart
- Add the following settings::
INSTALLED_APPS = [
...,
"django_dynamic_theme",
"compressor",
]
...
# Default setting but you can set it to some other path.
STATIC_URL = "static/"
STATIC_ROOT = "static"
STATICFILES_FINDERS = [
...,
"compressor.finders.CompressorFinder",
]
COMPRESS_PRECOMPILERS = (("text/x-scss", "django_libsass.SassCompiler"),)
MIDDLEWARE = [
...,
"django_dynamic_theme.middleware.MissingThemeHandleMiddleware",
]
TEMPLATES = {
"OPTIONS": {
"context_processors": [
...,
"django_dynamic_theme-context_processor.theme",
]
}
}
-
Run
python manage.py migrate
-
Assuming you have
base.html
add this to it before the<body>
tag:
<html>
...
{% load compress %}
{% load static %}
{% compress css %}
<link type="text/x-scss" rel="stylesheet" href="{% static theme_file %}" />
...
</html>
- Visit
http://127.0.0.1:8000/admin/django_dynamic_theme/
to start customizing your theme.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django_dynamic_theme-0.0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd6bdf854ab9877af6764290252b3a5c01400366140ec68c61c7b8a9dd7da78b |
|
MD5 | cfe0dd4000a7d695646f11eaccdcc5bc |
|
BLAKE2b-256 | c9f7ac64a719efd1790927749073bba79ceddc6d14f81d14cb77fd48ff2d8251 |
Close
Hashes for django_dynamic_theme-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30e1cddf66b53f098e4e2c2cae9e3b23d35c0a6929b2bd863ad5029595aff161 |
|
MD5 | 7f0606c30cb93c85b275c95d032eac65 |
|
BLAKE2b-256 | 003331680272ea5496687ad08350e1e1c8bba73fce5aafa4c749cb46eadae0b1 |