Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't see the migrate list in Django

Tags:

python

django

I am working on my first Django Project and while learning about migrations I was to use this command to see the lists.

python3 manage.py migrate --list

But instead of giving me the list it gives an error

usage: manage.py migrate [-h] [--version] [-v {0,1,2,3}] [--settings SETTINGS]
                     [--pythonpath PYTHONPATH] [--traceback] [--no-color]
                     [--noinput] [--database DATABASE] [--fake]
                     [--fake-initial] [--run-syncdb]
                     [app_label] [migration_name]


manage.py migrate: error: unrecognized arguments: --list

But even after that, When I am trying to migrate usinng this commannd

python3 manage.py migrate

it gives no error.

The only issue arises when I am trying to use the list command.So any advice will be much helpful for me.Thanks.

P.S. I am using Python 3.5.2

like image 351
john400 Avatar asked Feb 02 '17 04:02

john400


People also ask

Where is the migration folder in Django?

admin app is used with your application: the migrations directory for this app is available at site-packages/django/contrib/admin/migrations , but migrations from apps that you created, are all stored inside each app folder.

How can I see unapplied migrations in Django?

You have unapplied migrations; your app may not work properly until they are applied. Run 'python manage.py migrate' to apply them. How can I find out which migrations are unapplied without running migrate? One way to do this is to look at the django_migrations table in the DB and check which ones are applied.


1 Answers

According to the Django documentation, you should use "showmigrations". It can be used with django-admin:

django-admin showmigrations

Or with manage.py

python manage.py showmigrations
like image 122
fgalvao Avatar answered Sep 28 '22 23:09

fgalvao