Skip to content

Commit

Permalink
Use sqlite in tests; change to simpleJWT
Browse files Browse the repository at this point in the history
  • Loading branch information
n2o committed Aug 23, 2024
1 parent be53c37 commit 1a06280
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions mathefragen/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,24 @@

WSGI_APPLICATION = 'mathefragen.wsgi.application'

DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": env("DB_NAME", default="mathefragen"),
"USER": env("DB_USER", default="mathefragen"),
"PASSWORD": env("DB_PWD", default="mathefragen"),
"HOST": env("DB_HOST", default="localhost"),
"PORT": env("DB_PORT", default="5432")
if 'test' in sys.argv:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': f'${BASE_DIR}/db_test.sqlite3',
}
}
else:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": env("DB_NAME", default="mathefragen"),
"USER": env("DB_USER", default="mathefragen"),
"PASSWORD": env("DB_PWD", default="mathefragen"),
"HOST": env("DB_HOST", default="localhost"),
"PORT": env("DB_PORT", default="5432")
}
}
}

INTERNAL_IPS = [
# '127.0.0.1',
Expand Down Expand Up @@ -303,7 +311,7 @@
if DOMAIN not in portal:
HOT_NETWORK_QUESTIONS_API.append('%s/v1/question/hot/' % portal)

JWT_AUTH = {
SIMPLE_JWT = {
'JWT_ENCODE_HANDLER':
'rest_framework_jwt.utils.jwt_encode_handler',

Expand Down

0 comments on commit 1a06280

Please sign in to comment.