Trouble with heroku run python manage.py syncdb

When I'm running $ heroku run python manage.py syncdb

Or when I load the app through Heroku, I am getting an "ImproperlyConfigured" error. It is suggesting that I "Put 'django.contrib.admin' in your INSTALLED_APPS setting in order to use the admin application."

However, I already have django.contrib.admin in INSTALLED_APPS by doing: INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS

As was suggested in the tutorial. What am I doing wrong?

Sorry You must be a logged in, registered user to answer a question.

Answers

First make sure you have the postgres addon in your heroku which you probably do have. Then make sure your settings/local.py has not been committed to your git repo. You can remove it by doing a git rm settings/local.py. Make sure your DATABASE string in base.py is DATABASES = {'default' : dj_database_url.config() } Make sure you then commit and push up to heroku and try run heroku run python manage.py syncdb again. I had the same issues and found my answers in these references http://stackoverflow.com/questions/14574827/gswd-heroku-django-manage-py-issue and http://stackoverflow.com/questions/14679224/heroku-postgresql-wont-syncdb

Thanks, I know it's been awhile but this worked for me... though I'm fairly sure it didn't on the first time I tried all those months ago.
Nate Wilson on

Ok. So I followed the instructions here: http://gettingstartedwithdjango.com/questions/1/error-when-executing-heroku-run-python-managepy-syncdb/

Now however I am getting the following error: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

This makes absolutely no sense to me. Thanks again!

First make sure you have the postgres addon in your heroku which you probably do have. Then make sure your settings/local.py has not beenn committed to your git repo. You can remove it by doing a git rm settings/local.py. Make sure your DATABASE string in base.py is DATABASES = {'default' : dj_database_url.config() } I had the same issues and found my answers in these references http://stackoverflow.com/questions/14574827/gswd-heroku-django-manage-py-issue and http://stackoverflow.com/questions/14679224/heroku-postgresql-wont-syncdb
Darren on
If you go to your Heroku dashboard for your app, does it list the Postgres addon?
kennethlove (Staff) on

Please make sure you do not have local.py already uploaded to heroku. You can be sure of this running the command:

git rm --cached microblog/settings/local.py Also you have to have an entry "microblog/settings/local.py" in your .gitignore file.

After this make an add/commit/push again to heroku. And all should be fine.

I had the same issue--my solution was to add the settings directory to git with git add settings/. For some reason the entire directory was not being tracked. We only want the avoid tracking the local settings file.

Of course, make sure your .gitignore excludes settings/local.py first...

Hi, I've been getting exactly the same error as well, were you able to find a solution?

This worked for me http://stackoverflow.com/questions/14574827/gswd-heroku-django-manage-py-issue
Mustafa Eid on