On Jul 9, 10:21 pm, morning yao <yitai...@gmail.com> wrote:
> so ,here is the Error Traceback,i need your help,thanks!
(...)
> File "C:\Python27\Lib\site-packages\django\dinette\..\dinette
> \models.py" in <module>
>   18.
> logging.config.fileConfig(settings.LOG_FILE_NAME,defaults=dict(log_path=settings.LOG_FILE_PATH))
> File "C:\Python27\lib\site-packages\django\utils\functional.py" in
> __getattr__
>   277.         return getattr(self._wrapped, name)
>
> Exception Type: AttributeError at /
> Exception Value: 'Settings' object has no attribute 'LOG_FILE_NAME'

As the traceback kindly explain, the dinette.models module is trying
to access non-existing attributes of the settings module. You'd need
to define LOG_FILE_NAME and LOG_FILE_PATH in your settings or use
getattr(setting, "ATTRIBUTE_NAME", default_value) instead (cf Python's
doc for getattr).

As a side note, configuring the logging module in a models module is
definitly *not* a good idea. If you're using django 1.3+, there are
better ways, please refer to the relevant doc.

HTH

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to