Skip to content

Commit

Permalink
Now reads DB url from environment variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
jovenlin0527 committed Jun 12, 2022
1 parent 2626fa0 commit bc3a53a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
12 changes: 8 additions & 4 deletions CNL_proj/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

import os

import dj_database_url

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

Expand Down Expand Up @@ -80,11 +82,13 @@
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases


DEFAULT_DATABASE = "spatialite:///db.spatialite"



DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.spatialite',
'NAME': os.path.join(BASE_DIR, 'db.spatialite'),
}
'default': dj_database_url.config(default=DEFAULT_DATABASE)
}


Expand Down
21 changes: 20 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ django-picklefield = "^3.0.1"
django-map-widgets = "^0.4.0"
google-auth-oauthlib = "^0.5.1"
google-auth-httplib2 = "^0.1.0"
dj-database-url = {git = "https://github.com/jazzband/dj-database-url"}

[tool.poetry.dev-dependencies]
django-sslserver = "^0.22"
Expand Down

0 comments on commit bc3a53a

Please sign in to comment.