cmd下执行
pip install django
选一个空文件夹进去
django-admin startproject myweb
cd myweb
新建文件夹 template,和manage.py同层级目录
在pycharm操作,在template下新增html
再进一层myweb
新建views.py
from django.shortcuts import render
def welcome(request):
return render(request,'welcome.html')
编辑url.py
from myweb import views
path里面新增一条path('welcome/', views.welcome)
settings.py
import os
template下DIR 新增内容os.path.join(BASE_DIR, 'templates')
STATICFILES_DIRS = [(os.path.join(BASE_DIR, "myweb/static/", )),
进入myweb 和views.py同层,建static文件夹,放js文件
html文件头部加{% load static %}
脚本引用
<script type="text/javascript" src="{% static 'bootstrap-table.min.js' %}"></script>
css引用
<link href="{% static 'bootstrap-table.min.css' %}" rel="stylesheet">
天翼云盘 珍藏美好生活 家庭云|网盘|文件备份|资源分享天翼云盘 珍藏美好生活 家庭云|网盘|文件备份|资源分享天翼云盘是中国电信推出的云存储服务,为用户提供跨平台的文件存储、备份、同步及分享服务,是国内领先的免费网盘,安全、可靠、稳定、快速。天翼云盘为用户守护数据资产。https://cloud.189.cn/web/share?code=RbIFvibE3uiy%EF%BC%88%E8%AE%BF%E9%97%AE%E7%A0%81%EF%BC%9Ammc6%EF%BC%89