debug的时候到is_valid()就出错了
来源:6-10 用户注册-4
慕设计4101219
2017-04-14
里面的valid=unknow
=====================================
就是F6到了register_form = RegisterForm(request.POST)
然后F6到了if register_form.is_valid():
在按F6不是到user_name = request.POST.get("email"," ")而是到了base.py里面的return handler(request,*args,**kwargs)
求指教
2回答
-
慕设计4101219
提问者
2017-04-17
因为后面没做下去,目前的代码是
class RegisterView(View):
。。。
def post(self,request):
register_form = RegisterForm(request.POST)
if register_form.is_valid():
user_name = request.POST.get("email"," ")
。。。
pass
按F8之后的错误是
ValueError at /register/
The view users.views.RegisterView didn't return an HttpResponse object. It returned None instead.
Request Method: POST
Request URL: http://127.0.0.1:8000/register/
Django Version: 1.9.8
Exception Type: ValueError
Exception Value:
The view users.views.RegisterView didn't return an HttpResponse object. It returned None instead.
Exception Location: D:\ruanjian\Anaconda2\lib\site-packages\django\core\handlers\base.py in get_response, line 158
Python Executable: D:\ruanjian\Anaconda2\python.exe
Python Version: 2.7.13
Python Path:
['D:\\ruanjian\\PycharmDjangos\\MxOnline\\extra_apps',
'D:\\ruanjian\\PycharmDjangos\\MxOnline\\apps',
'D:/ruanjian/PycharmDjangos/MxOnline',
'D:\\ruanjian\\pycharm\\PyCharm 2016.3.2\\helpers\\pydev',
'D:\\ruanjian\\PycharmDjangos\\MxOnline',
'D:\\ruanjian\\PycharmDjangos\\MxOnline\\extra_apps',
'D:\\ruanjian\\PycharmDjangos\\GaoJimuke',
'D:\\ruanjian\\PycharmDjangos\\MuDjango',
'D:\\ruanjian\\PycharmDjangos\\MxOnline\\apps',
'D:\\ruanjian\\Anaconda2\\Lib\\site-packages\\theano',
'D:\\ruanjian\\pycharm\\PyCharm 2016.3.2\\helpers\\pydev',
'D:\\ruanjian\\Anaconda2\\python27.zip',
'D:\\ruanjian\\Anaconda2\\DLLs',
'D:\\ruanjian\\Anaconda2\\lib',
'D:\\ruanjian\\Anaconda2\\lib\\plat-win',
'D:\\ruanjian\\Anaconda2\\lib\\lib-tk',
'D:\\ruanjian\\Anaconda2',
'D:\\ruanjian\\Anaconda2\\lib\\site-packages',
'D:\\ruanjian\\Anaconda2\\lib\\site-packages\\Sphinx-1.5.1-py2.7.egg',
'D:\\ruanjian\\Anaconda2\\lib\\site-packages\\win32',
'D:\\ruanjian\\Anaconda2\\lib\\site-packages\\win32\\lib',
'D:\\ruanjian\\Anaconda2\\lib\\site-packages\\Pythonwin',
'D:\\ruanjian\\Anaconda2\\lib\\site-packages\\setuptools-27.2.0-py2.7.egg',
'D:\\ruanjian\\Anaconda2\\lib\\site-packages\\IPython\\extensions']Server time:
星期一, 17 四月 2017 09:47:39 +0800
bobby老师,是不是不用管它继续做下去还是?
112019-02-28 -
我就是人才
2017-04-14
说清楚
052017-04-17
相似问题