ImportError: cannot import name 'RequestSite'


#1

I get this error when I run
heroku run python manage.py migrate
and when I run
heroku open ,
I get Application error page.
Heroku logs returns the same error.
My admin.py:

from django.contrib import admin
from django.contrib.sites.models import Site
from django.contrib.sites.requests import RequestSite

My requests.py

class RequestSite(object):

The save() and delete() methods raise NotImplementedError.

def __init__(self, request):
    self.domain = self.name = request.get_host()

def __str__(self):
    return self.domain

def save(self, force_insert=False, force_update=False):
    raise NotImplementedError('RequestSite cannot be saved.')

def delete(self):
    raise NotImplementedError('RequestSite cannot be deleted.')


I’m using Django 1.9.4, registration-redux 1.2

by default Django 1.9.4 tries to load RequestSite from django.contrib.sites.models import RequestSite but it actually exists in django.contrib.sites.requests import RequestSite. How to make Heroku load it from there?


#2

Fixed it by changing django-registration-redux==1.2 to django-registration-redux==1.3 in requirements.txt


#3

Yay! Thanks for the update.