summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorankitjavalkar2018-07-18 12:26:57 +0530
committerankitjavalkar2018-07-18 18:24:06 +0530
commit7f306a0705ac6bf052f39cfd35a5a56ef13da187 (patch)
treef8ac3e70fe9d3130fba40a43d8a57288b549b197
parentb15117aa6755f71221520eb73bf6af1ab90b7f13 (diff)
downloadonline_test-7f306a0705ac6bf052f39cfd35a5a56ef13da187.tar.gz
online_test-7f306a0705ac6bf052f39cfd35a5a56ef13da187.tar.bz2
online_test-7f306a0705ac6bf052f39cfd35a5a56ef13da187.zip
Add a redirect from url / to /exam
-rw-r--r--online_test/urls.py2
-rw-r--r--online_test/views.py7
2 files changed, 9 insertions, 0 deletions
diff --git a/online_test/urls.py b/online_test/urls.py
index 28c2a26..a09e961 100644
--- a/online_test/urls.py
+++ b/online_test/urls.py
@@ -2,6 +2,7 @@ from django.conf.urls import include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
+from online_test import views
admin.autodiscover()
urlpatterns = [
@@ -10,6 +11,7 @@ urlpatterns = [
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
+ url(r'^$', views.index, name='index'),
url(r'^exam/', include('yaksh.urls', namespace='yaksh', app_name='yaksh')),
url(r'^exam/reset/', include('yaksh.urls_password_reset')),
url(r'^', include('social.apps.django_app.urls', namespace='social')),
diff --git a/online_test/views.py b/online_test/views.py
new file mode 100644
index 0000000..8fcecd3
--- /dev/null
+++ b/online_test/views.py
@@ -0,0 +1,7 @@
+from django.shortcuts import redirect
+
+from .settings import URL_ROOT
+
+
+def index(request):
+ return redirect('{0}/exam/'.format(URL_ROOT))