Skip to content
Myr

Merge pull request #3662 from lgiordani/remove-debug-from-examples

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

Removed misleading DEBUG variable from examples

authored by Joshua Bronson · committed by GitHub · parents 9075da1, 2254adf · Browse files · 1 file+2 added−7 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+2 added−7 removed

  • other:+2 added−7 removed

1 file+2 added−7 removed

modified:docs/config.rst+2 added-7 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 = False559 DATABASE_URI = 'sqlite:///:memory:'557558 class ProductionConfig(Config):559 DATABASE_URI = 'mysql://user@localhost/foo'560561 class DevelopmentConfig(Config):565 DEBUG = True562 DATABASE_URI = "sqlite:////tmp/foo.db"563564 class TestingConfig(Config):565 DATABASE_URI = 'sqlite:///:memory:'566 TESTING = True567568To enable such a config you just have to call into569:meth:`~flask.Config.from_object`::
16 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