Skip to main content

This enables the administrator of a django website to change the theme on the fly.

Project description

PyPI - Python Version GitHub Release

Documentation Status codecov

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

  1. 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",
    ]
  }
}
  1. Run python manage.py migrate

  2. 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>
  1. Visit http://127.0.0.1:8000/admin/django_dynamic_theme/ to start customizing your theme.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_dynamic_theme-0.0.10.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

django_dynamic_theme-0.0.10-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file django_dynamic_theme-0.0.10.tar.gz.

File metadata

  • Download URL: django_dynamic_theme-0.0.10.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for django_dynamic_theme-0.0.10.tar.gz
Algorithm Hash digest
SHA256 bd6bdf854ab9877af6764290252b3a5c01400366140ec68c61c7b8a9dd7da78b
MD5 cfe0dd4000a7d695646f11eaccdcc5bc
BLAKE2b-256 c9f7ac64a719efd1790927749073bba79ceddc6d14f81d14cb77fd48ff2d8251

See more details on using hashes here.

File details

Details for the file django_dynamic_theme-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for django_dynamic_theme-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 30e1cddf66b53f098e4e2c2cae9e3b23d35c0a6929b2bd863ad5029595aff161
MD5 7f0606c30cb93c85b275c95d032eac65
BLAKE2b-256 003331680272ea5496687ad08350e1e1c8bba73fce5aafa4c749cb46eadae0b1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page