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
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.
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.
XMPP_BACKENDS¶
This setting configures the backend used to communicate with your XMPP server. Please see the xmpp-backends library for more information.
SOCIAL_MEDIA_TEXTS¶
Todo
List all possible social media texts to override.