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-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
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
File details
Details for the file nationalarchives-frontend-django-0.1.1a0.tar.gz
.
File metadata
- Download URL: nationalarchives-frontend-django-0.1.1a0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa3d14c3ec6c83a856362447109c9c112e737f226f3cd4ad8c53907d5baeffc2 |
|
MD5 | e4a533f2b7e4f897d89899f8ac41e273 |
|
BLAKE2b-256 | 69d4f31f64e434e6b4019109244cd289a65636df1b70d30ab84e7d63e267fa01 |
File details
Details for the file nationalarchives_frontend_django-0.1.1a0-py3-none-any.whl
.
File metadata
- Download URL: nationalarchives_frontend_django-0.1.1a0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ab9853435502db849a633a905a250a7f29fa2ef69c6c149a3547cfe23199269 |
|
MD5 | 955d57941b02dc9c491a1b8d16a17d6a |
|
BLAKE2b-256 | 4a0665d04a37028e3247599b30bde6bff03e7f239ed2da01b06137f236db8038 |