Metadata-Version: 2.1
Name: django-static-base
Version: 0.1.6
Summary: Django's application to serve up-to-date common static files (JQuery, Bootstrap, Plugins, ...) as "base" static directory
Home-page: https://github.com/DLRSP/django-static-base
Author: DLRSP
Author-email: dlrsp.dev@gmail.com
License: MIT License
Project-URL: Documentation, https://dlrsp.github.io/django-static-base/
Project-URL: Source, https://github.com/DLRSP/django-static-base
Project-URL: Tracker, https://github.com/DLRSP/django-static-base/issues
Keywords: django
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django >=3.2
Provides-Extra: linting
Requires-Dist: flake8 ; extra == 'linting'
Requires-Dist: pylint ; extra == 'linting'
Provides-Extra: testing
Requires-Dist: coverage ; extra == 'testing'
Requires-Dist: codecov ; extra == 'testing'

# django-static-base [![PyPi license](https://img.shields.io/pypi/l/django-static-base.svg)](https://pypi.python.org/pypi/django-static-base)

[![PyPi status](https://img.shields.io/pypi/status/django-static-base.svg)](https://pypi.python.org/pypi/django-static-base)
[![PyPi version](https://img.shields.io/pypi/v/django-static-base.svg)](https://pypi.python.org/pypi/django-static-base)
[![PyPi python version](https://img.shields.io/pypi/pyversions/django-static-base.svg)](https://pypi.python.org/pypi/django-static-base)
[![PyPi downloads](https://img.shields.io/pypi/dm/django-static-base.svg)](https://pypi.python.org/pypi/django-static-base)
[![PyPi downloads](https://img.shields.io/pypi/dw/django-static-base.svg)](https://pypi.python.org/pypi/django-static-base)
[![PyPi downloads](https://img.shields.io/pypi/dd/django-static-base.svg)](https://pypi.python.org/pypi/django-static-base)

## GitHub ![GitHub release](https://img.shields.io/github/tag/DLRSP/django-static-base.svg) ![GitHub release](https://img.shields.io/github/release/DLRSP/django-static-base.svg)

## Test [![codecov.io](https://codecov.io/github/DLRSP/django-static-base/coverage.svg?branch=main)](https://codecov.io/github/DLRSP/django-static-base?branch=main) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/DLRSP/django-static-base/main.svg)](https://results.pre-commit.ci/latest/github/DLRSP/django-static-base/main) [![gitthub.com](https://github.com/DLRSP/django-static-base/actions/workflows/ci.yaml/badge.svg)](https://github.com/DLRSP/django-static-base/actions/workflows/ci.yaml)

## Check Demo Project
* Check the demo repo on [GitHub](https://github.com/DLRSP/example/tree/django-static-base)

## Requirements
-   Python 3.8+ supported.
-   Django 3.2+ supported.

## Setup
1. Install from **pip**:
    ```shell
    pip install django-static-base
    ```

2. Add `'static_base'` to your `INSTALLED_APPS` setting.

    ``` python title="settings.py"
    INSTALLED_APPS = [
        # ...other apps
        "static_base"
    ]
    ```

3. Add the following pre-requisites to your `base.html` template

    ``` html title="base.html"
    <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>
    ```

4. Add all your needed plugins or customization to your `base.html` template or sub-templates used by your project

    ``` html title="base.html"
    <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

```shell
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
