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

Facing issue in project #5

Open
RuntimeTerror007 opened this issue Feb 11, 2018 · 2 comments
Open

Facing issue in project #5

RuntimeTerror007 opened this issue Feb 11, 2018 · 2 comments

Comments

@RuntimeTerror007
Copy link

PS C:\Users\Dell\Django> python manage.py runserver
Unhandled exception in thread started by <function check_errors..wrapper at 0x000001BD1EFD91E0>
Traceback (most recent call last):
File "C:\Users\Dell\AppData\Local\Programs\Python\Python36\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\commands\runserver.py", line 113, in inner_run
autoreload.raise_last_exception()
File "C:\Users\Dell\AppData\Local\Programs\Python\Python36\lib\site-packages\django\utils\autoreload.py", line 248, in raise_last_exception
raise exception[1]
File "C:\Users\Dell\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management_init
.py", line 327, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\Dell\AppData\Local\Programs\Python\Python36\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python36\lib\site-packages\django_init_.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python36\lib\site-packages\django\apps\registry.py", line 112, in populate
app_config.import_models()
File "C:\Users\Dell\AppData\Local\Programs\Python\Python36\lib\site-packages\django\apps\config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python36\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 978, in _gcd_import
File "", line 961, in _find_and_load
File "", line 950, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 678, in exec_module
File "", line 205, in _call_with_frames_removed
File "C:\Users\Dell\Django\accounts\models.py", line 11, in
class UserProfile(models.Model):
File "C:\Users\Dell\Django\accounts\models.py", line 13, in UserProfile
user = models.OneToOneField(User)
TypeError: init() missing 1 required positional argument: 'on_delete'

@MitaliBhurani
Copy link

Same here !! I am also getting the same error. @maxg203 Can u please tell what to write in the required argument 'on_delete' ??

@maxg203
Copy link
Owner

maxg203 commented Feb 13, 2018

Try adding the parameter on_delete=models.CASCADE. That parameter has been made required in Django 2.0.

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

3 participants