title: Django + heroku - import error on line that doesn't exist
body: <p>I'm new to django (using python 2.7) and I was just trying to use heroku for the first time but I always get the following error:</p>
  
  <pre><code>remote: -----&gt; Preparing static assets
  remote:        Collectstatic configuration error. To debug, run:
  remote:        $ heroku run python manage.py collectstatic --noinput
  </code></pre>
  
  <p>When I run that command, an import error regarding the django registration redux library shows up. I've had this problem before in Django and I fixed it by placing RequestSite under 'requests' and Site under 'models'. That solved the problem but the error still shows up in Heroku.</p>
  
  <pre><code>(venv) C:\Users\Carolina\Desktop\Coding\venv\project1&gt;heroku run python manage.p
      y collectstatic --noinput
      Running python manage.py collectstatic --noinput on acla-acla... up, run.3645
      Traceback (most recent call last):
        File "manage.py", line 10, in &lt;module&gt;
          execute_from_command_line(sys.argv)
        File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/_
      _init__.py", line 350, in execute_from_command_line
          utility.execute()
        File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/_
      _init__.py", line 324, in execute
          django.setup()
        File "/app/.heroku/python/lib/python2.7/site-packages/django/__init__.py", lin
      e 18, in setup
          apps.populate(settings.INSTALLED_APPS)
        File "/app/.heroku/python/lib/python2.7/site-packages/django/apps/registry.py"
      , line 115, in populate
          app_config.ready()
        File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/app
      s.py", line 22, in ready
          self.module.autodiscover()
        File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/__i
      nit__.py", line 26, in autodiscover
          autodiscover_modules('admin', register_to=site)
        File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/module_load
      ing.py", line 50, in autodiscover_modules
          import_module('%s.%s' % (app_config.name, module_to_search))
        File "/app/.heroku/python/lib/python2.7/importlib/__init__.py", line 37, in im
      port_module
          __import__(name)
        File "/app/.heroku/python/lib/python2.7/site-packages/registration/admin.py",
      line 2, in &lt;module&gt;
          from django.contrib.sites.models import RequestSite
      ImportError: cannot import name RequestSite
  </code></pre>
  
  <p>The thing is - that line doesn't exist. I went to venv/lib/site-packages/registration/admin.py and line 2 is this one: </p>
  
  <pre><code>from django.contrib import admin
  from django.contrib.sites.requests import RequestSite    # HERE
  from django.contrib.sites.models import Site
  from django.utils.translation import ugettext_lazy as _
  
  from registration.models import RegistrationProfile
  from registration.users import UsernameField
  
  
  class RegistrationAdmin(admin.ModelAdmin):
      actions = ['activate_users', 'resend_activation_email']
      list_display = ('user', 'activation_key_expired')
      raw_id_fields = ['user']
      search_fields = ('user__{0}'.format(UsernameField()), 'user__first_name', 'user__last_name')
  
      def activate_users(self, request, queryset):
          """
          Activates the selected users, if they are not already
          activated.
  
          """
          for profile in queryset:
              RegistrationProfile.objects.activate_user(profile.activation_key)
      activate_users.short_description = _("Activate users")
  
      def resend_activation_email(self, request, queryset):
          """
          Re-sends activation emails for the selected users.
  
          Note that this will *only* send activation emails for users
          who are eligible to activate; emails will not be sent to users
          whose activation keys have expired or who have already
          activated.
  
          """
          if Site._meta.installed:
              site = Site.objects.get_current()
          else:
              site = RequestSite(request)
  
          for profile in queryset:
              if not profile.activation_key_expired():
                  profile.send_activation_email(site)
      resend_activation_email.short_description = _("Re-send activation emails")
  
  
  admin.site.register(RegistrationProfile, RegistrationAdmin)
  </code></pre>
  
  <p>This is what I get with pip freeze, just in case:</p>
  
  <pre><code>Django==1.9
  django-crispy-forms==1.5.2
  django-registration==2.0.3
  django-registration-redux==1.2
  django-tinymce==2.2.0
  Pillow==3.0.0
  requests==2.9.0
  South==1.0.2
  stripe==1.27.1
  wheel==0.24.0
  </code></pre>
  
  <p>Anyone knows why this is happening? Thanks in advance!</p>
  
  <p><strong>EDIT ----</strong></p>
  
  <p>Ok, so the problem was the one mentioned by Daniel Roseman. The library is broken in pypi and I had to tell heroku to install it from github (where the package is fixed). 
  So, I went to my requirements.txt file and replaced this line:</p>
  
  <pre><code>django-registration-redux==1.2
  </code></pre>
  
  <p>with this one:</p>
  
  <pre><code>-e git://github.com/macropin/django-registration.git#egg=django-registration==1.2 
  </code></pre>
  
  <p>(I also removed 'django-registration==2.0.3' because it is an old version of django-registration-redux and was creating problems).
  Hope this helps people with the same issue!</p>