Skip to content
Myr

Changed example DATABASE_URI values

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Leonardo Giordani · committed by Leonardo Giordani · parent aec07a1 · Browse files · 1 file+6 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−2 removed

  • other:+6 added−2 removed

1 file+6 added−2 removed

modified:docs/config.rst+6 added-2 removed
550 unmodified lines
551552An interesting pattern is also to use classes and inheritance for553configuration::554555 import os556557 basedir = os.path.abspath(os.path.dirname(__file__))558 559 class Config(object):560 TESTING = False557 DATABASE_URI = 'sqlite:///:memory:'561562 class ProductionConfig(Config):563 DATABASE_URI = 'mysql://user@localhost/foo'564565 class DevelopmentConfig(Config):563 pass566 DATABASE_URI = "sqlite:///" + os.path.join(basedir, "foo.db")567568 class TestingConfig(Config):569 DATABASE_URI = 'sqlite:///:memory:'570 TESTING = True571572To enable such a config you just have to call into573:meth:`~flask.Config.from_object`::
141 unmodified lines