Django's application to serve up-to-date common static files (JQuery, Bootstrap, Plugins, ...) as "base" static directory
Project description
django-static-base
GitHub
Test
Check Demo Project
- Check the demo repo on GitHub
Requirements
- Python 3.8+ supported.
- Django 3.2+ supported.
Setup
-
Install from pip:
pip install django-static-base
-
Add
'static_base'
to yourINSTALLED_APPS
setting.INSTALLED_APPS = [ # ...other apps "static_base" ]
-
Add the following pre-requisites to your
base.html
template<html> <head> ... <link rel="stylesheet" type="text/css" href="{% static 'base/css/bootstrap.css' %}"> ... </head> <body> ... <script type="text/javascript" src="{% static 'base/js/jquery.min.js' %}"></script> <script type="text/javascript" src="{% static 'base/js/bootstrap.min.js' %}"></script> <script type="text/javascript" src="{% static 'base/js/plugins/lazysizes.min.js' %}" async></script> ... <script type="module" src="{% static 'base/js/plugins/instantpage.min.js' %}" defer></script> </body> </html>
-
Add all your needed plugins or customization to your
base.html
template or sub-templates used by your project<html> <head> ... <link rel="stylesheet" type="text/css" href="{% static 'base/css/plugins/jquery.smartmenus.bootstrap-4.css' %}"> ... <link rel="stylesheet" type="text/css" href="{% static 'base/css/style-btn.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'base/css/color/blue.css' %}"> ... <link rel="stylesheet" type="text/css" href="{% static 'base/css/custom.css' %}"> ... </head> <body> ... <script type="text/javascript" src="{% static 'base/js/jquery.min.js' %}"></script> <script type="text/javascript" src="{% static 'base/js/bootstrap.min.js' %}"></script> ... <script type="module" src="{% static 'base/js/plugins/instantpage.min.js' %}" defer></script> </body> </html>
Run Example Project
git clone --depth=50 --branch=django-static-base https://github.com/DLRSP/example.git DLRSP/example
cd DLRSP/example
python manage.py runserver
Now browser the app @ http://127.0.0.1:8000
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 django_static_base-0.2.0.tar.gz
.
File metadata
- Download URL: django_static_base-0.2.0.tar.gz
- Upload date:
- Size: 5.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7aaae48305ea5ab58f6866383406afd2bfedcfff18939be4112bd1e711ed96cc |
|
MD5 | 57ea461241eba8e23c25311714434b92 |
|
BLAKE2b-256 | 3d621dbf2385dea31ed630e7bacf11e2aec6c0f016e651c0b9b87dafcbb462f3 |
File details
Details for the file django_static_base-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_static_base-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.5 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ba5b7aa5f5365f96d08b583d576225bc002fded2bebd138eb87249dcae61b3e |
|
MD5 | f2073ac97efe106a4e87ff017fecb186 |
|
BLAKE2b-256 | 4d3e31556fde1aeff7c5151a2bdae1980aadcdca52a25522da6e2b47ded595be |