1
このエラーメッセージが表示されます。アプリを認識できないようです。この問題を解決する方法はありませんか?Python Djangoのモジュール「app」がeclipseのurls.pyにあります
エラーメッセージ。
pydev debugger: starting (pid: 5628)
pydev debugger: starting (pid: 3504)
Performing system checks...
Unhandled exception in thread started by <_pydev_bundle.pydev_monkey._NewThreadStartupWithTrace instance at 0x0478C210>
Traceback (most recent call last):
File "C:\Users\jeon hyun joo\.p2\pool\plugins\org.python.pydev_5.5.0.201701191708\pysrc\_pydev_bundle\pydev_monkey.py", line 574, in __call__
return self.original_func(*self.args, **self.kwargs)
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\utils\autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\core\management\commands\runserver.py", line 121, in inner_run
self.check(display_num_errors=True)
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\core\management\base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\core\management\base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\core\checks\registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\core\checks\urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\core\checks\urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\urls\resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\urls\resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\Users\jeon hyun joo\workspace\blog\blog\blog\urls.py", line 19, in <module>
from blog.polls import views
ImportError: No module named polls
urls.pyに問題があるようですが、この問題を引き起こす部分は見つかりません。
urls.py
from django.conf.urls import url
from django.contrib import admin
from blog.polls import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^polls/(?P<question_id>\d+)$', views.detail, name='detail'),
url(r'^polls/(?P<question_id>\d+)/vote/$', views.vote, name='vote'),
url(r'^polls/(?P<question_id>\d+)/results/$', views.results, name='results'),]
私はプロジェクト構造を追加しました。
blog
└── blog
├── blog
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
│
├── polls
│ ├── migrations
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── detail.html
│ ├── index.html
│ ├── models.py
│ ├── results.html
│ ├── tests.py
│ └── views.py
└── manage.py
viewはblog.pollsに存在しますが、ファイルをチェックしましたか? – postoronnim
フォルダ/ファイル構造を指定できますか? @KlausD。 –
こんにちは、ファイル構造を追加しました。 – camila