From e1e357e3efc7f1e7da4f058237a2cf96f48f4763 Mon Sep 17 00:00:00 2001 From: Paul Wagener Date: Wed, 7 Feb 2018 09:40:55 +0100 Subject: [PATCH] Oauth worknig --- requirements.txt | 1 + securityquiz/settings.py | 11 ++++------- templates/index.html | 4 ++-- views.py | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index 392f1b0..5fbb080 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ django django-oauth-toolkit django-cors-headers +pyopenssl \ No newline at end of file diff --git a/securityquiz/settings.py b/securityquiz/settings.py index fcb8c9a..2641857 100755 --- a/securityquiz/settings.py +++ b/securityquiz/settings.py @@ -9,7 +9,8 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) -import os, sys +import os +import sys BASE_DIR = os.path.dirname(os.path.dirname(__file__)) CLOSED = False @@ -26,7 +27,7 @@ DEBUG = False if 'runserver' in sys.argv: DEBUG = True -ALLOWED_HOSTS = ['websec.paulwagener.nl'] +ALLOWED_HOSTS = ['websec.paulwagener.nl', '127.0.0.1'] # Application definition @@ -43,7 +44,7 @@ INSTALLED_APPS = ( 'corsheaders', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -101,7 +102,6 @@ TEMPLATES = [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', - 'securityquiz.settings.closed', 'django.contrib.messages.context_processors.messages', ], }, @@ -111,6 +111,3 @@ TEMPLATES = [ STATICFILES_DIRS = ( PROJECT_PATH + '/static', ) - -def closed(request): - return {'CLOSED': CLOSED} diff --git a/templates/index.html b/templates/index.html index 1d8a736..56afb6b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -29,11 +29,11 @@
  • Wachtwoorden
  • - -