python - settings.DATABASES is improperly configured. Please supply the NAME value -
i know people asked similar question before. it's engine value. 1 know how solve error name value? deployed heroku , works fine. however, in local, gives me error here traceback:
traceback: file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 132. response = wrapped_callback(request, *callback_args, **callback_kwargs) file "/users/qiaoweiliu/google drive/heroku/luxingnan/views.py" in home 17. return render(request,'luxingnan/home.html',{'auth_form':auth_form, 'user_form':user_form,'cars':cars,'next_url': '/',}) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/shortcuts.py" in render 67. template_name, context, request=request, using=using) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/loader.py" in render_to_string 99. return template.render(context, request) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/backends/django.py" in render 74. return self.template.render(context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/base.py" in render 209. return self._render(context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/base.py" in _render 201. return self.nodelist.render(context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/debug.py" in render_node 79. return node.render(context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/loader_tags.py" in render 135. return compiled_parent._render(context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/base.py" in _render 201. return self.nodelist.render(context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/debug.py" in render_node 79. return node.render(context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/loader_tags.py" in render 65. result = block.nodelist.render(context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/base.py" in render 903. bit = self.render_node(node, context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/debug.py" in render_node 79. return node.render(context) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/defaulttags.py" in render 328. if match: file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/models/query.py" in __nonzero__ 170. return type(self).__bool__(self) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/models/query.py" in __bool__ 166. self._fetch_all() file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/models/query.py" in _fetch_all 965. self._result_cache = list(self.iterator()) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/models/query.py" in iterator 238. results = compiler.execute_sql() file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql 827. cursor = self.connection.cursor() file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/backends/base/base.py" in cursor 162. cursor = self.make_debug_cursor(self._cursor()) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/backends/base/base.py" in _cursor 135. self.ensure_connection() file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/backends/base/base.py" in ensure_connection 130. self.connect() file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/backends/base/base.py" in connect 118. conn_params = self.get_connection_params() file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py" in get_connection_params 154. "settings.databases improperly configured. " exception type: improperlyconfigured @ / exception value: settings.databases improperly configured. please supply name value.
and here setting.py
databases = { 'default': { 'engine': 'django.db.backends.sqlite3', 'name': os.path.join(base_dir, 'db.sqlite3'), } } databases['default'] = dj_database_url.config() databases['default']['engine'] = 'django_postgrespool'
databases = { 'default': { 'engine': 'django.db.backends.sqlite3', 'name': os.path.join(base_dir, 'db.sqlite3'), } }
is enough. , if want use django_postgrespool
, can edit above.
your line:
databases['default'] = dj_database_url.config()
just overwrite above standard database
settings.