Skip to content
Myr

Simplified version of file-based database

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 26ec470 · Browse files · 1 file+1 added−5 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+1 added−5 removed

  • other:+1 added−5 removed

1 file+1 added−5 removed

modified:docs/config.rst+1 added-5 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__))558555 class Config(object):556 TESTING = False557558 class ProductionConfig(Config):559 DATABASE_URI = 'mysql://user@localhost/foo'560561 class DevelopmentConfig(Config):566 DATABASE_URI = "sqlite:///" + os.path.join(basedir, "foo.db")562 DATABASE_URI = "sqlite:////tmp/foo.db"563564 class TestingConfig(Config):565 DATABASE_URI = 'sqlite:///:memory:'566 TESTING = True
144 unmodified lines