Skip to content

Commit a021adc

Browse files
committed
main
refactor
1 parent 1817015 commit a021adc

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.pem
2-
config.ini
2+
config.ini
3+
.env
-103 Bytes
Binary file not shown.

frontend/settings.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@
1111
"""
1212

1313
from pathlib import Path
14-
from configparser import ConfigParser
14+
import os
1515

16-
config = ConfigParser()
17-
config.read("config.ini")
18-
19-
SECRET = config["app"]["SECRET_KEY"]
16+
SECRET = os.getenv("SECRET_KEY")
2017

2118
# Build paths inside the project like this: BASE_DIR / 'subdir'.
2219
BASE_DIR = Path(__file__).resolve().parent.parent

main.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# config data
2-
import configparser
3-
4-
config = configparser.ConfigParser()
5-
config.read("config.ini")
6-
7-
DB_USERNAME = config["database"]["USER_NAME"]
8-
DB_PASSWORD = config["database"]["USER_PASSWORD"]
2+
DB_USERNAME = os.getenv("USER_NAME")
3+
DB_PASSWORD = os.getenv("USER_PASSWORD")
94

105
# import dependencies
116
import speedtest

0 commit comments

Comments
 (0)