Search code examples
pythondjangoforum

django configParser error



i'm trying to syncdb for a forum django package called Dinnete but keep getting this error :

>>> os.system("python manage.py syncdb")
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "C:\Python27\lib\site-packages\django\core\mana
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\mana
    self.fetch_command(subcommand).run_from_argv(self.
  File "C:\Python27\lib\site-packages\django\core\mana
    self.execute(*args, **options.__dict__)
  File "C:\Python27\lib\site-packages\django\core\mana
    self.validate()
  File "C:\Python27\lib\site-packages\django\core\mana
    num_errors = get_validation_errors(s, app)
  File "C:\Python27\lib\site-packages\django\core\mana
    for (app_name, error) in get_app_errors().items():
  File "C:\Python27\lib\site-packages\django\db\models
    self._populate()
  File "C:\Python27\lib\site-packages\django\db\models
    self.load_app(app_name, True)
  File "C:\Python27\lib\site-packages\django\db\models
    models = import_module('.models', app_name)
  File "C:\Python27\lib\site-packages\django\utils\imp
    __import__(name)
  File "D:\projects\online\goulcg\dinette\models.py",
    logging.config.fileConfig(settings.LOG_FILE_NAME,d
  File "C:\Python27\lib\logging\config.py", line 70, i
    formatters = _create_formatters(cp)
  File "C:\Python27\lib\logging\config.py", line 106,
    flist = cp.get("formatters", "keys")
  File "C:\Python27\lib\ConfigParser.py", line 599, in
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'formatters'

does anyone have an idea what is going on ? or how to fix it

please help

thanks in advance


Solution

  • The problem is with your logging configuration in settings.py.

    If you do not care about logging at the moment, you can delete the entire section that looks like this:

    LOGGING = {
    ...
    ...
    ...
    }
    

    or replace it with this default example from the django docs site: https://docs.djangoproject.com/en/dev/topics/logging/#an-example