简体   繁体   中英

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM