Browse Source

enough: define SHARE_DIR to access package data dir

keep-around/75c88b35a4c2644dee1419d0b8bc325a3b09a00f
singuliere 2 years ago
parent
commit
d07478ca74
No known key found for this signature in database GPG Key ID: 900857755EF189C2
  1. 3
      enough/settings.py

3
enough/settings.py

@ -12,14 +12,17 @@ https://docs.djangoproject.com/en/2.1/ref/settings/
import os
from os.path import dirname, join
import sys
# Build paths inside the project like this: os.path.join(CONFIG_DIR, ...)
ENOUGH_DOMAIN = os.environ.get('ENOUGH_DOMAIN', 'enough.community')
if os.path.exists('setup.cfg'): # running from sources
CONFIG_DIR = '.'
SHARE_DIR = '.'
else:
CONFIG_DIR = os.path.expanduser(f'~/.enough/{ENOUGH_DOMAIN}')
SHARE_DIR = f'{sys.prefix}/share/enough'
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/

Loading…
Cancel
Save