Allow running from working directory

This commit is contained in:
Sunil Mohan Adapa 2014-08-31 16:32:11 +05:30
parent 4625bc55df
commit f243dfa3ab
8 changed files with 10 additions and 13 deletions

11
.gitignore vendored
View File

@ -1,12 +1,11 @@
current-*.tar.gz
*.pyc
*.py.bak
*.swp
*.tiny.css
data/*.log
data/cherrypy_sessions
data/sessions
data/store.sqlite3
data/var/log/plinth/*.log
data/var/lib/plinth/*.sqlite3
data/var/lib/plinth/sessions/*
data/var/run/*.pid
doc/*.tex
doc/*.pdf
doc/*.html
@ -24,10 +23,8 @@ TODO
\#*
.#*
*~
data/plinth.sqlite3
predepend
build/
*.pid
.emacs.desktop*
*.egg-info/
dist/

View File

View File

View File

0
data/var/run/.gitkeep Normal file
View File

View File

@ -5,10 +5,10 @@ box_name = FreedomBox
[Path]
# directory locations
file_root = %(root)s
data_dir = %(file_root)s/data
log_dir = %(data_dir)s
pid_dir = %(data_dir)s
server_dir = plinth/
data_dir = %(file_root)s/data/var/lib/plinth
log_dir = %(file_root)s/data/var/log/plinth
pid_dir = %(file_root)s/data/var/run
server_dir = /
actions_dir = %(file_root)s/actions
doc_dir = %(file_root)s/doc

View File

@ -194,7 +194,7 @@ def configure_django():
ROOT_URLCONF='plinth.urls',
SESSION_ENGINE='django.contrib.sessions.backends.file',
SESSION_FILE_PATH=sessions_directory,
STATIC_URL=cfg.server_dir + '/static/',
STATIC_URL='/'.join([cfg.server_dir, 'static/']).replace('//', '/'),
TEMPLATE_CONTEXT_PROCESSORS=context_processors,
TEMPLATE_DIRS=template_directories)

View File

@ -39,7 +39,7 @@ def read():
parser = SafeConfigParser(
defaults={
'root': directory,
'root': os.path.realpath(directory),
})
parser.read(config_file)