djangopinaxdjango-2.0

How to Upgrade Pinax for Django 2.0


I am trying to upgrade my django project to Django 2.0, and I have read the release notes and read several blog posts about what to change, but nothing addresses my problem so far, which relates to the package pinax:

      File "/Users/marlo/miniconda3/envs/project/lib/python3.6/site-
        packages/pinax/eventlog/models.py", line 13, in 
        class Log(models.Model):
      File "/Users/marlo/miniconda3/envs/project/lib/python3.6/site-packages/pinax/eventlog/models.py", line 22, in Log
        content_type = models.ForeignKey(ContentType, null=True)
    TypeError: __init__() missing 1 required positional argument: 'on_delete'

Are there any fixes for this yet?


Solution

  • You'll want to update pinax-eventlog to latest to pick up Django 2.0 compatibility, which is currently 2.0.3.

    In your project's requirements.txt file add:

    pinax-eventlog==2.0.3

    So when you run pip install -r requirements.txt the right version will install. Otherwise, you can just run pip install pinax-eventlog==2.0.3.