From 6c27e0e6ff88583b4ea632bd959e3c08e2f2eee6 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 22 Mar 2018 03:30:43 +0530 Subject: [PATCH] redirect form view instead of url --- datacenterlight/urls.py | 5 +++-- datacenterlight/views.py | 7 +------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/datacenterlight/urls.py b/datacenterlight/urls.py index 2c13abca..af8e76f2 100644 --- a/datacenterlight/urls.py +++ b/datacenterlight/urls.py @@ -8,12 +8,13 @@ from .views import ( urlpatterns = [ - url(r'^$', RedirectView.as_view(url='/cms/datacenterlight/'), - name='index'), + url(r'^$', IndexView.as_view(), name='index'), url(r'^t/$', IndexView.as_view(), name='index_t'), url(r'^g/$', IndexView.as_view(), name='index_g'), url(r'^f/$', IndexView.as_view(), name='index_f'), url(r'^l/$', IndexView.as_view(), name='index_l'), + url(r'^new/$', RedirectView.as_view(url='/cms/datacenterlight/'), + name='cms_index'), url(r'^whydatacenterlight/?$', WhyDataCenterLightView.as_view(), name='whydatacenterlight'), url(r'^payment/?$', PaymentOrderView.as_view(), name='payment'), diff --git a/datacenterlight/views.py b/datacenterlight/views.py index faa1d59c..5517abaf 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -96,12 +96,7 @@ class IndexView(CreateView): for session_var in ['specs', 'user', 'billing_address_data']: if session_var in request.session: del request.session[session_var] - - vm_templates = VMTemplate.objects.all() - context = { - 'templates': vm_templates - } - return render(request, self.template_name, context) + return HttpResponseRedirect(reverse('datacenterlight:cms_index')) def post(self, request): cores = request.POST.get('cpu')