urlpatterns = patterns('', url(r'^$', 'urus.app.views.main', name="main"), ) And in the last version when I use this way to define the URL an invalid syntax will popup.
2008/8/24 Handle Huang <[EMAIL PROTECTED]> > thanks for your replay. > but my problem is still here, the include function seems not work( I use > the last svn version of Django ). And you say why I having serveral > different URLS pointing to the same view is that the inculde function not > work, I have to point it directly (just to test if the view work well). > > 2008/8/24 timc3 <[EMAIL PROTECTED]> > > >> It looks like you are getting a little confused. For a start you don't >> match anything for just http://localhost:8000/ >> >> (r'^$', 'urus.app.views.main') >> >> Don't know whether thats on purpose or not. anyway. >> >> > urlpatterns = patterns('', >> > # Example: >> > # (r'^urus/', include('urus.foo.urls')), >> > >> > # Uncomment this for admin: >> > (r'^admin/', include('django.contrib.admin.urls')), >> > (r'^site_media/(?P<path>.*)$', >> > 'django.views.static.serve',{'document_root': settings.STATIC_PATH}), >> > (r'^accounts/login/$', 'django.contrib.auth.views.login', >> > {'template_name': 'personal/login.html'}), >> > (r'^urus/',include('urus.app.urls')), >> > (r'^app/','urus.app.views.main'), >> > >> > ) >> > >> > then the urus/app/urls.py >> > urlpatterns = patterns( >> > (r'^$', 'urus.app.views.main'), >> > ) >> >> In your first urls.py you seem to be trying to include at urus/app/ >> urls.py but I would use the following in there: >> >> urlpatterns = patterns('', >> url(r'^$', 'urus.app.views.main', name="main"), >> ) >> >> Then you get named URLS which will be helpful when you go on >> developing. >> >> Try that and see if it works but I would also try and rethink why you >> are having several different URLS pointing to the same view. >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---