forked from kunalshah03/PackReview_Part2
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
""" | ||
config.py | ||
This module contains configuration settings for the application. | ||
""" | ||
|
||
import os | ||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
class Config(object): | ||
"""The class creates a connection to the database""" | ||
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or 'sqlite:///' + os.path.join(basedir, 'app.db') | ||
SQLALCHEMY_TRACK_MODIFICATIONS = False | ||
class Config: | ||
"""Configuration settings for the database connection.""" | ||
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \ | ||
'sqlite:///' + os.path.join(basedir, 'app.db') | ||
SQLALCHEMY_TRACK_MODIFICATIONS = False | ||
|
||
def get_database_uri(self): | ||
"""Returns the database URI.""" | ||
return self.SQLALCHEMY_DATABASE_URI | ||
|
||
def is_sqlalchemy_tracking_enabled(self): | ||
"""Returns whether SQLAlchemy tracking modifications is enabled.""" | ||
return self.SQLALCHEMY_TRACK_MODIFICATIONS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters