Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
library-app-django
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
Ilham Maulana
library-app-django
Commits
139453fc
Commit
139453fc
authored
Aug 09, 2024
by
Ilham Maulana
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: setting database
parent
652ce14f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
constants.py
config/constants.py
+16
-0
settings.py
config/settings.py
+3
-11
No files found.
config/constants.py
0 → 100644
View file @
139453fc
DATABASES
=
{
"default"
:
{
"ENGINE"
:
"django.db.backends.mysql"
,
"NAME"
:
"library_app_dev"
,
"USER"
:
"root"
,
"PASSWORD"
:
"ilhammaulana13"
,
"HOST"
:
"localhost"
,
"PORT"
:
"3306"
,
}
}
LIST_HOST
=
[
"localhost"
,
"127.0.0.1"
,
"192.168.2.252"
,
]
config/settings.py
View file @
139453fc
...
...
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/5.0/ref/settings/
"""
from
pathlib
import
Path
from
.settings
import
DATABASES
,
LIST_HOST
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR
=
Path
(
__file__
)
.
resolve
()
.
parent
.
parent
...
...
@@ -25,7 +26,7 @@ SECRET_KEY = "django-insecure-hkn&ykayorr75b$9*h^u&$@j(yl^%odsww0t&x%esl)le$t2$e
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
ALLOWED_HOSTS
=
[
"localhost"
,
"127.0.0.1"
]
ALLOWED_HOSTS
=
LIST_HOST
# Application definition
...
...
@@ -94,16 +95,7 @@ WSGI_APPLICATION = "config.wsgi.application"
# }
# }
DATABASES
=
{
"default"
:
{
"ENGINE"
:
"django.db.backends.mysql"
,
"NAME"
:
"library_app_dev"
,
"USER"
:
"root"
,
"PASSWORD"
:
"ilhammaulana13"
,
"HOST"
:
"localhost"
,
"PORT"
:
"3306"
,
}
}
DATABASES
=
DATABASES
# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
...
...
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