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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe68294ef04629636d2d82612694372b92cbad84ddfeb1cc7ba4d00bba14c3f4 |
|
MD5 | 63fb5a21d803b157e7c6880c91ee8724 |
|
BLAKE2b-256 | 8173c1c25eb1fc1636da05539d5333df6bd5a78bc5236155aa58e64aae0dd4f8 |
Close
Hashes for django_dynamic_theme-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90bfa3ba3d3e6b76b8df21518b401f122c5bbe71ca34a779d98d7c1722a04958 |
|
MD5 | a82cb25dda62affb5b0c385fe5e16452 |
|
BLAKE2b-256 | 0f480bc738d3c996cd1dca3f75dad0186a989e756e7e7345ea62f5e443bdf531 |