English 中文(简体)
我在申请Django时有错误。
原标题:I have an error when running my Django application

I m following a tutorial on deploying a machine learning model via django framework. Here s the link to the tutorial Link1 I followed all the steps correctly up to step 3. First, I wrote all the code myself. Seeing that my application wasn t working, I copied and pasted all the Django code from the site. Here s the link to my project on gitHub Link2

I m using python 3.6 and django==2.2.4

当我管理<代码>python时。 我在终端站收到这一错误信息:

(venv) C:UsersSEYDOU GOROmy_ml_service2ackendserver>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangourls
esolvers.py", line 604, in url_patterns
    iter(patterns)
TypeError:  module  object is not iterable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:UsersSEYDOU GOROAppDataLocalProgramsPythonPython36lib	hreading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:UsersSEYDOU GOROAppDataLocalProgramsPythonPython36lib	hreading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangoutilsautoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangocoremanagementcommands
unserver.py", line 118, in inner_run
    self.check(display_num_errors=True)
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangocoremanagementase.py", line 423, in check
    databases=databases,
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangocorechecks
egistry.py", line 76, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangocorechecksurls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangocorechecksurls.py", line 23, in check_resolver
    return check_method()
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangourls
esolvers.py", line 416, in check
    for pattern in self.url_patterns:
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangoutilsfunctional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:UsersSEYDOU GOROmy_ml_service2venvlibsite-packagesdjangourls
esolvers.py", line 611, in url_patterns
    raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e
django.core.exceptions.ImproperlyConfigured: The included URLconf  server.urls  does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.

我不知道什么进展,但我需要帮助了解什么进展。

问题回答

,Django 文件:URL mission有关于如何的例子,包括《URLconfs

from django.urls import include, path

urlpatterns = [
    # ... snip ...
    path( community/ , include( aggregator.urls )),
    path( contact/ , include( contact.urls )),
    # ... snip ...
]

页: 1 其中包括URLconf服务器。 斜体似乎没有任何形态。

urlpatterns = [
    path( admin/ , admin.site.urls),
]

见差异?





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签