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 *.pyc
*.py.bak *.py.bak
*.swp *.swp
*.tiny.css *.tiny.css
data/*.log data/var/log/plinth/*.log
data/cherrypy_sessions data/var/lib/plinth/*.sqlite3
data/sessions data/var/lib/plinth/sessions/*
data/store.sqlite3 data/var/run/*.pid
doc/*.tex doc/*.tex
doc/*.pdf doc/*.pdf
doc/*.html doc/*.html
@ -24,10 +23,8 @@ TODO
\#* \#*
.#* .#*
*~ *~
data/plinth.sqlite3
predepend predepend
build/ build/
*.pid
.emacs.desktop* .emacs.desktop*
*.egg-info/ *.egg-info/
dist/ 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] [Path]
# directory locations # directory locations
file_root = %(root)s file_root = %(root)s
data_dir = %(file_root)s/data data_dir = %(file_root)s/data/var/lib/plinth
log_dir = %(data_dir)s log_dir = %(file_root)s/data/var/log/plinth
pid_dir = %(data_dir)s pid_dir = %(file_root)s/data/var/run
server_dir = plinth/ server_dir = /
actions_dir = %(file_root)s/actions actions_dir = %(file_root)s/actions
doc_dir = %(file_root)s/doc doc_dir = %(file_root)s/doc

View File

@ -194,7 +194,7 @@ def configure_django():
ROOT_URLCONF='plinth.urls', ROOT_URLCONF='plinth.urls',
SESSION_ENGINE='django.contrib.sessions.backends.file', SESSION_ENGINE='django.contrib.sessions.backends.file',
SESSION_FILE_PATH=sessions_directory, 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_CONTEXT_PROCESSORS=context_processors,
TEMPLATE_DIRS=template_directories) TEMPLATE_DIRS=template_directories)

View File

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