Q:

User settings in django admin

I want to be able to change some settings from django admin, for example: site title or footer. I want to have app with model which includes this settings, but this settings should be in single copy. What the best way to do it?

A:

You can create a view with @staff_member_required decorator, which renders/saves a form:
from django.contrib.admin.views.decorators import staff_member_required
...
@staff_member_required
def edit_config(request, ):
    saved = False
    if request.method == "POST":
        form = ConfigForm(request.POST)
        if form.is_valid():
            ...
            # Do saving here
            saved = True
    else:
        form = ConfigForm()
        ...
    context = {
        'form': form,
        'saved': saved,
    }
    return render_to_response('staff/edit_config.html', context, context_instance=RequestContext(request))

Use django forms in the view, and pass it to the template.
then, in the template extend 'admin/base_site.html' so your form has a admin look and feel. Here's a sample template:
{% extends 'admin/base_site.html' %}
{% load i18n adminmedia %}

{% block title %}Edit Configuration {{ block.super }} {% endblock %}

{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}

{% block breadcrumbs %}
    <div class="breadcrumbs">
        <a href="/admin/">{% trans "Home" %}</a> > Edit Configuration
    </div>
{% endblock %}

{% block content %}
    <h1>Edit Configuration</h1>
    {% if saved %}
        <p class="success" style="background-color:#9F9; padding: 10px; border: 1px dotted #999;">
            Settings were saved successfully!
        </p>
    {% endif %}
    <form method="POST" action="">
        {% csrf_token %}
        <fieldset class="module aligned">
            <h2>Configuration</h2>
            <div class="description"></div>
            {% for field in form %}
                <div class="form-row {% if field.errors %}errors{% endif %}">
                    {{ field.errors }}
                    <div class="field-box">
                        {{ field.label }} : {{ field }}
                        {% if field.help_text %}
                            <p class="help">{{ field.help_text|safe }}</p>
                        {% endif %}
                    </div>
                </div>
            {% endfor %}
        </fieldset>
        <div class="submit-row">
            <input type="submit" value="{% trans 'Save' %}" class="default" name="_save"/>
        </div>
    </form>
{% endblock %}

You can use database, ini files, redis, ... for storing your configuration. You may define some general backend, and inherit your custom backends from it so it's flexible. 

