0

I'm deploying a Django app to Heroku, everything work as expected locally. I'm using a clone of django-shop which is updated for Django 1.8 like this:

-e git+https://github.com/divio/django-shop.git@a74e38369de40b9e5f481f6ac9dda6d5eb161da0#egg=django_shop-master   

However South gets automatically installed with it. Locally I can just pip uninstall South and everything works fine. I have tried with heroku run pip uninstall south which seems like it works and does say that South was successfully uninstalled - until I try to migrate my DB, then I get:

There is no South database module 'south.db.postgresql_psycopg2' for your database. 
Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S]
settings, or remove South from INSTALLED_APPS.

Is there any way to successfully remove a package installed like this from Heroku

Lani Gouws
  • 21
  • 4
  • Does this help? http://stackoverflow.com/questions/15046378/manually-remove-python-package-on-heroku – Newtt Dec 11 '15 at 21:03
  • 1
    You only need to remove South from your project's `INSTALLED_APPS` list. Just edit your *settings.py* file. No need to uninstall anything. – xyres Dec 11 '15 at 21:11
  • @xyres Thanks, but it's not in my INSTALLED_APPS or requirements.txt. It only gets installed along with django-shop from Github when I git push to Heroku. – Lani Gouws Dec 11 '15 at 21:18
  • @Newtt Thanks. Saw that before I asked, tried it, didn't work. – Lani Gouws Dec 11 '15 at 21:22
  • @LaniGouws Hmm, strange. Can you confirm that in your `DATABASES` settings, the value of `ENGINE` is not set to `south.db.postgresql_psycopg`? – xyres Dec 11 '15 at 21:40
  • @xyres Yup. never used South, never added it to code anywhere. ENGINE in settings.py is: 'ENGINE': 'django.db.backends.postgres_psycopg2', – Lani Gouws Dec 11 '15 at 21:51
  • @LaniGouws Did you try deleting all the migration files (except for `__init__.py`) from the `migrations` directory of django-shop? See the [source code those files](https://github.com/divio/django-shop/blob/a74e38369de40b9e5f481f6ac9dda6d5eb161da0/shop/migrations/0001_initial.py). They are importing from South. Maybe, deleting those migrations could fix it. – xyres Dec 11 '15 at 22:10
  • @xyres thanks so much for all your help. I tried that now, but the problem is that django-shop is cloned from the github repo every time I git push to Heroku. – Lani Gouws Dec 11 '15 at 23:00
  • @LaniGouws You can fork that repo to your GitHub account. That way you'll have full control over that. Then you can remove migrations, commit changes and clone this repo in Heroku. – xyres Dec 12 '15 at 15:11
  • @xyres Thank you so much for the time spent on my question!! It seems so obvious now, but I didn't know you could fork a repo and then make it a requirement. I did this and the site is up and running. – Lani Gouws Dec 17 '15 at 14:44

0 Answers0