0

When I run my Django app locally everything works just fine but when I deploy to Heroku using

import dj_database_url 

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

For my database settings I get the following error

TypeError at /

cannot concatenate 'str' and 'NoneType' objects

you can see the full error message here http://tulsa-staging.heroku.com

Ive removed all none essential settings and isolated the problem to this setting.

So what the heck am I doing wrong here?

harristrader
  • 1,181
  • 2
  • 13
  • 20

1 Answers1

0

Why aren't you listing a host in the config string?

DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
Jack Shedd
  • 3,501
  • 20
  • 27
  • Hey thanks for your response. I was just trying something there to see if I could get it to work. Even when I use the correct host (from heroku config) I can get the app to work properly in development but not in production. – harristrader Feb 28 '13 at 05:11
  • OK, have you checked the value of DATABASE_URL through heroku? Do a heroku config from the CLI within your project's root folder. – Jack Shedd Feb 28 '13 at 05:29
  • Yes its just my postgres url. – harristrader Feb 28 '13 at 05:32
  • Wait, is heroku production server or dev server? – Jack Shedd Feb 28 '13 at 05:42
  • Then I have no idea. I use this exact setup for numerous heroku projects, and it works with aplumb. I suspect your DATABASE_URL is malformed. – Jack Shedd Feb 28 '13 at 09:17
  • Thanks for sticking in there with me Jack. I got it figured. Database settings were fine. Issue had to do with my secret key settings. The secret key was improperly set in the environment. Really appreciate you digging into this for me. – harristrader Feb 28 '13 at 12:24