赞
踩
学习过程中,遇到问题可以咨询作者
基于Python+Django,打造一款在线图书管理系统,真的很清爽!
平台采用B/S结构,后端采用主流的Python语言进行开发,前端采用主流的Vue.js进行开发。
整个平台包括前台和后台两个部分。
(1) 安装python 3.8
(2) 安装依赖。进入bookproject目录下,执行 pip install -r requirements.txt
(3) 安装mysql 5.7数据库,并创建数据库,命名为book,创建SQL如下:
CREATE DATABASE IF NOT EXISTS book DEFAULT CHARSET utf8 COLLATE utf8_general_ci
(4) 恢复SQL数据。在cmd命令行执行如下命令:
mysql> use book;
mysql> source xxx/xxx.sql
(5) 启动django服务。在bookproject目录下执行:
python manage.py runserver
(1) 安装node 16.14
(2) 进入web目录下,安装依赖,执行:
npm install
(3) 运行项目
npm run serve
首页
后台首页
后台借阅管理
获取前记得收藏、点赞支持一下。
方式①、微信搜索公众号:Python学习与数据挖掘,后台回复:在线图书管理系统
方式②、添加微信号:dkl88194,备注:来自CSDN +在线图书管理系统
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookproject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
"""bookproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from bookproject import settings
urlpatterns = [
path('admin/', admin.site.urls),
path('myapp/', include('myapp.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。