Installing django also creates migrations

170 Views Asked by At

To make a long story short: when I install django it comes with migrations that I deleted in the past.

Here is what I do:

$ mkvirtualenv foo
$ (foo) pip install django
Collecting django
  Using cached Django-1.11.5-py2.py3-none-any.whl
Collecting pytz (from django)
  Using cached pytz-2017.2-py2.py3-none-any.whl
Installing collected packages: pytz, django
Successfully installed django-1.11.5 pytz-2017.2

Now when I look in the directory where the venv is created I can see migrations in the default django apps (admin, user, ect.) I also see migrations in a brand new project.

This problems started after I tried to reset my migrations. I deleted the migrations from each app and dropped all the tables. Then I removed the migrations in the venv, while doing this I accidentally removed a django app. The missing app forced me to uninstall and install django.

Even when I tell pip not to use the cache --no-cache-dir, I still get the migrations.

1

There are 1 best solutions below

0
On BEST ANSWER

This is by design. The default apps that come with Django need the tables created by those migrations.

If you don't need those apps, remove them from INSTALLED_APPS in settings.py.