Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'module' object has no attribute 'GetComment' #25

Open
aurora5161 opened this issue Apr 10, 2019 · 1 comment
Open

AttributeError: 'module' object has no attribute 'GetComment' #25

aurora5161 opened this issue Apr 10, 2019 · 1 comment

Comments

@aurora5161
Copy link

请教大神,执行python manage.py makemigrations blog,出现下列错误是什么情况?
File "/root/blog/django-blog/django_blog/urls.py", line 22, in
url(r'^blog/', include('blog.urls', namespace='blog')),
File "/root/blog/venv/lib/python2.7/site-packages/django/conf/urls/init.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib64/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/root/blog/django-blog/blog/urls.py", line 25, in
url(r'^getComment/$', views.GetComment, name='get_comment'),
AttributeError: 'module' object has no attribute 'GetComment'

@jhao104
Copy link
Owner

jhao104 commented Jul 10, 2019

urls.py里面应该是小写

url(r'^getComment/$', views.GetComment, name='get_comment'),

对应views.py里面也是小写

def getComment(request):

把你的GetComment 改下,两边一致

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants