Skip to content

Commit

Permalink
Merge pull request #386 from ljwolford/remove_middleware
Browse files Browse the repository at this point in the history
Remove middleware
  • Loading branch information
ljwolford committed Mar 22, 2016
2 parents cda5fdf + 72fde7d commit 1670667
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 15 deletions.
32 changes: 31 additions & 1 deletion adl_lrs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,41 @@
"django.contrib.messages.context_processors.messages"
)

CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_METHODS = (
'HEAD',
'POST',
'GET',
'OPTIONS',
'DELETE',
'PUT'
)
CORS_ALLOW_HEADERS = (
'Content-Type',
'Content-Length',
'Authorization',
'If-Match',
'If-None-Match',
'X-Experience-API-Version',
'Accept-Language'
)
CORS_EXPOSE_HEADERS = (
'ETag',
'Last-Modified',
'Cache-Control',
'Content-Type',
'Content-Length',
'WWW-Authenticate',
'X-Experience-API-Version',
'Accept-Language'
)
MIDDLEWARE_CLASSES = (
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'adl_lrs.utils.AllowOriginMiddleware.AllowOriginMiddleware',
# Uncomment the next line for simple clickjacking protection:
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
Expand Down Expand Up @@ -222,6 +251,7 @@
'jsonify',
'south',
'endless_pagination',
'corsheaders',
)

REQUEST_HANDLER_LOG_DIR = path.join(PROJECT_ROOT, 'logs/django_request.log')
Expand Down
13 changes: 0 additions & 13 deletions adl_lrs/utils/AllowOriginMiddleware.py

This file was deleted.

Empty file removed adl_lrs/utils/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion lrs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def about(request):
}
}
}
}
}
return HttpResponse(json.dumps(lrs_data), mimetype="application/json", status=200)

@require_http_methods(["GET", "HEAD"])
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ bencode==1.0
psycopg2==2.5
isodate==0.4.9
pycrypto==2.5
django-cors-headers==1.1.0
django-extensions==1.1.1
jsonfield==0.9.19
oauth2==1.5.211
Expand Down

0 comments on commit 1670667

Please sign in to comment.