“no such table” error on Heroku after django syncdb passed

前端 未结 4 693
日久生厌
日久生厌 2021-02-04 13:31

I\'m trying to deploy my Django application to Heroku. The migrations are in my local Git. When I try:

git push heroku master
heroku run python manage.py syncdb
         


        
4条回答
  •  梦如初夏
    2021-02-04 14:23

    You can use postgresql:

    In settings.py add(at the end of file):

    # ie if Heroku server
    if 'DATABASE_URL' in os.environ:
        import dj_database_url
        DATABASES = {'default': dj_database_url.config()}
    

    In requirements.txt add:

    dj-database-url 
    psycopg2
    

    Now you can run: heroku run python manage.py migrate

提交回复
热议问题