question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can not use with django 2

See original GitHub issue

I have installed version 1.3 in Django 2.0

But it is giving error as

class Notification(models.Model):
  File "/Users/anuj/.local/share/virtualenvs/src-UhWPeMJs/lib/python3.6/site-packages/notifications/models.py", line 170, in Notification
    recipient = models.ForeignKey(settings.AUTH_USER_MODEL, blank=False, related_name='notifications')
TypeError: __init__() missing 1 required positional argument: 'on_delete'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
udoscommented, Apr 16, 2018

from https://docs.djangoproject.com/en/2.0/releases/2.0/#features-removed-in-2-0:

The on_delete argument for ForeignKey and OneToOneField is now required in models and migrations.

this should affect everyone who uses or upgrades to Django 2.x… note: relates to #193/#212 (I’m also waiting for a fix to give it a try…)

1reaction
thunderwincommented, Apr 15, 2018

I have the same issue, says

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

I cannot use Django - python - Stack Overflow
I want to use Django. I installed it but after that I wanted to create file and I got this error. django-admin.exe startproject...
Read more >
Django 2.0 release notes
Django 2.0 supports Python 3.4, 3.5, 3.6, and 3.7. We highly recommend and only officially support the latest release of each series. The...
Read more >
Top 10 Mistakes That Django Developers Make - Toptal
Mistake No. 1: Using the Global System Python Environment for Project Dependencies. Don't use Python's global environment for project dependencies, since it can...
Read more >
Django Tutorial Part 2: Creating a skeleton website
This article shows how you can create a "skeleton" website, which you can then populate with site-specific settings, paths, models, views, ...
Read more >
Deploying a Django application to Elastic Beanstalk
This tutorial walks through the deployment of a default, autogenerated Django website to an AWS Elastic Beanstalk environment running Python.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found