Hello,
I’m new and I’m throwing myself into programming with Python and Django.
Looking at the site I noticed the presence of the tutorial and in trying to do it I fell into a problem that I cannot understand.
In the survey tutorial when installing survey application in the setting.py file and then run the command: python manage.py survey makemigrations I get this:
PS C:\Users\fabio\Documents\Python\Djangoprj\mysite> python manage.py makemigrations
Traceback (most recent call last):
File “C:\Users\fabio\Documents\Python\Djangoprj\mysite\manage.py”, line 22, in
main()
File “C:\Users\fabio\Documents\Python\Djangoprj\mysite\manage.py”, line 18, in main
execute_from_command_line(sys.argv)
File “C:\Users\fabio\Documents\Python\Djangoprj\sito\lib\site-packages\django\core\management_init_.py”, line 419, in execute_from_command_line
utility.execute()
File “C:\Users\fabio\Documents\Python\Djangoprj\sito\lib\site-packages\django\core\management_init_.py”, line 395, in execute
django.setup()
File “C:\Users\fabio\Documents\Python\Djangoprj\sito\lib\site-packages\django_init_.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “C:\Users\fabio\Documents\Python\Djangoprj\sito\lib\site-packages\django\apps\registry.py”, line 114, in populate
app_config.import_models()
File “C:\Users\fabio\Documents\Python\Djangoprj\sito\lib\site-packages\django\apps\config.py”, line 301, in import_models
self.models_module = import_module(models_module_name)
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\importlib_init_.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1030, in _gcd_import
File “”, line 1007, in _find_and_load
File “”, line 986, in _find_and_load_unlocked
File “”, line 680, in _load_unlocked
File “”, line 790, in exec_module
File “”, line 228, in call_with_frames_removed
File “C:\Users\fabio\Documents\Python\Djangoprj\mysite\polls\models.py”, line 3, in
class Question(models.Model):
File “C:\Users\fabio\Documents\Python\Djangoprj\mysite\polls\models.py”, line 4, in Question
question_text = models.CharField(max_lenght = 100)
File "C:\Users\fabio\Documents\Python\Djangoprj\sito\lib\site-packages\django\db\models\fields_init.py", line 1005, in init
super().init(*args, **kwargs)
TypeError: init() got an unexpected keyword argument ‘max_lenght’
I noticed that commenting the line of the new application, the problem disappears but I can not understand where I am wrong.
I hope you can help me and be able to better understand my mistake.
Thanks so much!!!