New website suggestion. Testing only.
71e7433040
Simply using bool() on the string returns True for every non-empty string. Hence, the only way to set a value to False is to set it the an empty string, which is counter-intuitive. This commit will instead compare the string to well-known values for True and return accordingly. Every other non-empty string is evaluated to False. Empty string are evaluated to the default value. |
||
---|---|---|
khaganat | ||
logs | ||
navbar | ||
neluser | ||
pages | ||
.gitignore | ||
LICENSE.txt | ||
manage.py | ||
Pipfile | ||
Pipfile.lock | ||
README.md |
Khaganat's web site
Requirements
- Python 3
- pipenv
- git
- gettext
Quick deployment
git clone https://git.khaganat.net/Tycho/khaganat-web.git khaganat-web
cd khaganat-web
vim .env
pipenv --python 3 --update
pipenv run ./manage.py migrate
pipenv run ./manage.py collectstatic
pipenv run ./manage.py compilemessages
pipenv run ./manage.py createsuperuser
Environment variables
You can set the following variables in the .env
file:
KHAGANAT_SECRET_KEY
(required): Django's secret key, keep it secret.KHAGANAT_DEBUG
: Debug mode, default is false.KHAGANAT_HOSTNAMES
: Allowed hostnames, coma separated.KHAGANAT_LANGUAGE_CODE
: Language code, default isfr
.KHAGANAT_TIME_ZONE
: Time zone, default isEurope/Paris
.KHAGANAT_STATIC_URL
: URL for static files, default is/static/
.KHAGANAT_STATIC_ROOT
: Absolute path to the directory where static files should be collected.KHAGANAT_LOGS_MIN_DAYS
: Numbers of days before logs are hidden, default is 7.KHAGANAT_LOGS_MAX_DAYS
: Number of days before logs are published, default is 0.KHAGANAT_LOGIN_URL
: The login URL, default is/account/login/
.KHAGANAT_LOGIN_REDIRECT_URL
: URL to redirect after user login. Will be reversed, default isindex
.KHAGANAT_REGISTER_REQUIRE_VALIDATION
: require email validation upon registration, default is true.KHAGANAT_EMAIL_HOST
: The host to use for sending email, default islocalhost
.KHAGANAT_EMAIL_PORT
: Port to use for the SMTP server, default is25
.KHAGANAT_EMAIL_HOST_USER
: Username to use for the SMTP server, default is empty (no authentication).KHAGANAT_EMAIL_HOST_PASSWORD
: Password to use for the SMTP server, default is empty.KHAGANAT_EMAIL_USE_TLS
: Whether to use a TLS connection to the SMTP server, default isFalse
.KHAGANAT_EMAIL_SUBJECT_PREFIX
: Subject-line prefix for email, default is empty.KHAGANAT_DEFAULT_FROM_EMAIL
: Default email address to use, default isno-reply@localhost
.