Skip to content

Commit

Permalink
Merge pull request pallets#3662 from lgiordani/remove-debug-from-exam…
Browse files Browse the repository at this point in the history
…ples

Removed misleading DEBUG variable from examples
  • Loading branch information
jab authored Jun 24, 2020
2 parents 9075da1 + 2254adf commit 3349c49
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ sure to use uppercase letters for your config keys.
Here is an example of a configuration file::

# Example configuration
DEBUG = False
SECRET_KEY = b'_5#y2L"F4Q8z\n\xec]/'

Make sure to load the configuration very early on, so that extensions have
Expand Down Expand Up @@ -554,17 +553,16 @@ An interesting pattern is also to use classes and inheritance for
configuration::

class Config(object):
DEBUG = False
TESTING = False
DATABASE_URI = 'sqlite:///:memory:'

class ProductionConfig(Config):
DATABASE_URI = 'mysql://user@localhost/foo'

class DevelopmentConfig(Config):
DEBUG = True
DATABASE_URI = "sqlite:////tmp/foo.db"

class TestingConfig(Config):
DATABASE_URI = 'sqlite:///:memory:'
TESTING = True

To enable such a config you just have to call into
Expand All @@ -589,7 +587,6 @@ your configuration classes::

class Config(object):
"""Base config, uses staging database server."""
DEBUG = False
TESTING = False
DB_SERVER = '192.168.1.56'

Expand All @@ -603,11 +600,9 @@ your configuration classes::

class DevelopmentConfig(Config):
DB_SERVER = 'localhost'
DEBUG = True

class TestingConfig(Config):
DB_SERVER = 'localhost'
DEBUG = True
DATABASE_URI = 'sqlite:///:memory:'

There are many different ways and it's up to you how you want to manage
Expand Down

0 comments on commit 3349c49

Please sign in to comment.