1. Chris Moffitt
  2. satchmo
  3. Issues
Issue #210 resolved

Cannot load DATABASE_NAME from settings file in version 0.6

Anonymous created an issue

I am trying to run Satchmo as a standalone app. I created settings.py from setting-customize.py and local_settings.py from local_settings-customize.py. I also edited settings.py to define DATABASE_ENGINE and local_setting.py to define DATABASE_NAME, _USER and _PASSWORD.

However, when I run python load_data.py I get the following error: You must specified a value for DATABASE_NAME in local_settings.py.

I managed to work around this error editing settings.py and changing DJANGO_SETTINGS_MODULE to 'settings' instead of 'satchmo.settings'. I queried the database and verified that load_data.py had correctly loaded the sample data.

When i try to launch the app with python manage.py runserver, I try to load localhost:8000 in the browser and i get a missing DATABASE_NAME error again. I changed DJANGO_SETTINGS_MODULE back to 'satchmo.settings' in settings.py and relauched the app, but it still fails with the same error.

I have checked that the line from local_settings import * is not commented in settings.py. I can also open an interactive shell, type import settings and read settings.DATABASE_NAME correctly.

Can anybody help me? The error when i try to open localhost:8000 is:

Traceback (most recent call last):

File "D:\Python25\lib\site-packages\django\core\servers\basehttp.py", line 278, in run self.result = application(self.environ, self.start_response)

File "D:\Python25\lib\site-packages\django\core\servers\basehttp.py", line 620, in call return self.application(environ, start_response)

File "D:\Python25\lib\site-packages\django\core\handlers\wsgi.py", line 205, in call response = self.get_response(request)

File "D:\Python25\lib\site-packages\django\core\handlers\base.py", line 63, in get_response response = middleware_method(request)

File "D:\Python25\lib\site-packages\django\middleware\locale.py", line 16, in process_request language = translation.get_language_from_request(request)

File "D:\Python25\lib\site-packages\django\utils\translation__init__.py", line 97, in get_language_from_request return real_get_language_from_request(request)

File "D:\Python25\lib\site-packages\django\utils\translation\trans_real.py", line 347, in get_language_from_request lang_code = request.session.get('django_language', None)

File "D:\Python25\lib\site-packages\django\contrib\sessions\backends\base.py", line 48, in get return self._session.get(key, default)

File "D:\Python25\lib\site-packages\django\contrib\sessions\backends\base.py", line 118, in _get_session self._session_cache = self.load()

File "D:\Python25\lib\site-packages\django\contrib\sessions\backends\db.py", line 18, in load expire_date__gt=datetime.datetime.now()

File "D:\Python25\lib\site-packages\django\db\models\manager.py", line 69, in get return self.get_query_set().get(args, *kwargs)

File "D:\Python25\lib\site-packages\django\db\models\query.py", line 261, in get obj_list = list(clone)

File "D:\Python25\lib\site-packages\django\db\models\query.py", line 114, in iter return iter(self._get_data())

File "D:\Python25\lib\site-packages\django\db\models\query.py", line 482, in _get_data self._result_cache = list(self.iterator())

File "D:\Python25\lib\site-packages\django\db\models\query.py", line 188, in iterator cursor = connection.cursor()

File "D:\Python25\lib\site-packages\django\db\backends__init__.py", line 33, in cursor cursor = self._cursor(settings)

File "D:\Python25\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", line 57, in _cursor raise ImproperlyConfigured("You need to specify DATABASE_NAME in your Django settings file.")

ImproperlyConfigured: You need to specify DATABASE_NAME in your Django settings file.

Reported by nofactor

Comments (1)

  1. Log in to comment