Skip to main content

django-dark

Preamble

This is just a fresh playground, stay tuned or feel free to contribute.

Setup

pip install django-dark

Integration

  1. Add "dark" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'dark',
    ]
    
  2. Modify Django's base_site.html

    {% block extrahead %}
        .
        .
        <link href="/static/admin/css/dark.css" type="text/css" media="(prefers-color-scheme: dark)" rel="stylesheet">
    {% endblock %}
    

    Template can be found here:

  3. Helper Classes

    If you are using tintable images (one colored icons), you can add the class "img-invertable", which simply represents:

    .img-invertable {
        filter: invert(0.7)
    }
    

Current Result

Dark Light

Developer Notes

# alias sv="source .virtualenv/bin/activate"
# alias vv="mkdir .virtualenv && python3 -m venv .virtualenv && sv"
vv
sv
pip install -r requirements/common.txt

# Compile Examples
lesscpy -x dark/less/dark.less dark/static/admin/css/dark.css
watchmedo shell-command --wait --patterns="*.less" --recursive --command "lesscpy -V -x dark/less/dark.less dark/static/admin/css/dark.css"
watchmedo shell-command --wait --patterns="*.less" --recursive --command "lesscpy -V -x dark/less/dark.less dark/static/admin/css/dark.css && python manage.py collectstatic --noinput"

# Distribution
python setup.py sdist
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

Metadata

Release files for django-dark 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-dark 0.1.9
File Size Uploaded Provenance Actions
django-dark-0.1.9.tar.gz 6.7 kB Without provenance Details for django-dark-0.1.9.tar.gz

Release files / django-dark-0.1.9.tar.gz

Download URL django-dark-0.1.9.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e7209f3606c6df0338211f8d2a01b5858d6f9984795f63cbe38fc02bd959ed37
BLAKE2b-256 checksum
How to use checksums
11c99cfdc2c125f9936902c11e539522f3fcaac1a6faeb7f31b9be888a084f12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Security for django-dark 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page