How to configure Django to access remote MySQL db django.contrib.sites.RequestSite module missing
Question: I'm trying to set up a django app that connects to a remote MySQL db. I
currently have Django==1.10 and MySQL-python==1.2.5 installed in my venv. In
settings.py I have added the following to the DATABASES variable:

    
    
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'db_name',
        'USER': 'db_user',
        'PASSWORD': 'db_password',
        'HOST': 'db_host',
        'PORT': 'db_port',
    }
    

I get the error

    
    
    from django.contrib.sites.models import RequestSite
    

when I run python manage.py migrate

I am a complete beginner when it comes to django. Is there some step I am
missing?

edit: I have also installed mysql-connector-c via brew install edit2: realized
I just need to connect to a db by importing MySQLdb into a file. sorry for the
misunderstanding.


Answer: The error you're seeing has nothing to do with your database settings
(assuming your real code has the actual database name, username, and password)
or connection. You are not importing the RequestSite from the correct spot.

Change (wherever you have this set) from:

    
    
    from django.contrib.sites.models import RequestSite
    

to:

    
    
    from django.contrib.sites.requests import RequestSite
    

