Skip to main content

The National Archives frontend Django templates

Project description

The National Archives Frontend Django Templates

Main build status Latest release PyPi version Python version Licence

Django templates implementation of TNA components for inclusion in Python applications.

python3 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt
npm install
python manage.py runserver 8080
node tasks/test.mjs

http://localhost:8080/

git tag v0.1.0
git push origin --tags
python3 -m build
python3 -m pip install --upgrade twine
# python3 -m twine upload --repository testpypi dist/*
python3 -m twine upload dist/*

How to use in your own Django project

Templates

  1. Install the nationalarchives-frontend-django package from PyPi
from distutils.sysconfig import get_python_lib

TEMPLATES = [
    {
        "DIRS": [
            os.path.join(get_python_lib(), "nationalarchives-frontend-django/templates")
        ],
    }
]

Styles

Install the @nationalarchives/frontend package from npm with npm install @nationalarchives/frontend

Add the config to enable you to use the static files:

STATICFILES_DIRS = [
    "node_modules/@nationalarchives/frontend"
]

Import the stylesheet with:

{% load static %}
<link rel="stylesheet" href="{% static 'nationalarchives/all.css' %}">

The @nationalarchives/frontend package also includes the SCSS if you wish to compile the CSS yourself.

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

Built Distribution

File details

Details for the file nationalarchives-frontend-django-0.1.0a0.tar.gz.

File metadata

File hashes

Hashes for nationalarchives-frontend-django-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 743fe3e06b9bd52952fa642335cca141198ff5bb2e5cf668a7f64eebf2131346
MD5 7a10076c2018700b66a088f6fe94794b
BLAKE2b-256 013dcc44725afcd5de9b3b98113889cc70d0242cc8fa7ca9eddd9d8e565baf0b

See more details on using hashes here.

File details

Details for the file nationalarchives_frontend_django-0.1.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for nationalarchives_frontend_django-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 9070161ba87f9514a0757ffd8acb35970cfc939da7fc1cbd0d495f6075b8f101
MD5 48ee5e06066f144dc53b4db99750fe35
BLAKE2b-256 e78fd2cbbd023e953fd48f21f97d49d2ea3f3af570f3d4f1ccae0a38ecd42acb

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