简体   繁体   中英

deploying django to heroku

Hi Folks so I followed the guid to deploying django on heroku here

https://devcenter.heroku.com/articles/django

but my server keeps crashing on heroku with this error any thoughts or direction is greatly appreciated.

2013-02-12T19:27:40+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-  packages/django/utils/importlib.py", line 35, in import_module
2013-02-12T19:27:40+00:00 app[web.1]:     __import__(name)
2013-02-12T19:27:40+00:00 app[web.1]:   File "/app/eduudle/settings.py", line 15, in   <module>
2013-02-12T19:27:40+00:00 app[web.1]:     DATABASES = { 'default': {dj_database_url.config()}}
2013-02-12T19:27:40+00:00 app[web.1]: TypeError: unhashable type: 'dict'
2013-02-12T19:27:41+00:00 heroku[web.1]: Process exited with status 1
2013-02-12T19:27:41+00:00 heroku[web.1]: State changed from starting to crashed

the docs suggest format for databases should be

DATABASES['default'] = dj_database_url.config()

not

DATABASES['default'] = {dj_database_url.config()}

found the issue the document is dated so following what it has wont work based on this

https://github.com/heroku/heroku-buildpack-python/issues/45

What I had originally would have worked but i added too many curly brackets

So instead of

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

use

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM