0
我使用django管理基本的CRUD。我的管理模板很容易加載,即使加載了css文件,但它根本沒有任何效果。Django管理css文件沒有呈現
我試圖收集靜態文件,如下
Manage.py collectstaic
它顯示了以下錯誤
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\django\bin\hello\manage.py", line 10, in
module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
399, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
76, in load_command_class
return module.Command()
File "C:\Python27\lib\site-packages\django\contrib\staticfiles\management\com
ands\collectstatic.py", line 58, in __init__
self.storage.path('')
File "C:\Python27\lib\site-packages\django\contrib\staticfiles\storage.py", l
ne 46, in path
raise ImproperlyConfigured("You're using the staticfiles app "
django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app w
thout having set the STATIC_ROOT setting to a filesystem path.
如何解決UT?
集STATIC_ROOT settings.py中? django必須知道你想在哪裏收集靜態文件 – simar