我是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.
这是我在urls.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),
]
我在url文件中写错了什么? 谢谢