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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17f845304263f7edc37d45ea24dfd1531b1938f7c177dabd18f40ecfbf44c409 |
|
MD5 | c383c8529ee36092152ca3120a6cc4ce |
|
BLAKE2b-256 | 0d69459d62502d4378e991949679fa86044d77003038b70926c1ecaa2dd00d44 |
Close
Hashes for django_dynamic_theme-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 083d05a128a506b8025b97a627004df794408c783075e7ce1eaf358eefb5a8ec |
|
MD5 | 252ec19b096feb626601e36bf01ec37c |
|
BLAKE2b-256 | ca4d9ec71bc2f4aadcee23ff3dc1cda8472b3fc3fd1582d27d69bc8674e37ccb |