-1

i purchased an outsource service to develop a web site in django to be deployed in heroku and AWS S3 (boto package). Unfortunately the developer did not comment the code, despite it was asked, and left the project uncompleted for following up with a bigger client. I've hired another django 'expert' to fix a part which was not developed, and he want to (over)charge for deployment testing, which i think should be a normal matter for good practices! i am working on my own budject, and need to work it out myself.

I was able to make the project run locally and make myself the frontend templates which were not fully developed, but I am having issues in deploying the code on my own staging environment.

I set up a staging environment under my credential to check if everything is ok, before pushing to production.

I think I almost get there, though:

heroku run python manage.py migrate --all --noinput --app my-app-staging

generate in the console:

Running `python manage.py migrate --all --noinput` attached to terminal... up, run.4833

DatabaseError: relation "south_migrationhistory" does not exist LINE 1: ...gration", "south_migrationhistory"."applied" FROM "south_mig...

In the browser:

DatabaseError at /
relation "django_site" does not exist
LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si...
                                                             ^
Request Method: GET
Request URL:    http://my-app-staging.herokuapp.com/
Django Version: 1.5.6
Exception Type: DatabaseError
Exception Value:    
relation "django_site" does not exist
LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si...
                                                             ^
Exception Location: /app/.heroku/python/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py in execute, line 5

I checked my settings and they look ok: i check AWS S3 bucket and it is able to write there; settings in heroku console display that the db has been created.

I followed: Heroku created table but when I'll migrate, he says that doesn't created

but it looks my locals.py are ok too, and in my local git branch .gitignore will exclude db.sqlite

My git and heroku ssh keys have been generated and added, so i dont' think it is an issue of authentification.

How could i check that the db is properly connected to django project and I am not invalidated? Could you please help in debriefing to understand what this error means and how to solve it?

So much thank you.

Community
  • 1
  • 1
user305883
  • 1,635
  • 2
  • 24
  • 48

1 Answers1

3

It sounds like you might not have created the initial South migration tables on your staging server. This is actually done using syncdb:

Once South is added in, you’ll need to run ./manage.py syncdb to make the South migration-tracking tables (South doesn’t use migrations for its own models, for various reasons).

To run this on Heroku, you'll probably want to use something like

heroku run python manage.py syncdb

Once this is done, you should be able to move forward with the South commands.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • 1
    thank you @Chris it worked for me. Thank you for the link to the tutorial too! now I can move on to the next debug .. :) - sorry i cannot upvote your answer yet, due to low reputation. – user305883 Dec 29 '14 at 23:19