Hi,
I'm following along the tutorial and I'm stuck. When I enter the command python3 manage.py makemigrations
, I get the following output:
Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line utility.execute() File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/management/__init__.py", line 365, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **cmd_options) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/management/base.py", line 332, in execute self.check() File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/management/base.py", line 364, in check include_deployment_checks=include_deployment_checks, File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/management/base.py", line 351, in _run_checks return checks.run_checks(**kwargs) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/checks/registry.py", line 73, in run_checks new_errors = check(app_configs=app_configs) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces url_patterns = getattr(resolver, 'url_patterns', []) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/utils/functional.py", line 36, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/urls/resolvers.py", line 536, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/utils/functional.py", line 36, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/urls/resolvers.py", line 529, in urlconf_module return import_module(self.urlconf_name) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 673, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 665, in exec_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed File "/home/stephen/Documents/locallibrary/locallibrary/locallibrary/urls.py", line 27, in <module> path('catalog/', include('catalog.urls')), File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/urls/conf.py", line 34, in include urlconf_module = import_module(urlconf_module) File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked ImportError: No module named 'catalog.urls'
When I enter the command python3 manage.py runserver
, I get the following:
`
Performing system checks...
Unhandled exception in thread started by <function check_errors..wrapper at 0x7fbea1d9c730>
Traceback (most recent call last):
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
self.check(display_num_errors=True)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/management/base.py", line 364, in check
include_deployment_checks=include_deployment_checks,
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/management/base.py", line 351, in _run_checks
return checks.run_checks(**kwargs)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/checks/registry.py", line 73, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/urls/resolvers.py", line 397, in check
for pattern in self.url_patterns:
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/utils/functional.py", line 36, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/urls/resolvers.py", line 536, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/utils/functional.py", line 36, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/urls/resolvers.py", line 529, in urlconf_module
return import_module(self.urlconf_name)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "/home/stephen/Documents/locallibrary/locallibrary/locallibrary/urls.py", line 27, in
path('catalog/', include('catalog.urls')),
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/home/stephen/.virtualenvs/my_django_environment/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 956, in _find_and_load_unlocked
ImportError: No module named 'catalog.urls'
`
It seems that there needs to be a catalog.urls file that should've been included when the files for the catalog app was generated (with the python3 manage.py startapp catalog
command), but it isn't, and even the tutorial acknowledges that it wasn't and says that we'd be getting back to that issue later. When I try to start the app, it's not starting because it looks like the app server relies on that file being there. What am I missing?