Django : Getting error while removing django.contrib.sites from INSTALLED_APPS

I want to remove django.contrib.sites from my django project.

When I try to remove I am getting following error while starting the server:

  • Django can't connect to Postgres in Docker setup
  • docker-compose error on the Django's welcome page
  • Docker-compose connection refused from celery
  • Application served by uWSGI with Supervisord from Docker
  • Use Docker, Gunicorn, Nginx in django development environment but can only see nginx welcome page?
  • How to use/link remote postgres db with django docker implementation
  • /usr/local/lib/python3.5/site-packages/django/db/models/fields/ RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
    web_1 |   RemovedInDjango110Warning)
    web_1 | 
    web_1 | /usr/local/lib/python3.5/site-packages/django/db/models/fields/ RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
    web_1 |   RemovedInDjango110Warning)
    web_1 | 
    web_1 | Performing system checks...
    web_1 | 
    web_1 | System check identified no issues (0 silenced).
    web_1 | Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f154e979048>
    web_1 | Traceback (most recent call last):
    web_1 |   File "/usr/local/lib/python3.5/site-packages/django/utils/", line 226, in wrapper
    web_1 |     fn(*args, **kwargs)
    web_1 |   File "/usr/local/lib/python3.5/site-packages/django/core/management/commands/", line 117, in inner_run
    web_1 |     self.check_migrations()
    web_1 |   File "/usr/local/lib/python3.5/site-packages/django/core/management/commands/", line 163, in check_migrations
    web_1 |     executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
    web_1 |   File "/usr/local/lib/python3.5/site-packages/django/db/migrations/", line 20, in __init__
    web_1 |     self.loader = MigrationLoader(self.connection)
    web_1 |   File "/usr/local/lib/python3.5/site-packages/django/db/migrations/", line 49, in __init__
    web_1 |     self.build_graph()
    web_1 |   File "/usr/local/lib/python3.5/site-packages/django/db/migrations/", line 306, in build_graph
    web_1 |     _reraise_missing_dependency(migration, parent, e)
    web_1 |   File "/usr/local/lib/python3.5/site-packages/django/db/migrations/", line 276, in _reraise_missing_dependency
    web_1 |     raise exc
    web_1 |   File "/usr/local/lib/python3.5/site-packages/django/db/migrations/", line 302, in build_graph
    web_1 |     self.graph.add_dependency(migration, key, parent)
    web_1 |   File "/usr/local/lib/python3.5/site-packages/django/db/migrations/", line 126, in add_dependency
    web_1 |     parent
    web_1 | django.db.migrations.exceptions.NodeNotFoundError: Migration services.0001_initial dependencies reference nonexistent parent node ('sites', '0002_alter_domain_unique')

    Only the modification I have done in my project is, in I added following informations:

    SITE_ID = 1

    After following commands where executed to see the outcome in admin page:

    python makemigrations
    python migrate

    Now when I remove the configurations from setting and run makemigrations and migrate command, am getting the above described error.

    I am using python:3.5 and Django:1.9 to with docker.

  • running django worker and daphne in docker container
  • Deleting folders in docker conatiner using python
  • Why does docker-compose build not reflect my django code changes?
  • How do I get AWS credentials in the AWS ECS docker container?
  • What is the purpose of running a django application in a virtualenv inside a docker container?
  • How to make redis BROKER_URL dynamic on deployment to AWS instance
  • One Solution collect form web for “Django : Getting error while removing django.contrib.sites from INSTALLED_APPS”

    Seems to be resolved by myself. Following things I have done to resolve it:

    1. Remove following from

      SITE_ID = 1

    and ‘django.contrib.sites' from the INSTALLED_APPS block

    1. Removed auto-generated files from migrations folder inside the apps (App in which I have imported django.contrib.sites Models).

    2. Re-run the makemigrations and migrate command.

    3. Everything is working fine.


    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.