debian - Django admin panel works but main page gives me a 404 -


i'm brand new django , python. i've done php.

it took me 3 tries, i've django installed correctly. followed tutorial on installing it, , worked. enabled admin, panel, , set mysql.

the admin panel works, , i've got static folder has of css well. when go main page 404. (my project called firstweb) wheni go firstweb there 404, firstweb/admin works.

using urlconf defined in firstweb.urls, django tried these url patterns, in order:   1.   ^admin/  current url, firstweb/, didn't match of these. 

and i'm confused whole runserver thing. other little server other apache? why need start every time?

from django.conf.urls import patterns, include, url  # uncomment next 2 lines enable admin: django.contrib import admin admin.autodiscover()  urlpatterns = patterns('', # examples: # url(r'^$', 'firstweb.views.home', name='home'), # url(r'^firstweb/', include('firstweb.foo.urls')),  # uncomment admin/doc line below enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),  # uncomment next line enable admin: url(r'^admin/', include(admin.site.urls)), ) 

it looks url conf not include url pattern other pages accept admin.

if want root url display page, uncomment line

url(r'^$', 'firstweb.views.home', name='home'), 

and make sure in firstweb/views.py have view function called 'home', assume part of tutorial.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -