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.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cd4a556bfbc4d47b248c8ad8dcf20c40f3d5563404dae391979811d9d3ef6b0 |
|
MD5 | 889feae683d9e2c513a6f18b15209743 |
|
BLAKE2b-256 | fe5784f5b4e997a3b14a1c19c33862432c72b3a94387d16f9958bb89f0a76109 |
Close
Hashes for django_dynamic_theme-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f5caf5a43b831e111cdb1d8e00ddec1c04ed864687648b5ec7ab664a589f694 |
|
MD5 | 47582b21bb53d3664fe9ceddef9457b3 |
|
BLAKE2b-256 | bd37ff0e88d3cbace77fda523419f2fd8fdeac8c63a538b2b4500c0b1d34440f |