Skip to content

Commit

Permalink
fix: moving to database-url approach
Browse files Browse the repository at this point in the history
  • Loading branch information
sennierer committed Aug 28, 2023
1 parent 2b7e749 commit ad88af5
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 13 deletions.
81 changes: 78 additions & 3 deletions poetry.lock

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

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ apis-core = { git = "https://github.com/acdh-oeaw/apis-core.git", branch = "cola
apis-bibsonomy = { git = "https://github.com/acdh-oeaw/apis-bibsonomy.git", branch = "main" }
apis-highlighter = { git = "https://github.com/acdh-oeaw/apis_highlighter.git", branch = "main" }
sentry-sdk = "^1.29.2"
dj-database-url = "^0.5.0"
django-allow-cidr = "^0.6.0"
django-csp = "^3.7"
whitenoise = "^5.2.0"
apis-override-select2js = { git="https://github.com/acdh-oeaw/apis-override-select2js", tag="v0.1.0" }

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
13 changes: 3 additions & 10 deletions settings/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,10 @@
DEV_VERSION = False

INSTALLED_APPS += ['corsheaders', 'apis_bibsonomy', 'apis_highlighter']
DATABASES = {}

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('APIS_DB_NAME'),
'USER': os.environ.get('APIS_DB_USER'),
'PASSWORD': os.environ.get('APIS_DB_PASSWORD'),
'HOST': os.environ.get('APIS_DB_HOST', '127.0.0.1'),
'PORT': os.environ.get('APIS_DB_PORT', '3306'),
}
}
#DATABASES["default"] = dj_database_url.parse(os.environ['DATABASE_LOCAL'], conn_max_age=600)
DATABASES["default"] = dj_database_url.config(conn_max_age=600)


CSRF_TRUSTED_ORIGINS = ['sola.acdh-dev.oeaw.ac.at']
Expand Down

0 comments on commit ad88af5

Please sign in to comment.