Index(View) rendering template instead of view

14 views
Skip to first unread message

Brad Rice

unread,
Feb 24, 2015, 9:03:52 AM2/24/15
to django...@googlegroups.com
So I have a RedirectView.as_view() going to a page in an app called web.

In the app web this is my view:

class Index(View):

    def get(self, request, *args, **kwargs):
        return HttpResponse('Hello, World!')

However, instead of showing that, when I get redirected to the app it shows my base template and index template even though I have not specified them in my Index view. It appears my url is not hitting the view.

Here is my urls.py in web: 

from django.conf.urls import *
import os
from .views import Index, gallery

urlpatterns = patterns('',
url(r'^$', Index.as_view(), name='index'),
url(r'^gallery', gallery, name='gallery'),
)

Here is the website: www.lodiharrisvillehistorical.org

notice it going to /web but not echoing out Hello, World!

also notice gallery is working and finding the view.

Why is it not picking up the Index view and instead displaying a template with no context?
Reply all
Reply to author
Forward
0 new messages