Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1606828702-practice
Commits
f840d90c
Commit
f840d90c
authored
Sep 25, 2019
by
Rahmania Astrid Mochtar
Browse files
try using dj-database-url package
parent
443203e3
Pipeline
#21095
failed with stages
in 53 minutes and 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
requirements.txt
View file @
f840d90c
...
...
@@ -2,4 +2,5 @@ astroid==2.2.5
Django
==2.1.7
selenium
==3.141.0
gunicorn
==19.9.0
psycopg2
==2.8.3
\ No newline at end of file
psycopg2
==2.8.3
dj-database-url
==0.5.0
\ No newline at end of file
superlists/settings.py
View file @
f840d90c
import
dj_database_url
"""
Django settings for superlists project.
...
...
@@ -80,15 +81,13 @@ WSGI_APPLICATION = 'superlists.wsgi.application'
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.postgresql_psycopg2'
,
'NAME'
:
'todo_list'
,
# os.environ.get('DB_NAME', ''),
'USER'
:
'rahmania'
,
# os.environ.get('DB_USER', ''),
'PASSWORD'
:
'asdasd123'
,
# os.environ.get('DB_PASS', ''),
'HOST'
:
'localhost'
,
'PORT'
:
'5432'
'ENGINE'
:
'django.db.backends.sqlite3'
,
'NAME'
:
os
.
path
.
join
(
BASE_DIR
,
'db.sqlite3'
),
}
}
db_from_env
=
dj_database_url
.
config
(
conn_max_age
=
500
)
DATABASES
[
'default'
].
update
(
db_from_env
)
# Password validation
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
...
...
Write
Preview
Supports
Markdown
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