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
Close
Hashes for nationalarchives-frontend-django-0.1.1a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa3d14c3ec6c83a856362447109c9c112e737f226f3cd4ad8c53907d5baeffc2 |
|
MD5 | e4a533f2b7e4f897d89899f8ac41e273 |
|
BLAKE2b-256 | 69d4f31f64e434e6b4019109244cd289a65636df1b70d30ab84e7d63e267fa01 |
Close
Hashes for nationalarchives_frontend_django-0.1.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ab9853435502db849a633a905a250a7f29fa2ef69c6c149a3547cfe23199269 |
|
MD5 | 955d57941b02dc9c491a1b8d16a17d6a |
|
BLAKE2b-256 | 4a0665d04a37028e3247599b30bde6bff03e7f239ed2da01b06137f236db8038 |