Yet another problem with "heroku run python manage.py syncdb"

I have already completed succesfully the first two episodes of GSWD and now I've created a new virtualenv for a personal project.

While installing and setting up everything for my personal project, everything went apparently well untill I run: "heroku run python manage.py syncdb". I get the following error message:

psycopg2.OperationalError: 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"?

The site works locally but not on heroku. When I try to load the admin page on heroku.

I have been searching and found similar problems, but none of the sugested solutions have worked for me.

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

Answers

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

http://stackoverflow.com/questions/14574827/gswd-heroku-django-manage-py-issue
Ji Park on
After some google I found this and realized what was causing that issue.
Ji Park on

Well, so the admin page uploaded to heroku is still not working. But it does work locally.

I did change the path in the .gitnore file and now it is correct.

I removed the local.py file from the repo with: "git rm --cached studylists/settings/local.py"

I ran "heroku python manage.py syncdb" again.

But the admin page is still not working on Heroku.

Any ideas on what I might be missing?

Thanks!

Sounds like you accidentally included your settings/local.py in the repo, to me. You said you have microblog/settings/local.py in your .gitignore, but is that path in your new project?

So I removed the local.py file with "git rm --cached studylists/settings/local.py", commited the change and pushed everything to heroku. But the admin page is still not working, it throws a 500 error. I can't run "heroku logs" because they are running maintenance right now, but I will keep working on it. Regards!
Ricardomol on
Oh, I can't believe I made such a silly mistake! You are right Kenneth, the path I wrote in my .gitignore file was incorrect. I didn't change the project name.
Ricardomol on

On your Heroku dashboard, do you see a postgresql database addon ? If not, you will have to provision one for your app:

$ heroku addons:add heroku-postgresql:dev

then promote it to be DATABASE_URL $heroku pg:promote HEROKU_POSTGRESQL_COLOR

Yes Jinzhang273, I do have the postgresql database addon.
Ricardomol on

Just to add a little more information:

In the .gitignore file I have:

"microblog/settings/local.py"

In base.py I have:

"DATABASES = {'default' : dj_database_url.config() }"