parent
e29ead1fb0
commit
4c8b6f79de
2 changed files with 34 additions and 31 deletions
|
@ -12,9 +12,10 @@ You need sudo grants on this server, and it must be connected to Internet.
|
||||||
*Note: uMap also works with python 2.7 and 3.4, so adapt the package names if you work with another version.*
|
*Note: uMap also works with python 2.7 and 3.4, so adapt the package names if you work with another version.*
|
||||||
|
|
||||||
|
|
||||||
## Create a deployment directory:
|
## Create deployment directories:
|
||||||
|
|
||||||
sudo mkdir -p /srv/umap
|
sudo mkdir -p /srv/umap
|
||||||
|
sudo mkdir -p /etc/umap
|
||||||
|
|
||||||
*You can change this path, but then remember to adapt the other steps accordingly.*
|
*You can change this path, but then remember to adapt the other steps accordingly.*
|
||||||
|
|
||||||
|
@ -27,6 +28,11 @@ You need sudo grants on this server, and it must be connected to Internet.
|
||||||
on the various commands and configuration files if you go with your own.*
|
on the various commands and configuration files if you go with your own.*
|
||||||
|
|
||||||
|
|
||||||
|
## Give umap user access to the config folder
|
||||||
|
|
||||||
|
sudo chown umap:users /etc/umap
|
||||||
|
|
||||||
|
|
||||||
## Create a postgresql user
|
## Create a postgresql user
|
||||||
|
|
||||||
sudo -u postgres createuser umap
|
sudo -u postgres createuser umap
|
||||||
|
@ -65,15 +71,8 @@ you will need to run again this last line.*
|
||||||
|
|
||||||
## Create a local configuration file
|
## Create a local configuration file
|
||||||
|
|
||||||
wget https://raw.githubusercontent.com/umap-project/umap/master/umap/settings/local.py.sample -O /srv/umap/local.py
|
wget https://raw.githubusercontent.com/umap-project/umap/master/umap/settings/local.py.sample -O /etc/umap/umap.conf
|
||||||
|
|
||||||
Now we need to inform umap about it.
|
|
||||||
We'll create an environment variable for that:
|
|
||||||
|
|
||||||
export UMAP_SETTINGS=/srv/umap/local.py
|
|
||||||
|
|
||||||
*Note: this variable will not be persistent if you quit your current terminal session, so
|
|
||||||
remember to rerun this command if you open a new terminal window.*
|
|
||||||
|
|
||||||
## Create the tables
|
## Create the tables
|
||||||
|
|
||||||
|
@ -147,8 +146,6 @@ chdir = /srv/umap/
|
||||||
module = umap.wsgi
|
module = umap.wsgi
|
||||||
# the virtualenv (full path)
|
# the virtualenv (full path)
|
||||||
home = /srv/umap/venv
|
home = /srv/umap/venv
|
||||||
# the local settings path
|
|
||||||
env = UMAP_SETTINGS=/srv/umap/local.py
|
|
||||||
|
|
||||||
# process-related settings
|
# process-related settings
|
||||||
# master
|
# master
|
||||||
|
|
|
@ -9,7 +9,19 @@ from .base import * # NOQA, default values
|
||||||
# Allow to override setting from any file, may be out of the PYTHONPATH,
|
# Allow to override setting from any file, may be out of the PYTHONPATH,
|
||||||
# to make it easier for non python people.
|
# to make it easier for non python people.
|
||||||
path = os.environ.get('UMAP_SETTINGS')
|
path = os.environ.get('UMAP_SETTINGS')
|
||||||
if path:
|
if not path:
|
||||||
|
# Retrocompat
|
||||||
|
path = os.path.join('/etc', 'umap', 'umap.conf')
|
||||||
|
if not os.path.exists(path):
|
||||||
|
# Retrocompat
|
||||||
|
path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
||||||
|
'local.py')
|
||||||
|
if not os.path.exists(path):
|
||||||
|
msg = ('You must configure UMAP_SETTINGS or define '
|
||||||
|
'/etc/umap/umap.conf')
|
||||||
|
print(colorize(msg, fg='red'))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
d = imp.new_module('config')
|
d = imp.new_module('config')
|
||||||
d.__file__ = path
|
d.__file__ = path
|
||||||
try:
|
try:
|
||||||
|
@ -24,9 +36,3 @@ if path:
|
||||||
for key in dir(d):
|
for key in dir(d):
|
||||||
if key.isupper():
|
if key.isupper():
|
||||||
globals()[key] = getattr(d, key)
|
globals()[key] = getattr(d, key)
|
||||||
else:
|
|
||||||
# Retrocompat
|
|
||||||
try:
|
|
||||||
from .local import * # NOQA
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
Loading…
Reference in a new issue