我正在關注在線教程,並且在Django的測試服務器中查看和訪問我的管理面板時沒有問題。我可以在那裏編輯模型。這是當我把我的項目的Heroku,並試圖從那裏訪問管理面板,我得到這個錯誤:當我將Django項目推送到Heroku時,我該如何解決'OperationalError at/admin /'?
OperationalError at /admin/
no such table: django_session
Request Method: GET
Request URL: https://gentle-lowlands-8347.herokuapp.com/admin/
Django Version: 1.8.1
Exception Type: OperationalError
Exception Value:
no such table: django_session
Exception Location: /app/.heroku/python/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 318
Python Executable: /app/.heroku/python/bin/python
Python Version: 2.7.9
Python Path:
['/app',
'/app/.heroku/python/bin',
'/app/.heroku/python/lib/python2.7/site-packages/setuptools-16.0-py2.7.egg',
'/app/.heroku/python/lib/python2.7/site-packages/pip-7.0.1-py2.7.egg',
'/app',
'/app/.heroku/python/lib/python27.zip',
'/app/.heroku/python/lib/python2.7',
'/app/.heroku/python/lib/python2.7/plat-linux2',
'/app/.heroku/python/lib/python2.7/lib-tk',
'/app/.heroku/python/lib/python2.7/lib-old',
'/app/.heroku/python/lib/python2.7/lib-dynload',
'/app/.heroku/python/lib/python2.7/site-packages']
Server time: Thu, 28 May 2015 11:14:19 +0000
我想,當我試圖運行它可能是一個問題:heroku run python mange.py syncdb
我創建了一個超級用戶。嘗試訪問管理面板沒有任何作用。
我覺得它與遷移我的數據庫和我的settings.py文件中有錯誤的東西有關。我真的不知道。我一直在研究和搞亂它好幾天。
如果有些可以看看,幫我出:https://github.com/jltsao88/coffeedapp
你能確認你的數據庫設置正確嗎?你使用哪個db? – Wtower
我不確定如何確認數據庫是否設置正確。 Django設置了sqlite3,我應該將它遷移到使用postgres的heroku –
另外,我使用Windows計算機跟隨Django教程,並且教程使用Mac來完成它。我注意到有些事情是不同的,當我做PIP安裝postgres我的電腦安裝postgres 2.1.2,而當教程做PIP安裝Postgres它安裝postgressql 9.x或東西 –