# HG changeset patch # User Mads Kiilerich # Date 2020-06-08 13:36:21 # Node ID f79dff927ab9556f0b8dc241ab153456c10f77c2 # Parent 5fe492c6d7d70ddd36b7c280f9b657068ed92ce3 ini: change .ini template to include sqlalchemy.url examples for all database types Rely less on users creating their initial .ini "correctly" with the right database choice. diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -359,10 +359,9 @@ logview.pylons.util = #eee ## DB CONFIG ## ######################### -## SQLITE [default] sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 - -## see sqlalchemy docs for other backends +#sqlalchemy.url = postgresql://user:pass@localhost/kallithea +#sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 sqlalchemy.pool_recycle = 3600 diff --git a/kallithea/lib/paster_commands/template.ini.mako b/kallithea/lib/paster_commands/template.ini.mako --- a/kallithea/lib/paster_commands/template.ini.mako +++ b/kallithea/lib/paster_commands/template.ini.mako @@ -453,19 +453,20 @@ logview.pylons.util = #eee <%text>######################### %if database_engine == 'sqlite': -<%text>## SQLITE [default] sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 - -%elif database_engine == 'postgres': -<%text>## POSTGRESQL +%else: +#sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 +%endif +%if database_engine == 'postgres': sqlalchemy.url = postgresql://user:pass@localhost/kallithea - -%elif database_engine == 'mysql': -<%text>## MySQL +%else: +#sqlalchemy.url = postgresql://user:pass@localhost/kallithea +%endif +%if database_engine == 'mysql': sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 - +%else: +#sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 %endif -<%text>## see sqlalchemy docs for other backends sqlalchemy.pool_recycle = 3600