1

我正在向我的 Django 应用程序发出请求,并看到此问题标题中列出的错误。我理解导入错误的概念,但不明白为什么我会得到这个。

这是完整的追溯

Traceback:
File "/home/chaz/dev/envs/payments_bss_com/local/lib/python2.7/site-packages/django/core/handlers/base.py" in   
get_response
  89.                     response = middleware_method(request)
File "/home/chaz/dev/envs/payments_bss_com/local/lib/python2.7/site-packages/django/middleware/common.py" in   
process_request
  67.             if (not urlresolvers.is_valid_path(request.path_info, urlconf) and
File "/home/chaz/dev/envs/payments_bss_com/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in is_valid_path
  531.         resolve(path, urlconf)
File "/home/chaz/dev/envs/payments_bss_com/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
  420.     return get_resolver(urlconf).resolve(path)
File "/home/chaz/dev/envs/payments_bss_com/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
  298.             for pattern in self.url_patterns:
File "/home/chaz/dev/envs/payments_bss_com/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in url_patterns
  328.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/chaz/dev/envs/payments_bss_com/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in 
urlconf_module
  323.             self._urlconf_module = import_module(self.urlconf_name)
File "/home/chaz/dev/envs/payments_bss_com/local/lib/python2.7/site-packages/django/utils/importlib.py" in import_module
  35.     __import__(name)

Exception Type: ImportError at /23
Exception Value: No module named Python

我的 URLConf

from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^(?P<payment_id>\w+)/$', 'main.views.process_payment'),
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', include(admin.site.urls),
)

urlpatterns += staticfiles_urlpatterns()
4

1 回答 1

2

我的 ROOT_URL 被意外更改为<app_name>.Python. 上面第一条评论中链接的问题有一个类似(但不同)的问题。

于 2013-01-11T21:32:41.903 回答