第20章,设置应用程序的样式并对其进行部署,使用应用程序django-bootstrap3对“学习笔记"设置样式。
代码如下:
–snip–
INSTALLED_APPS = (
–snip–
‘django.contrib.staticfiles’,
# 第三方应用程序
'bootstrap3',
# 我的应用程序
‘learning_logs’,
‘users’,
)
–snip–
加入’bootstrap3’,之后就报错了,不知道什么情况。
报错:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File “C:\Users\qingting_bailihua\AppData\Local\Programs\Python\Python37\lib\threading.py”, line 917, in _bootstrap_inner
self.run()
File “C:\Users\qingting_bailihua\AppData\Local\Programs\Python\Python37\lib\threading.py”, line 865, in run
self._target(*self.args, **self.kwargs)
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 54, in wrapper
fn(*args, **kwargs)
File “D:\learning-note\ll_env\lib\site-packages\django\core\management\commands\runserver.py”, line 109, in inner_run
autoreload.raise_last_exception()
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 77, in raise_last_exception
raise exception[1]
File "D:\learning-note\ll_env\lib\site-packages\django\core\management_init.py", line 337, in execute
autoreload.check_errors(django.setup)()
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 54, in wrapper
fn(*args, **kwargs)
File "D:\learning-note\ll_env\lib\site-packages\django_init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “D:\learning-note\ll_env\lib\site-packages\django\apps\registry.py”, line 91, in populate
app_config = AppConfig.create(entry)
File “D:\learning-note\ll_env\lib\site-packages\django\apps\config.py”, line 90, in create
module = import_module(entry)
File "C:\Users\qingting_bailihua\AppData\Local\Programs\Python\Python37\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “
Traceback (most recent call last):
File “manage.py”, line 21, in
main()
File “manage.py”, line 17, in main
execute_from_command_line(sys.argv)
File “D:\learning-note\ll_env\lib\site-packages\django\core\management_init_.py”, line 381, in execute_from_command_line
utility.execute()
File “D:\learning-note\ll_env\lib\site-packages\django\core\management_init_.py”, line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “D:\learning-note\ll_env\lib\site-packages\django\core\management\base.py”, line 323, in run_from_argv
self.execute(*args, **cmd_options)
File “D:\learning-note\ll_env\lib\site-packages\django\core\management\commands\runserver.py”, line 60, in execute
super().execute(*args, **options)
File “D:\learning-note\ll_env\lib\site-packages\django\core\management\base.py”, line 364, in execute
output = self.handle(*args, **options)
File “D:\learning-note\ll_env\lib\site-packages\django\core\management\commands\runserver.py”, line 95, in handle
self.run(**options)
File “D:\learning-note\ll_env\lib\site-packages\django\core\management\commands\runserver.py”, line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 587, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 572, in start_django
reloader.run(django_main_thread)
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 290, in run
self.run_loop()
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 296, in run_loop
next(ticker)
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 336, in tick
for filepath, mtime in self.snapshot_files():
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 352, in snapshot_files
for file in self.watched_files():
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 251, in watched_files
yield from iter_all_python_module_files()
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File “D:\learning-note\ll_env\lib\site-packages\django\utils\autoreload.py”, line 138, in iter_modules_and_files
if not path.exists():
File “C:\Users\qingting_bailihua\AppData\Local\Programs\Python\Python37\lib\pathlib.py”, line 1339, in exists
self.stat()
File “C:\Users\qingting_bailihua\AppData\Local\Programs\Python\Python37\lib\pathlib.py”, line 1161, in stat
return self._accessor.stat(self)
OSError: [WinError 123] 文件名、目录名或卷标语法不正确。: ‘