可能这是个愚蠢的问题。我正在使用Django 1.7& Python 2.7。我通过运行python manage.py runserver / validate成功安装了django 0.1.5。但是,当我打开我的视图时我没有名为standard.forms 的模块错误。我也在使用virtualenvwrapper。有人能帮助我摆脱光明吗?
Environment:
Request Method: GET
Request URL: http://localhost:8000/manager/paypal_payment/
Django Version: 1.7.1
Python Version: 2.7.8
Installed Applications:
('profilesite','portal','manager','qrcode','account','paypal.standard.ipn','django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware','django.middleware.common.CommonMiddleware','django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'account.middleware.LocaleMiddleware',
'account.middleware.TimezoneMiddleware')
Traceback:
File "/Users/eeldwin/.virtualenvs/fbt/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
98. resolver_match = resolver.resolve(request.path_info)
File "/Users/eeldwin/.virtualenvs/fbt/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
345. sub_match = pattern.resolve(new_path)
File "/Users/eeldwin/.virtualenvs/fbt/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
345.sub_match = pattern.resolve(new_path)
File "/Users/eeldwin/.virtualenvs/fbt/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
224. return ResolverMatch(self.callback, args, kwargs, self.name)
File "/Users/eeldwin/.virtualenvs/fbt/lib/python2.7/site-packages/django/core/urlresolvers.py" in callback
231. self._callback = get_callable(self._callback_str)
File "/Users/eeldwin/.virtualenvs/fbt/lib/python2.7/site-packages/django/utils/lru_cache.py" in wrapper
101. result = user_function(*args, **kwds)
File "/Users/eeldwin/.virtualenvs/fbt/lib/python2.7/site-packages/django/core/urlresolvers.py" in get_callable
97. mod = import_module(mod_name)
File "/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py" in import_module
37. __import__(name)
File "/Users/eeldwin/Documents/Django/fbt/manager/views/pp_ipn.py" in <module>
1. from paypal.standard.forms import PayPalPaymentsForm
Exception Type: ImportError at /manager/paypal_payment/
Exception Value: No module named standard.forms
答案 0 :(得分:2)
确保您的应用中没有paypal.py文件。如果是这种情况,您也需要删除paypal.pyc。