-
Notifications
You must be signed in to change notification settings - Fork 354
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
get_form() missing 1 required positional argument: 'form_class' #71
Comments
Django 1.10 seems to have introduced a change that is causing the error. The get_form inside the view needs to change as below |
Hey, This is the Traceback: Environment: Request Method: GET Django Version: 1.11.13 Traceback: File "C:\Python27\lib\site-packages\django\core\handlers\exception.py" in inner File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in _legacy_get_response File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in _get_response File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in _get_response File "C:\Python27\lib\site-packages\django\views\generic\base.py" in view File "C:\Python27\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg\quiz\views.py" in dispatch File "C:\Python27\lib\site-packages\django\views\generic\base.py" in dispatch File "C:\Python27\lib\site-packages\django\views\generic\edit.py" in get File "C:\Python27\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg\quiz\views.py" in get_context_data File "C:\Python27\lib\site-packages\django\views\generic\edit.py" in get_context_data File "C:\Python27\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg\quiz\views.py" in get_form Exception Type: TypeError at /q/first/take/ I tried fixing it by adding these lines in the view:
which results in an AttributeError claiming: Any advice is much appreciated. Thank you. |
which function exactly? I am having the same challenge |
Did you get any solution to this? I have the same problem |
I cannot find out why I've got this error. Any idea?
Traceback:
File "C:\Python35\lib\site-packages\django\core\handlers\exception.py" in inner
41. response = get_response(request)
File "C:\Python35\lib\site-packages\django\core\handlers\base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "C:\Python35\lib\site-packages\django\core\handlers\base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Python35\lib\site-packages\django\views\generic\base.py" in view
68. return self.dispatch(request, *args, **kwargs)
File "C:\mysite\quiz\views.py" in dispatch
155. return super(QuizTake, self).dispatch(request, *args, **kwargs)
File "C:\Python35\lib\site-packages\django\views\generic\base.py" in dispatch
88. return handler(request, *args, **kwargs)
File "C:\Python35\lib\site-packages\django\views\generic\edit.py" in get
174. return self.render_to_response(self.get_context_data())
File "C:\mysite\quiz\views.py" in get_context_data
191. context = super(QuizTake, self).get_context_data(**kwargs)
File "C:\Python35\lib\site-packages\django\views\generic\edit.py" in get_context_data
93. kwargs['form'] = self.get_form()
Exception Type: TypeError at /hell/take/
Exception Value: get_form() missing 1 required positional argument: 'form_class'
The text was updated successfully, but these errors were encountered: