Skip to content
Myr

Removed misleading DEBUG variable from examples

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 9075da1 · Browse files · 1 file+1 added−6 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−6 removed

  • other:+1 added−6 removed

1 file+1 added−6 removed

modified:docs/config.rst+1 added-6 removed
427 unmodified lines
428429Here is an example of a configuration file::430431 # Example configuration432 DEBUG = False432 SECRET_KEY = b'_5#y2L"F4Q8z\n\xec]/'433434Make sure to load the configuration very early on, so that extensions have435the ability to access the configuration when starting up. There are other
116 unmodified lines
552An interesting pattern is also to use classes and inheritance for553configuration::554555 class Config(object):557 DEBUG = False556 TESTING = False557 DATABASE_URI = 'sqlite:///:memory:'558559 class ProductionConfig(Config):560 DATABASE_URI = 'mysql://user@localhost/foo'561562 class DevelopmentConfig(Config):565 DEBUG = True563 pass564565 class TestingConfig(Config):566 TESTING = True567
18 unmodified lines
586your configuration classes::587588 class Config(object):589 """Base config, uses staging database server."""592 DEBUG = False590 TESTING = False591 DB_SERVER = '192.168.1.56'592593 @property
5 unmodified lines
599 DB_SERVER = '192.168.19.32'600601 class DevelopmentConfig(Config):602 DB_SERVER = 'localhost'606 DEBUG = True603604 class TestingConfig(Config):605 DB_SERVER = 'localhost'610 DEBUG = True606 DATABASE_URI = 'sqlite:///:memory:'607608There are many different ways and it's up to you how you want to manage609your configuration files. However here a list of good recommendations:
101 unmodified lines