Skip to content
Reusable "Site settings" Django application
Python
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
simple_settings
.gitignore
LICENSE
README.md

README.md

Django simple_settings

simple_settings is a simple and a reusable Django application for providing a simple Site Settings model that has only one instance which is available via a template tag

Quick start

  1. Copy the simple_settings folder to your Django project

  2. Add "simple_settings" to your INSTALLED_APPS setting like this

    INSTALLED_APPS = [
        ...
        'simple_settings',
    ]
  3. Include simple_settings.context_processors.settings into the template context processors inside your settings.py

    TEMPLATES = [
        {
        ...
            'OPTIONS': {
            ...
                'context_processors': [
                    'simple_settings.context_processors.settings',
                ...
                ],
            },
        },
    ]
  4. Run python manage.py makemigrations && python manage.py migrate to create the simple_settings model.

  5. Start the development server and visit http://127.0.0.1:8000/admin/ you will find the new Site Settings application that you can only edit.

  6. To use these settings in your templates, just include {{ settings.FIELD_NAME }}, for example:

        <div>
            <h2>About us</h2>
            <p>{{settings.about_us}}</p>
        </div>
  7. To costumize your site settings, go to simple_settings/models.py and add your fields then run python manage.py makemigrations && python manage.py migrate again

Thanks to

You can’t perform that action at this time.