我應該在哪裏放置filebrowser的擴展設置。Django filebrowser擴展配置錯誤
我把filebrowser擴展配置到根settings.py:
from django.conf import settings
FILEBROWSER_EXTENSIONS = getattr(settings, "FILEBROWSER_EXTENSIONS", {
'Image': ['.jpg','.jpeg','.gif','.png','.tif','.tiff'],
'Document': ['.pdf','.doc','.rtf','.txt','.xls','.csv'],
'Video': ['.mov','.wmv','.mpeg','.mpg','.avi','.rm'],
'Audio': ['.mp3','.mp4','.wav','.aiff','.midi','.m4p']
})
當我嘗試啓動服務器,我得到這個錯誤:
Traceback (most recent call last):
File "manage.py", line 11, in <module>
import settings
File "/home/kelvin/workspace/exam/settings.py", line 177, in <module>
'Audio': ['.mp3','.mp4','.wav','.aiff','.midi','.m4p']
File "/usr/lib/python2.7/site-packages/django/utils/functional.py", line 276, in __getattr__
self._setup()
File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 40, in _setup
raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
您將該配置放入哪個settings.py文件? – Pickels 2011-04-24 09:44:49