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' #30

Open
Keramatfar opened this issue Dec 19, 2018 · 14 comments

Comments

@Keramatfar
Copy link

  • django-private-chat version:
  • Django version: 2.4
  • Python version: 3.6
  • Operating System: windows 7

Description

When i run:
python manage.py migrate django-private-chat

got this error:

TypeError: init() missing 1 required positional argument: 'on_delete'

@delneg
Copy link
Collaborator

delneg commented Dec 19, 2018

Probably using outdated version
All the current models have on_delete=models.CASCADE
image

@Keramatfar
Copy link
Author

Keramatfar commented Dec 20, 2018 via email

@delneg
Copy link
Collaborator

delneg commented Dec 20, 2018

Please, do a pip freeze and paste the output here.
Looking for Django & django-private-chat versions

@Keramatfar
Copy link
Author

Keramatfar commented Dec 22, 2018 via email

@Keramatfar
Copy link
Author

Keramatfar commented Dec 25, 2018 via email

@delneg
Copy link
Collaborator

delneg commented Dec 25, 2018

Hi, sorry, i didn't see django-private-chat in your pip freeze.
Are you sure you installed it in your venv and/or not in global python packages? Or maybe some other environment

@Keramatfar
Copy link
Author

Keramatfar commented Dec 26, 2018 via email

@delneg
Copy link
Collaborator

delneg commented Dec 26, 2018

Well, it looks like you're using the new version
It shouldn't be an issue then, could you paste the full stack trace here?

@Keramatfar
Copy link
Author

Keramatfar commented Dec 29, 2018 via email

@delneg
Copy link
Collaborator

delneg commented Dec 29, 2018

base template in an html that you {% extend %} in other templates.
It is usually named 'base.html' and has things like tags, footer/header and or some site-wide js/css files.

@Keramatfar
Copy link
Author

Keramatfar commented Dec 30, 2018 via email

@1160545
Copy link

1160545 commented Jun 1, 2020

i am getting the same error please help me

@lakshmishettappakantha
Copy link

Well, it looks like you're using the new version
It shouldn't be an issue then, could you paste the full stack trace here?

Hi Delneg,
I am getting the same error can you please guide me on this
TypeError: init() missing 1 required positional argument: 'on_delete'

@Gangadharbhuvan
Copy link

on_delete=models.DO_NOTHING

add this, hope it will clear the issue.

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

5 participants