Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.16 KB

README.md

File metadata and controls

54 lines (41 loc) · 1.16 KB

Django app for the IASTATE theme

Set up

In apps.py of your project, create a subclass of IastatethemeConfig and override any settings you want

from iastatetheme.apps import IastatethemeConfig

class TurtlebaseThemeConfig(IastatethemeConfig):
    site_name = 'Turtlebase'

In settings.py of your project, add that class to your installed apps

INSTALLED_APPS = [
    # ...
    'turtlebase.apps.TurtlebaseThemeConfig',
]

Then, also in settings.py, add this to your TEMPLATE settings:

TEMPLATES = [
    {
        # ...
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'OPTIONS': {
            'context_processors': [
                # ...
                'iastatetheme.context_processors.theme_config',
            ],
        },
    },
]

Usage

A basic page template would look like this:

{% extends "iastatetheme/base.html" %}

{% block content %}
    <div class="container">
    Hello world
    </div>
{% endblock %}

You can override templates in your project by copying a template file from templates/iastatetheme to yourproject/templates/iastatetheme and modifying it.