-
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.
- Added external TOML file for secrets - Added dev and prod settings with a common base
- Loading branch information
1 parent
d03083e
commit 86caabd
Showing
9 changed files
with
69 additions
and
34 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
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 |
---|---|---|
|
@@ -13,3 +13,4 @@ django = "*" | |
django-ipware = "*" | ||
python-levenshtein = "*" | ||
requests = "*" | ||
toml = "*" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
secret_key = "" | ||
|
||
[databases.default] | ||
host = "" | ||
post = "" | ||
name = "" | ||
user = "" | ||
password = "" |
Empty file.
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from .base import * # noqa | ||
|
||
# Development settings, unsuitable for production | ||
|
||
DEBUG = True | ||
SECRET_KEY = "m@6$yuc0q!z@@_!t5s#a835%agbf#uamxw11&i5-f7j8(oftnx" | ||
|
||
ALLOWED_HOSTS = [] |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import toml | ||
|
||
from .base import * # noqa | ||
|
||
config_path = os.environ.get("HAWK_CONFIG", str(BASE_DIR / "config.toml")) | ||
|
||
try: | ||
config = toml.load(config_path) | ||
print(f"Using the config file at {config_path!r}") | ||
except OSError: | ||
config = {} | ||
|
||
DEBUG = False | ||
ALLOWED_HOSTS = [ | ||
'hawk.carrade.eu' | ||
] | ||
|
||
SECRET_KEY = config["secret_key"] | ||
|
||
DATABASES = { | ||
"default": { | ||
"ENGINE": "django.db.backends.mysql", | ||
"NAME": config["databases"]["default"].get("name", "hawk"), | ||
"USER": config["databases"]["default"].get("user", "hawk"), | ||
"PASSWORD": config["databases"]["default"]["password"], | ||
"HOST": config["databases"]["default"].get("host", ""), | ||
"PORT": config["databases"]["default"].get("port", ""), | ||
"CONN_MAX_AGE": 600, | ||
"OPTIONS": { | ||
"charset": "utf8mb4", | ||
}, | ||
}, | ||
} |
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