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'),
)
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?