The National Archives frontend Django templates
Project description
The National Archives Frontend Django Templates
Django templates implementation of TNA components for inclusion in Python Django applications.
# Create a virtual environment
python3 -m venv venv
. ./venv/bin/activate
# Install the dependencies
pip install -r requirements.txt
npm install
# Run the server
python manage.py runserver 8080
# Run the tests against the running server
node tasks/test.mjs
How to use in your own Django project
Templates
- Install the
nationalarchives-frontend-djangopackage 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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nationalarchives-frontend-django-0.1.2a0.tar.gz.
File metadata
- Download URL: nationalarchives-frontend-django-0.1.2a0.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36c6668d8c73eb86e4a5f575cb2a858c0b294212557ee403dfb28e572f9c2668
|
|
| MD5 |
0bf4aa70f109e590b52736313854a246
|
|
| BLAKE2b-256 |
31ea40b699de5cd257b97393588ee2a4c05e2826f07b5ed59d327980eb6d5259
|
File details
Details for the file nationalarchives_frontend_django-0.1.2a0-py3-none-any.whl.
File metadata
- Download URL: nationalarchives_frontend_django-0.1.2a0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a93ad51c80a096ab82eef3b596e33f24a6c5cd95a510e5e4682c1df028beb1e
|
|
| MD5 |
af21688de3049fbd5e9bdf08cbd35a15
|
|
| BLAKE2b-256 |
08e362b0da8ef6cb40c1cb4d56dd75b49ccdf864ad3d7989365902283486f5a3
|