Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
esi-table-data
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esi-data-scrapping
esi-table-data
Commits
defa1e5f
Commit
defa1e5f
authored
Aug 09, 2017
by
Vasyl Bodnaruk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dotenv to esi
parent
934e71b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
settings.py
esi/esi/settings.py
+15
-4
No files found.
esi/esi/settings.py
View file @
defa1e5f
...
@@ -11,6 +11,17 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
...
@@ -11,6 +11,17 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
"""
"""
import
os
import
os
from
os.path
import
join
,
dirname
from
dotenv
import
load_dotenv
dotenv_path
=
join
(
dirname
(
__file__
),
'.env'
)
load_dotenv
(
dotenv_path
)
def
get_env
(
name
):
return
os
.
environ
[
name
]
def
get_bool_env
(
name
):
return
True
if
os
.
environ
[
name
]
==
'True'
else
False
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
...
@@ -20,10 +31,10 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
...
@@ -20,10 +31,10 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'*
%
!eg7znv=2z5cak1fjt#6-org#i@pe
%
uy7vkks$&3otoupb8x'
SECRET_KEY
=
get_env
(
'SECRET_KEY'
)
# SECURITY WARNING: don't run with debug turned on in production!
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
DEBUG
=
get_bool_env
(
'DEBUG'
)
ALLOWED_HOSTS
=
[
'*'
]
ALLOWED_HOSTS
=
[
'*'
]
...
@@ -92,8 +103,8 @@ DATABASES = {
...
@@ -92,8 +103,8 @@ DATABASES = {
'esi'
:
{
'esi'
:
{
'ENGINE'
:
'django.db.backends.mysql'
,
'ENGINE'
:
'django.db.backends.mysql'
,
'NAME'
:
'esi'
,
'NAME'
:
'esi'
,
'USER'
:
'root'
,
'USER'
:
get_env
(
'DB_USER'
)
,
'PASSWORD'
:
'Q!W@q1w2mysql'
,
'PASSWORD'
:
get_env
(
'DB_PASSWORD'
)
,
'HOST'
:
'localhost'
,
'HOST'
:
'localhost'
,
'PORT'
:
'3306'
,
'PORT'
:
'3306'
,
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment