Comments (4)
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
def get_form(self, form_class=None): if form_class is None: form_class = self.get_form_class()
from django_quiz.
Hey,
I got the same problem while migrating to Django 1.11.13. Setting the default to None results in a TypeError 'NoneType' object is not callable.
This is the Traceback:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/q/first/take/
Django Version: 1.11.13
Python Version: 2.7.12
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'quiz',
'multichoice',
'true_false',
'essay')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\exception.py" in inner
41. response = get_response(request)
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in _legacy_get_response
249. response = self._get_response(request)
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Python27\lib\site-packages\django\views\generic\base.py" in view
68. return self.dispatch(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg\quiz\views.py" in dispatch
155. return super(QuizTake, self).dispatch(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\views\generic\base.py" in dispatch
88. return handler(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\views\generic\edit.py" in get
174. return self.render_to_response(self.get_context_data())
File "C:\Python27\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg\quiz\views.py" in get_context_data
190. context = super(QuizTake, self).get_context_data(**kwargs)
File "C:\Python27\lib\site-packages\django\views\generic\edit.py" in get_context_data
93. kwargs['form'] = self.get_form()
File "C:\Python27\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg\quiz\views.py" in get_form
168. return form_class(**self.get_form_kwargs())
Exception Type: TypeError at /q/first/take/
Exception Value: 'NoneType' object is not callable
I tried fixing it by adding these lines in the view:
if form_class is None:
form_class = QuestionForm
which results in an AttributeError claiming:
'Question' object has no attribute 'get_answers_list'
Any advice is much appreciated. Thank you.
from django_quiz.
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
def get_form(self, form_class=None): if form_class is None: form_class = self.get_form_class()
which function exactly? I am having the same challenge
from django_quiz.
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'
Did you get any solution to this? I have the same problem
from django_quiz.
Related Issues (20)
- user friendly url
- User should not able to click submit without choosing option
- Figures not rendered in question display
- OperationalError (no such table: quiz_quiz) while trying to start application HOT 1
- ValueError invalid literal for int() with base 10: '2,' HOT 1
- Restricting access to certain questions/categories
- Saved image im question does not work HOT 1
- Question navigation feature?
- ..
- AttributeError: 'Options' object has no attribute 'get_all_related_objects'
- Project running HOT 2
- string in template without translation HOT 2
- fr-FR locale HOT 1
- Project Documentation HOT 19
- Update integration tests to support Django 3 and drop Django 1 and Python 2.7 HOT 1
- randomization under categories
- multiple choice is not multiple
- Old UI of the admin panel
- Cannot modify the templates
- Steps to setup HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django_quiz.