forked from orbit-oss/flask
Simplified version of file-based database
This commit is contained in:
parent
26ec470afb
commit
2254adf845
1 changed files with 1 additions and 5 deletions
|
|
@ -552,10 +552,6 @@ and import different hard-coded files based on that.
|
||||||
An interesting pattern is also to use classes and inheritance for
|
An interesting pattern is also to use classes and inheritance for
|
||||||
configuration::
|
configuration::
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
TESTING = False
|
TESTING = False
|
||||||
|
|
||||||
|
|
@ -563,7 +559,7 @@ configuration::
|
||||||
DATABASE_URI = 'mysql://user@localhost/foo'
|
DATABASE_URI = 'mysql://user@localhost/foo'
|
||||||
|
|
||||||
class DevelopmentConfig(Config):
|
class DevelopmentConfig(Config):
|
||||||
DATABASE_URI = "sqlite:///" + os.path.join(basedir, "foo.db")
|
DATABASE_URI = "sqlite:////tmp/foo.db"
|
||||||
|
|
||||||
class TestingConfig(Config):
|
class TestingConfig(Config):
|
||||||
DATABASE_URI = 'sqlite:///:memory:'
|
DATABASE_URI = 'sqlite:///:memory:'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue