Settings

In general, as a Django project, this project is configured like any other project, in a file called settings.py, located at hp/hp/settings.py. Please see Djangos documentation on how settings work and the complete settings reference of all settings supported by Django. This project of course uses a few additional settings to make it more configurable.

To make the project more reusable, settings.py includes a file localsettings.py in the same folder, if it is present. localsettings.py is ignored in git, so you don’t have to maintain a separate branch or anything if you run your own copy. There is a file called localsettings.py.example that you can copy in order to get you started.

Stock settings

Some stock Django settings deserve a few additional notes.

INSTALLED_APPS

If you set INSTALLED_APPS to a callable in localsettings.py, that callable will be called with the default value of INSTALLED_APPS, the callable should return the list of the real value. This is useful if you want to add your own apps but do not want repeat all the default apps included in the project (which might change without notice).

For example, if you want to add your own skin app as first app (which could e.g. override templates or static files), you could do:

def INSTALLED_APPS(apps):
    apps.insert(0, 'skins')
    return apps

Project settings

Project settings are settings used by this project and are not native to Django. Most are documented in localsettings.py.example.

Warning

This section is very incomplete. Currently, localsettings.py.example should be considered the authoritative source.

ACCOUNT_EXPIRES_DAYS

Default: None

ACCOUNT_EXPIRES_NOTIFICATION_DAYS

Default: ACCOUNT_EXPIRES_DAYS minus seven days

ACCOUNT_USER_MENU

Default: (please see settings.py)

Configure the user menu displayed on all pages under /account, if the user is logged in. Just like with INSTALLED_APPS, you can either override the default value by setting a list or extend the default value by setting a callable.

The value is a list of two-tuples, the first being a resolvable URL name (with no arguments) and the second being a config dictionary:

ACCOUNT_USER_MENU = [
    ('account:detail', {
        # Title displayed in the menu
        'title': _('Overview'),

        # If False, the item is also displayed if the user does not (yet) have a confirmed
        # email address. The default is True.
        'requires_confirmation': False,
    }),
    #...

ADMIN_URL

Default: "/admin/"

The location of the admin interface, the default is "/admin/".

MAX_USERNAME_LENGTH

Default: 64

The maximum length for usernames when a user registers. This limit is only enforced on the main webpage (at /account/register/). Users with longer usernames can still be created via the admin interface, via the command line or via some import from the XMPP server.

Existing users with longer usernames don’t have any reduced functionality, they can still e.g. reset their password.

MIN_USERNAME_LENGTH

Default: 2

See MIN_USERNAME_LENGTH.

REQUIRE_UNIQUE_EMAIL

Default: False

Set to True to require users to use a unique email address. By default, users can use the same email address for multiple accounts.

SOCIAL_MEDIA_TEXTS

Todo

List all possible social media texts to override.

XMPP_BACKENDS

This setting configures the backend used to communicate with your XMPP server. Please see the xmpp-backends library for more information.