Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
DocuSign_test_project
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Volkov Gherman
DocuSign_test_project
Commits
5b4e2f86
Commit
5b4e2f86
authored
May 22, 2023
by
Volkov Gherman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
configure project settings with adding db-settings & .env configuration
parent
963940e1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
settings.py
core/settings.py
+12
-4
manage.py
manage.py
+1
-1
No files found.
core/settings.py
View file @
5b4e2f86
...
...
@@ -10,8 +10,12 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.2/ref/settings/
"""
import
os
from
pathlib
import
Path
from
dotenv
import
load_dotenv
load_dotenv
()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR
=
Path
(
__file__
)
.
resolve
()
.
parent
.
parent
...
...
@@ -20,7 +24,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'django-insecure-hvwjn!iz
%
=4^9z*i-vb&
%
cm$m=8pf*6(qp(#7
%
r14ysc$0v3k2'
SECRET_KEY
=
os
.
getenv
(
'SECRET_KEY'
)
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
...
...
@@ -75,9 +79,13 @@ WSGI_APPLICATION = 'core.wsgi.application'
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
'NAME'
:
BASE_DIR
/
'db.sqlite3'
,
}
'ENGINE'
:
'django.db.backends.postgresql'
,
'NAME'
:
os
.
getenv
(
'DATABASE_NAME'
),
'USER'
:
os
.
getenv
(
'DATABASE_USER'
),
'PASSWORD'
:
os
.
getenv
(
'DATABASE_PASSWORD'
),
'HOST'
:
os
.
getenv
(
'DATABASE_HOST'
),
'PORT'
:
os
.
getenv
(
'DATABASE_PORT'
),
},
}
...
...
manage.py
View file @
5b4e2f86
...
...
@@ -13,7 +13,7 @@ def main():
raise
ImportError
(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
"forget to activate a virtual environment?"
,
)
from
exc
execute_from_command_line
(
sys
.
argv
)
...
...
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