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.

Django 1.8: ImportError: No module named related

See original GitHub issue
  File "/Users/thekgf/CentriFile/allay/venv/lib/python2.7/site-packages/simple_history/models.py", line 13, in <module>
    from django.db.models.related import RelatedObject
ImportError: No module named related

Django 1.8 has made some changes here and removed the RelatedObject API. More details are here: https://docs.djangoproject.com/en/dev/releases/1.8/#model-attribute-on-private-model-relations

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
phoebebrightcommented, Apr 8, 2015

FYI - I fixed another app for this with these steps: In the imports section

replace:

        from django.db.models.related import RelatedObject

with:

        try:
           from django.db.models.related import RelatedObject as ForeignObjectRel
        except:
          # django 1.8 +
          from django.db.models.fields.related import ForeignObjectRel

And then replace all RelatedObject with ForeignObjectRel

0reactions
mhulsecommented, Apr 11, 2015

+1, looking forward to an update. Thanks for the awesome module. 👍 :octocat:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Related models issue in django 1.8 - Stack Overflow
I think this has something to do with changes on version 1.8 since this module is quite old, but I do not know...
Read more >
Django error - "ImportError: No module named urls"
I'm performing a new install of 0.10.0 on a new Ubuntu 20.04 server. I'm following the instructions listed here and when I get...
Read more >
Python - no module named django.conf.urls.defaults - iTecNote
I am trying to run statsd/graphite which uses django 1.6. While accessing graphite URL, I get django module error. File "/opt/graphite/webapp/graphite/urls.py ...
Read more >
Throwing ImportError: No module named 'MySQLdb'-django
Coding example for the question Django 1.8 : Throwing ImportError: No module named 'MySQLdb'-django.
Read more >
No module named URLs - DigitalOcean
Traceback: Environment: Request Method: GET Request URL: http://67.205.177.49/ Django Version: 1.8.7 Python Version: 2.7.12 Installed ...
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