diff --git a/KeRS/settings.py b/KeRS/settings.py index 12c7f24..bdacb97 100644 --- a/KeRS/settings.py +++ b/KeRS/settings.py @@ -38,14 +38,14 @@ OWN_APPS = [ ] INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'django_celery_beat' - ] + OWN_APPS + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django_celery_beat' +] + OWN_APPS MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', @@ -143,19 +143,20 @@ STATICFILES_DIRS = [ CELERY_BROKER = os.getenv('CELERY_BROKER', 'redis://localhost:6379/0') CELERY_BACKEND = os.getenv('CELERY_BACKEND', 'redis://localhost:6379/1') -# Custom stuff -SERVER_URL = 'http://localhost:8000' +# OAuth + +BASE_URL = os.getenv('BASE_URL', 'http://localhost:8000') AUTH_USER_MODEL = 'users.CustomUser' -_BASE_OAUTH_URL = 'https://adams.ugent.be/oauth' +_BASE_OAUTH_URL = os.getenv('OAUTH_BASE_URL', 'https://adams.ugent.be/oauth') OAUTH = { 'USER_API_URI': f'{_BASE_OAUTH_URL}/api/current_user/', 'ACCESS_TOKEN_URI': f'{_BASE_OAUTH_URL}/oauth2/token/', 'AUTHORIZE_URI': f'{_BASE_OAUTH_URL}/oauth2/authorize/', - 'REDIRECT_URI': f'{SERVER_URL}/login/zeus/authorized', - 'CLIENT_ID': 'tomtest', - 'CLIENT_SECRET': 'blargh', + 'REDIRECT_URI': f'{BASE_URL}/login/zeus/authorized', + 'CLIENT_ID': os.getenv('OAUTH_CLIENT_ID', 'tomtest'), + 'CLIENT_SECRET': os.getenv('OAUTH_CLIENT_SECRET', 'blargh'), }