==========================
Django Basetheme Bootstrap
==========================

A module handling basic fonctionnality needed in django project such as base.html using bootstrap, account settings, preferences management, ...

Detailed documentation is in the "docs" directory.

Quick start
-----------

1. Add "basetheme_bootstrap" to your INSTALLED_APPS setting like this (while not forgetting `crispy_forms`) ::

    INSTALLED_APPS = [
        ...
        'crispy_forms',
        'basetheme_bootstrap',
    ]

2. Add the context_processors::

    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': [],
            'APP_DIRS': True,
            'OPTIONS': {
                'context_processors': [
                    ...
                    'basetheme_bootstrap.context_processors.processors',
                ],
            },
        },
    ]

3. Adjust the configuration::


    ################################################################################
    # django-crispy-forms
    ################################################################################
    CRISPY_TEMPLATE_PACK = 'bootstrap4'

    ################################################################################
    # basetheme_bootstrap
    ################################################################################
    BASETHEME_BOOTSTRAP_TEMPLATE_LOCATION_PROJECT = "test_app_1"
    BASETHEME_BOOTSTRAP_USER_PREFERENCE_MODEL_ENABLED = True
    BASETHEME_BOOTSTRAP_USER_PREFERENCE_MODEL_LOCATION_APP = "test_app_1"
    BASETHEME_BOOTSTRAP_USER_PREFERENCE_MODEL_NAME = "MyUserPreferences"

    ################################################################################

3. Include the polls URLconf in your project urls.py like this::

    path('', include('basetheme_bootstrap.urls')),

3. Run `python manage.py migrate` to create the UserPreferences model if you decided to have one.

4. Make your templates extends base template from`basetheme_bootstrap`, or even better create your own base.html which extends the one from `basetheme_bootstrap`::

    {% extends "basetheme_bootstrap/base4.html" %}