我是 Django Web 开发的初学者,目前我正在使用 bootstrap4,方法是在 html 文件中加载bootstrap.min.css& bootstrap.min.js,如下所示。
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
最近我发现 Django 中有一个模块,django-bootstrap4我也在阅读它的文档。
https://django-bootstrap4.readthedocs.io/
我试图找到它们之间的区别,但没有找到任何区别。
哪些适合在 Web 开发中使用?
试图在谷歌上找到答案但没有找到所以请有人解释我这两者之间的区别吗?
我安装了 bootstrap4
$ pip install django-bootstrap4
它正在安装在这个目录中
C:\Users\trade\techpit-match-env\Lib\site-packages
Django 好像在看这个目录
C:\Users\trade\Anaconda3\lib\site-packages\django
当我将 'bootstrap4' 放入 INSTALLED_APPS = ('bootstrap4') 变量然后运行
$ python manage.py runserver
我收到这个错误
C:\Users\trade\techpit-match-env\Scripts\techpit>python manage.py runserver
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x000001C4D8F65488>
Traceback (most recent call last):
File "C:\Users\trade\Anaconda3\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\trade\Anaconda3\lib\site-packages\django\core\management\commands\runserver.py", line 113, in inner_run
autoreload.raise_last_exception()
File "C:\Users\trade\Anaconda3\lib\site-packages\django\utils\autoreload.py", line 248, in raise_last_exception
raise _exception[1]
File "C:\Users\trade\Anaconda3\lib\site-packages\django\core\management\__init__.py", line 327, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\trade\Anaconda3\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File …Run Code Online (Sandbox Code Playgroud)