部署项目时找不到页面错误(探戈与django)

时间:2015-06-02 06:32:10

标签: python django

我已经通过这本书学习了django"如何与django"探戈。我试图在pythonanywhere.com上部署我的项目,这是在探戈与django建议的托管,幸运的是一切顺利。但是当我试图运行我的域时,我出现错误"页面未找到&# 34 ;.我再次尝试,但这次在我的pythonanywhere帐户上克隆整个tango_with_django_17项目,当我再次试图运行它时,仍然是同样的错误,它是这样的:

Using the URLconf defined in tango_with_django_project_17.urls,Django  tried these URL patterns, in this order:

^admin/
^rango/
^accounts/register/$ [name='registration_register']
^accounts/
media/(?P<path>.*)

The current URL, , didn't match any of these.

..我无法弄清问题在哪里。这是我的urls.py文件

from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static

from registration.backends.simple.views import RegistrationView

class MyRegistrationView(RegistrationView):
def get_success_url(selfself,request, user):
    return '/rango/'


 urlpatterns = patterns('',
        # Examples:
       #url(r'^$', 'tango_with_django_project_17.views.home', name='home'),
      #url(r'^blog/', include('blog.urls')),

     url(r'^admin/', include(admin.site.urls)),
     url(r'^rango/', include('rango.urls')),
     url(r'^accounts/register/$', MyRegistrationView.as_view(), name='registration_register'),
    (r'^accounts/', include('registration.backends.simple.urls')),
 )

    if not settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


  if settings.DEBUG:
      urlpatterns += patterns('django.views.static', (r'media/(?P<path>.*)', 'serve', {'document_root': settings.MEDIA_ROOT}), )

任何人都可以帮助我吗?

0 个答案:

没有答案