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

TypeError: __init__() missing 1 required positional argument: 'on_delete' #10

Open
shaikfaizal opened this issue Jan 30, 2021 · 1 comment

Comments

@shaikfaizal
Copy link

python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 21, in
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/core/management/init.py", line 377, in execute
django.setup()
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in call_with_frames_removed
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/djadmin/models.py", line 19, in
class Visitor(models.Model):
File "/Users/shaikaf/PycharmProjects/demonaren/venvnew/lib/python3.8/site-packages/djadmin/models.py", line 23, in Visitor
name = models.ForeignKey(AUTH_USER_MODEL, verbose_name=
('User'), null=True)
TypeError: init() missing 1 required positional argument: 'on_delete'

@nileshahir1
Copy link

nileshahir1 commented Apr 28, 2022

File "F:\project2\api\models.py", line 14, in
class Student(models.Model):
File "F:\project2\api\models.py", line 17, in Student
university=models.ForeignKey(University)
TypeError: init() missing 1 required positional argument: 'on_delete'

pleaase solve this problem

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