Commit 56939716 by muhammad-ammar

upgrade django

parent 47c2d63d
......@@ -7,7 +7,8 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VEDA.settings.local')
from django.conf import settings
from rest_framework import routers
# from rest_framework.routers import DefaultRouter
from django.conf.urls import patterns, include, url
from django.conf.urls import include, url
from django.contrib.auth import login, logout
from django.contrib import admin
from VEDA_OS01 import views, transcripts
......@@ -22,13 +23,12 @@ router.register(r'urls', views.URLViewSet)
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
# Front End
url(r'^', include('frontend.urls')),
# API
url(r'^login/', views.user_login),
url(r'^accounts/login/$', 'django.contrib.auth.views.login', ),
url(r'^accounts/logout/$', 'django.contrib.auth.views.logout'),
url(r'^accounts/login/$', login),
url(r'^accounts/logout/$', logout),
url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
url(r'^api/', include(router.urls)),
# Transcript credentials handler view
......
......@@ -108,9 +108,6 @@ class CreateOauthAppClientTests(TestCase):
},
{
'client_id': ' ',
},
{
'client_id': None,
}
)
@ddt.unpack
......
from django.conf.urls import *
from django.conf.urls import url, include
from django.contrib import admin
admin.autodiscover()
from django.views.generic import TemplateView
import views
urlpatterns = patterns(
'',
(r'^$', views.index),
(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')),
(r'^admin/', include(admin.site.urls)),
urlpatterns = [
# '',
url(r'^$', views.index),
url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')),
# Input Form
(r'cat/', views.input_form),
url(r'cat/', views.input_form),
# Data Validation
(r'institution_validator/', views.institution_name),
(r'inst_id_validate/', views.inst_id_validate),
(r'institution_data/', views.institution_data),
(r'new_institution/', views.new_institution),
(r'course_id_validate/', views.course_id_validate),
(r'course_add/', views.course_add),
url(r'institution_validator/', views.institution_name),
url(r'inst_id_validate/', views.inst_id_validate),
url(r'institution_data/', views.institution_data),
url(r'new_institution/', views.new_institution),
url(r'course_id_validate/', views.course_id_validate),
url(r'course_add/', views.course_add),
# Uploads
(r'upload/', views.upload_alpha_1),
(r'upload_success/', views.upload_success),
(r'about_input/', views.about_input),
)
url(r'upload/', views.upload_alpha_1),
url(r'upload_success/', views.upload_success),
url(r'about_input/', views.about_input),
]
......@@ -9,7 +9,7 @@ import hashlib
import uuid
from django.http import HttpResponse
from django.template import RequestContext, loader
from django.template import loader
from django.http import HttpResponseRedirect
from frontend_env import *
......@@ -36,10 +36,10 @@ def index(request):
linkers = links
template = loader.get_template('index.html')
context = RequestContext(request, ({
context = {
'links': linkers,
'auth': auth
}))
}
return HttpResponse(template.render(context))
......@@ -57,10 +57,14 @@ def input_form(request):
inst_list = json.dumps(VC1.inst_list)
template = loader.get_template('course_form.html')
context = RequestContext(request, ({
'institution_list': inst_list
}))
return HttpResponse(template.render(context))
return HttpResponse(
template.render(
{
'institution_list': inst_list
}
)
)
def institution_name(request):
......@@ -191,24 +195,19 @@ def upload_alpha_1(request):
).digest())
template = loader.get_template('upload_video.html')
context = RequestContext(
request, ({
'policy': policy,
'signature': signature,
'abvid_serial': abvid_serial,
'access_key': auth_dict['veda_access_key_id'],
'upload_bucket': auth_dict['veda_upload_bucket'],
})
)
context = {
'policy': policy,
'signature': signature,
'abvid_serial': abvid_serial,
'access_key': auth_dict['veda_access_key_id'],
'upload_bucket': auth_dict['veda_upload_bucket'],
}
return HttpResponse(template.render(context))
def upload_success(request):
template = loader.get_template('upload_success.html')
context = RequestContext(
request, ({})
)
return HttpResponse(template.render(context))
return HttpResponse(template.render({}))
def about_input(request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment