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.2a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36c6668d8c73eb86e4a5f575cb2a858c0b294212557ee403dfb28e572f9c2668 |
|
MD5 | 0bf4aa70f109e590b52736313854a246 |
|
BLAKE2b-256 | 31ea40b699de5cd257b97393588ee2a4c05e2826f07b5ed59d327980eb6d5259 |
Close
Hashes for nationalarchives_frontend_django-0.1.2a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a93ad51c80a096ab82eef3b596e33f24a6c5cd95a510e5e4682c1df028beb1e |
|
MD5 | af21688de3049fbd5e9bdf08cbd35a15 |
|
BLAKE2b-256 | 08e362b0da8ef6cb40c1cb4d56dd75b49ccdf864ad3d7989365902283486f5a3 |