Django reporting 404 error on simple view?
Question: I'm just barely getting started with Python and Django.

I've created my modules, migrated, added my modules to the admin section, etc.
Now, I need to create my first view. I've been following [this
guide](https://docs.djangoproject.com/en/1.6/intro/tutorial03/) (Yes the
machine I'm on is running 1.6)

My views.py file in the app (setup) looks like this...

    
    
    from django.shortcuts import render
    from django.http import HttpResponse
    
    def index(request):
        return HttpResponse("Setup Index")
    

My app'a urls.py looks like this...

    
    
    from django.conf.urls import patterns, url
    from setup import views
    
    urlpatterns = patterns('',
        url(r'^$', views.index, name='index')
    )
    

And my root urls.py looks like this...

    
    
    from django.views.generic import TemplateView
    from django.views.generic.base import RedirectView
    from django.conf.urls import include, patterns, url
    from django.contrib import admin as djangoAdmin
    from admin.controller import ReportWizard
    from admin.forms import reportDetailsForm, reportDataViewsForm
    from setup import views
    djangoAdmin.autodiscover()
    
    
    urlpatterns = patterns('',
        url(r'^django-admin/', include(djangoAdmin.site.urls)),
        #New User Wizard URL
        url(r'^setup/', include('setup.urls')),
    )
    

As far as I can tell I have followed the guide to the letter, but I am
recieving a 404 error when navigating to myIP/setup.

There are no error messages on the 404 page. What is the issue?

[![enter image description
here](http://i.stack.imgur.com/XclnI.png)](http://i.stack.imgur.com/XclnI.png)


Answer: For some reason your settings seem to override the default for either
[`APPEND_SLASH`](https://docs.djangoproject.com/en/1.8/ref/settings/#append-
slash) or
[`MIDDLEWARE_CLASSES`](https://docs.djangoproject.com/en/1.8/ref/settings/#middleware-
classes).

Opening `http://example.com/setup` should cause a redirect to
`http://example.com/setup/`, but somehow it doesn't for you.

Note that the latter URL is matched by your `urls.py` while the former is not
(as should be the case).

The above should work if 'CommonMiddleWare`is enabled and`APPEND_SLASH`is set
to`True`.

