Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This will depend on your server setup, and you should consult [Deploying Django]

One common step would be to install dependencies like this: `PIPENV_VENV_IN_PROJECT=1 pipenv install`. This will install dependencies within the project folder.

Then edit brutaldon/settings.py. You definitely need to change the values of SECRET_KEY and ALLOWED_HOSTS. Also edit the database parameters to match the database you chose. Then run `pipenv run python ./manage.py migrate` to populate the database.
Then create the file ~/.config/brutaldon_settings.py which overrides anything in brutaldon/settings.py. You definitely need to override SECRET_KEY and ALLOWED_HOSTS. Also edit the database parameters to match the database you chose. Then run `pipenv run python ./manage.py migrate` to populate the database.

I installed brutaldon with Apache and mod_wsgi. If you installed brutaldon in /usr/local/share/, you'd add config lines something like this to the virtual host brutaldon is installed in.

Expand Down
34 changes: 34 additions & 0 deletions brutaldon/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,37 @@

# Version number displayed on about page
BRUTALDON_VERSION = "2.14.1"

# Load custom settings outside repository tracked files, so private settings
# don't get added to the repository
import sys
def paths():
sys.path.append('???')
try:
from xdg import XDG_CONFIG_HOME, XDG_CONFIG_DIRS
except ImportError:
try:
from pathlib import Path
except ImportError:
home = os.environ['home']
else:
home = Path.home()
sys.path[-1] = os.path.join(home, ".config")
yield
sys.path[-1] = home
yield
else:
sys.path[-1] = XDG_CONFIG_HOME
yield
for directory in XDG_CONFIG_DIRS:
sys.path[-1] = directory
yield
finally:
sys.path.pop(-1)

for _ in paths():
try:
from brutaldon_settings import *
except ImportError: pass
else:
break