Django, urls.py, include doesn't seem to be working
Question: I'm trying to include an additional urls.py inside my main urls - however it
doesn't seem to be working. I've done a bunch of searching and I can't seem to
figure it out

main urls.py file - the admin works fine

    
    
    from django.conf.urls.defaults import patterns, include, url
    
    from django.contrib import admin
    admin.autodiscover()
    
    urlpatterns = patterns('',
            (r'^pnasser/',include('pnasser.urls')),
            (r'^admin/',include(admin.site.urls)),
            (r'^',include('pnasser.urls')),
    )
    

I then have a folder pnasser, with the file urls.py with the following:

    
    
    from django.conf.urls.defaults import patterns, include, url
    
    urlpatterns = patterns('pnasser.views',
            (r'^$','index'),
            (r'^login/$','login'),
            (r'^signup/$','signup'),
            (r'^insertaccount/$','insertaccount'),
            (r'^home/$','home'),
            (r'^update/(?P<accid>\d+)','update'),
            (r'^history/(?P<accid>\d+)','account_history'),
            (r'^logout/(?P<accid>\d+)','logout'),
    
    )
    

I'm not sure if I'm maybe missing something else in the configuration. if I
visit mysite.com/admin it loads the admin correctly, if I goto mysite or any
other url in the views I get 404 page not found:

> Using the URLconf defined in mysite.urls, Django tried these URL patterns,
> in this order: 1\. ^pnasser/ 2\. ^admin/
>
> The current URL, , didn't match any of these.

**edit** settings.py installed apps:

    
    
    INSTALLED_APPS = (
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        #'django.contrib.sites',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        # Uncomment the next line to enable the admin:
         'django.contrib.admin',
        # Uncomment the next line to enable admin documentation:
        # 'django.contrib.admindocs',
            'pnasser',
    
    )
    

**Update 2**

So, I also tried running my site via the dev server: `python manage.py
runserver 0.0.0.0:8000` this works. I'm assuming somewhere in my integration
with apache using mod_wsgi is the problem. However, I'm not sure where the
problem would be


Answer: The problem seemed to be in the django.wsgi file - and the differences in how
the standard django.wsgi file loads a python site vs how the development
server loads the site. I guess it's a well known issue, that I was unaware of.
Thanks everyone for the suggestions.

Alternative django.wsgi file found here:
<http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html>

