From b829b3f13bbcfda869f905b5e73b7dd257b830f3 Mon Sep 17 00:00:00 2001 From: Xavier Codinas Date: Mon, 27 Jun 2016 19:08:35 +0200 Subject: [PATCH] Use home directory as default path for database and web root issue4488 review26421002 --- CHANGELOG | 1 + doc/topics/configuration.rst | 4 ++-- trytond/config.py | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9e0723fb25..79286b45ba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Use home directory as default path for database and web root. * Add count option on Action Window Domains * Remove window_name on Action Window * Return the calling keyword in ActionKeyword.get_keywords diff --git a/doc/topics/configuration.rst b/doc/topics/configuration.rst index 367ca52085..ff80ad9e60 100644 --- a/doc/topics/configuration.rst +++ b/doc/topics/configuration.rst @@ -52,7 +52,7 @@ root Defines the root path served by `GET` requests. -Default: `/var/www/localhost/tryton` +Default: Under the `www` directory of user's home running `trytond`. database -------- @@ -95,7 +95,7 @@ path The directory where Tryton stores files and so the user running `trytond` must have write access on this directory. -Default: `/var/lib/trytond/` +Default: The db folder under the user home directory running `trytond`. list ~~~~ diff --git a/trytond/config.py b/trytond/config.py index dc69ecc8ed..7a0d0a2236 100644 --- a/trytond/config.py +++ b/trytond/config.py @@ -43,11 +43,12 @@ class TrytonConfigParser(ConfigParser.RawConfigParser): ConfigParser.RawConfigParser.__init__(self) self.add_section('web') self.set('web', 'listen', 'localhost:8000') - self.set('web', 'root', '/var/www/localhost/tryton') + self.set('web', 'root', os.path.join(os.path.expanduser('~'), 'www')) self.add_section('database') self.set('database', 'uri', os.environ.get('TRYTOND_DATABASE_URI', 'sqlite://')) - self.set('database', 'path', '/var/lib/trytond') + self.set('database', 'path', os.path.join( + os.path.expanduser('~'), 'db')) self.set('database', 'list', 'True') self.set('database', 'retry', 5) self.set('database', 'language', 'en_US')