Hi Lucian,
First, deleting all migrations is not something you should do, except
in one specific case, and that is when you are moving from South
migrations to native django.core.migrations. In any other case, your
migrations are a part of your code base, and you should treat them as
such. In some situations you might want to squash incremental
migrations into bigger ones as an optimization, but simply removing
all existing migrations is not the right way to do that.
If you are starting with a new database, you can just apply all
existing migrations without removing them and running makemigrations,
that's the purpose of having migrations in the first place.
Second, regarding that error you are getting, that looks very much
like your application is trying to make database queries during
import, which is not possible, because Django needs to import your
application before it can create and apply migrations that will
actually create those tables.
The traceback you get should reveal where you are trying to access the
database on import, you'll have to fix that code.
Good luck,
Michal