Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python django:包含的URLconf';DB#u query.url';看起来里面没有任何图案_Python_Django - Fatal编程技术网

Python django:包含的URLconf';DB#u query.url';看起来里面没有任何图案

Python django:包含的URLconf';DB#u query.url';看起来里面没有任何图案,python,django,Python,Django,我是django的新手,在运行manage.py脚本时遇到问题。我的项目叫做DB_query。 这就是我要做的:我运行./manage.py makemigrations 这是我得到的错误: /home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site- packages/pkg_resources/__init__.py:1222: UserWarning: /home/ec2-user/.python-eggs is w

我是django的新手,在运行manage.py脚本时遇到问题。我的项目叫做DB_query。 这就是我要做的:我运行./manage.py makemigrations 这是我得到的错误:

 /home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-       packages/pkg_resources/__init__.py:1222: UserWarning: /home/ec2-user/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
  warnings.warn(msg, UserWarning)

/home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-packages/pkg_resources/__init__.py:1222: UserWarning: /home/ec2-user/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
  warnings.warn(msg, UserWarning)

Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x7f0d57fc4488>
Traceback (most recent call last):
  File "/home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 116, in inner_run
    self.check(display_num_errors=True)
  File "/home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-packages/django/core/management/base.py", line 426, in check
    include_deployment_checks=include_deployment_checks,
  File "/home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 75, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "/home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 23, in check_resolver
    for pattern in resolver.url_patterns:
  File "/home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/ec2-user/atlas_web/atlas_web/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 426, in url_patterns
    raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
django.core.exceptions.ImproperlyConfigured: The included URLconf 'DB_query.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.
我在url文件中写错了什么?
谢谢

这是主URL.py还是包含在应用程序中?如果是,请显示主URL。正如错误末尾所述,“如果在文件中看到有效的模式,则问题可能是由循环导入引起的。”因此,您需要检查视图导入Daniel,这是main url.py。罗德里格斯,我如何检查我的进口不是循环的?
    from django.contrib import auth, admin
from django.conf.urls import *
from views import *



urlpatterns = [
    # reference directly to the maintenace page.
    # un-comment this line to put the site in 'maintenance mode'.
    # (r'^', maintenance_page),
    url(r'^login/$', 'django.contrib.auth.views.login'),
    url(r'^log_out/$', logout_view),
    url(r'^accounts/login', 'django.contrib.auth.views.login'),
    url(r'^admin', include(admin.site.urls)),
    #url(r'^password_change/$', 'django.contrib.auth.views.password_change'),
    url(r'^password_change/$', password_change_view),
    #(r'^/accounts/password/reset/$', password_reset, {'template_name': '.html'}),

    url(r'^api/(.*?)$', atlas_api),
    url(r'^database_query/api/(.*?)$', atlas_api),
    url(r'^database_query', database_query),

    url(r'^', database_query),
]