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.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 979541e3073c3a3db8c396bdbbc64a7fbdec3fef1751b4957ec0cf4b5e5d8166 |
|
MD5 | 7719b5f02f5352811b07652f91e27998 |
|
BLAKE2b-256 | 40b506e5ad6b9bc577cd6521f41d5bfa1e3de296967c72bdb44cb3226905f11d |
Close
Hashes for django_dynamic_theme-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20a3f73c2c28d2f1d581b6e02cf6d7e4daad0d6cdabb0e3e7bb2158f91e3083b |
|
MD5 | dc74cdc35466b0cc87e28257b92981a7 |
|
BLAKE2b-256 | 7ee81ee09d26372492fc43798c70a07f387a3989f61acd27af8ee38874040361 |