How do I uninstall dj-stripe from my project?

Viewed 460

I ran pip uninstall dj-stripe and removed it from INSTALLED_APPS and removed the other settings.py entries. Everything is working, but the DB still has a lot of dj-stripe tables. Is there a quick way to remove these? I ran migrate to create them, but they are not in my models.py file. They were made with something from the dj-stripe installation. Thank you.

1 Answers

First, reinstall dj-stripe into your environment, and add it back to your INSTALLED_APPS.

A nifty feature of migrations is you can specify which migrations to run, including rollbacks. For example, if you have an app named polls, you can roll either forward or backward to your third migration by running

python manage.py migrate polls 003

You can also completely rollback models for an app. For dj-stripe

python manage.py migrate djstripe zero

And that's it! Then you can remove it from your environment again.

Related