summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorankitjavalkar2018-07-20 11:42:22 +0530
committerGitHub2018-07-20 11:42:22 +0530
commit239ed05355e46448e3232d3a026e525f821a7841 (patch)
treef8ac3e70fe9d3130fba40a43d8a57288b549b197
parentb15117aa6755f71221520eb73bf6af1ab90b7f13 (diff)
parent7f306a0705ac6bf052f39cfd35a5a56ef13da187 (diff)
downloadonline_test-239ed05355e46448e3232d3a026e525f821a7841.tar.gz
online_test-239ed05355e46448e3232d3a026e525f821a7841.tar.bz2
online_test-239ed05355e46448e3232d3a026e525f821a7841.zip
Merge pull request #503 from ankitjavalkar/add-home-redirect
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))