I am trying django on heroku, following the [official tutorial](https://devcenter.heroku.com/articles/django#syncing_the_database) and stuck at the `creating celery and kombu tables locally` step using `python manage.py syncdb`, getting following errors:

> 
> File "/my/virtual/path/django/db/backends/postgresql\_psycopg2/base.py",
>  line 162, in \_cursor
>  raise ImproperlyConfigured("You need to specify NAME in your Django settings file.") 
>  django.core.exceptions.ImproperlyConfigured: You need to specify NAME in your Django settings file.
> 
> 
> 

The problem is it cannot find the db I set for heroku by the config vars of heroku. When I run `heroku config`, it displays the `DATABASE_URL` of my app correctly, but when I try:

> 
> if 'DATABASE\_URL' in os.environ
> 
> 
> 

in python interpreter, it returns `false`. I also check, none of my config vars is in my `os.environ`. Shouldn't vars be added to it automatically? My previous steps are correct.

I searched and got a lot of solutions to detect the heroku db but they all are based on the assumption that I have the `DATABASE_URL` in my `os.environ`.

Could anyone point out where I went wrong? Any suggestion is appreciated. Thanks!