1. pip install django -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
  2. pip install django-tinymce -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
  3. pip install PySide2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
  4. pip install enchant -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

image.png

  1. pip install pymysql -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

image.png

Django项目遇到ImportError: cannot import name ‘url‘ from ‘django.conf.urls‘解决方法(亲测有效)_阿正的梦工坊的博客-CSDN博客_django.conf.urls

python pip 时候出现Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))Hao_K的博客-CSDN博客_retrying (retry(total=3, connect=none, read=none,

  1. pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
  2. pip install pymysql -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
  3. pip install pyecharts -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

PyCharm 2022.2.3 终端有点问题,要初始化一下
小白纯新 WINDOWS10 使用Anaconda3搭建dvadmin本地运行环境记录贴 - django-vue-admin 社区

  1. (base) PS D:\Study\Python\django-vue-admin> python3 manage.py makemigrations
  2. (base) PS D:\Study\Python\django-vue-admin> python manage.py makemigrations
  3. D:\Programs\anaconda3\python.exe: can't open file 'D:\Study\Python\django-vue-admin\manage.py': [Errno 2] No such file or directory
  4. (base) PS D:\Study\Python\django-vue-admin> cd .\backend\
  5. (base) PS D:\Study\Python\django-vue-admin\backend> python manage.py makemigrations
  6. 请先进行数据库迁移!
  7. 请先进行数据库迁移!
  8. No changes detected
  9. (base) PS D:\Study\Python\django-vue-admin\backend> ^C
  10. (base) PS D:\Study\Python\django-vue-admin\backend> python3 manage.py migrate
  11. (base) PS D:\Study\Python\django-vue-admin\backend> python manage.py migrate
  12. 请先进行数据库迁移!
  13. 请先进行数据库迁移!
  14. Operations to perform:
  15. Apply all migrations: auth, captcha, contenttypes, sessions, system
  16. Running migrations:
  17. Applying contenttypes.0001_initial... OK
  18. Applying contenttypes.0002_remove_content_type_name... OK
  19. Applying auth.0001_initial... OK
  20. Applying auth.0002_alter_permission_name_max_length... OK
  21. Applying auth.0004_alter_user_username_opts... OK
  22. Applying auth.0006_require_contenttypes_0002... OK
  23. Applying auth.0007_alter_validators_add_error_messages... OK
  24. Applying auth.0008_alter_user_username_max_length... OK
  25. Applying auth.0009_alter_user_last_name_max_length... OK
  26. Applying auth.0010_alter_group_name_max_length... OK
  27. Applying auth.0011_update_proxy_permissions... OK
  28. Applying auth.0012_alter_user_first_name_max_length... OK
  29. Applying captcha.0001_initial... OK
  30. Applying system.0001_initial... OK
  31. (base) PS D:\Study\Python\django-vue-admin\backend> python manage.py makemigrations
  32. (base) PS D:\Study\Python\django-vue-admin\backend> python manage.py init
  33. [dvadmin.system][dept]初始化完成
  34. [dvadmin.system][role]初始化完成
  35. [dvadmin.system][users]初始化完成
  36. [dvadmin.system][menu]初始化完成
  37. [dvadmin.system][apiwhitelist]初始化完成
  38. [dvadmin.system][dictionary]初始化完成
  39. [dvadmin.system][systemconfig]初始化完成
  40. 初始化数据完成!
  41. (base) PS D:\Study\Python\django-vue-admin\backend> python manage.py init_area
  42. 正在准备初始化省份数据...
  43. (base) PS D:\Study\Python\django-vue-admin\backend> python manage.py runserver 0.0.0.0:8000
  44. [2022-12-22 14:09:37][django.utils.autoreload.run_with_reloader():636] [INFO] Watching for file changes with StatReloader
  45. Performing system checks...
  46. System check identified no issues (0 silenced).
  47. December 22, 2022 - 14:09:37
  48. Django version 3.2.3, using settings 'application.settings'
  49. Starting ASGI/Channels version 3.0.5 development server at http://0.0.0.0:8000/
  50. Quit the server with CTRL-BREAK.
  51. [2022-12-22 14:09:38][daphne.server.run():113] [INFO] HTTP/2 support not enabled (install the http2 and tls Twisted extras)
  52. [2022-12-22 14:09:38][daphne.server.listen_success():153] [INFO] Listening on TCP address 0.0.0.0:8000
  53. (base) PS D:\Study\Python\django-vue-admin\backend> npm run dev
  54. npm ERR! code ENOENT
  55. npm ERR! syscall open
  56. npm ERR! path D:\Study\Python\django-vue-admin\backend/package.json
  57. npm ERR! errno -4058
  58. npm ERR! enoent ENOENT: no such file or directory, open 'D:\Study\Python\django-vue-admin\backend\package.json'
  59. npm ERR! enoent This is related to npm not being able to find a file.
  60. npm ERR! enoent
  61. npm ERR! A complete log of this run can be found in:
  62. npm ERR! C:\Users\23046\AppData\Local\npm-cache\_logs\2022-12-22T06_10_12_586Z-debug-0.log
  63. (base) PS D:\Study\Python\django-vue-admin\backend> python manage.py runserver 0.0.0.0:8000
  64. [2022-12-22 14:10:47][django.utils.autoreload.run_with_reloader():636] [INFO] Watching for file changes with StatReloader
  65. Performing system checks...
  66. System check identified no issues (0 silenced).
  67. December 22, 2022 - 14:10:48
  68. Django version 3.2.3, using settings 'application.settings'
  69. Starting ASGI/Channels version 3.0.5 development server at http://0.0.0.0:8000/
  70. Quit the server with CTRL-BREAK.
  71. [2022-12-22 14:10:48][daphne.server.run():113] [INFO] HTTP/2 support not enabled (install the http2 and tls Twisted extras)
  72. [2022-12-22 14:10:48][daphne.server.run():122] [INFO] Configuring endpoint tcp:port=8000:interface=0.0.0.0
  73. [2022-12-22 14:10:48][daphne.server.listen_success():153] [INFO] Listening on TCP address 0.0.0.0:8000
  74. [2022-12-22 14:10:57][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/init/dictionary/?dictionary_key=all 200 [0.00, 127.0.0.1:6679]
  75. [2022-12-22 14:10:57][django.channels.server.log_action():147] [INFO] HTTP GET /api/init/dictionary/?dictionary_key=all 200 [0.01, 127.0.0.1:6679]
  76. [2022-12-22 14:10:57][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/init/settings/ 200 [0.00, 127.0.0.1:6679]
  77. [2022-12-22 14:10:57][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/captcha/ 200 [0.01, 127.0.0.1:6684]
  78. [2022-12-22 14:10:57][django.channels.server.log_action():147] [INFO] HTTP GET /api/init/settings/ 200 [0.02, 127.0.0.1:6679]
  79. [2022-12-22 14:10:57][django.channels.server.log_action():147] [INFO] HTTP GET /api/captcha/ 200 [0.06, 127.0.0.1:6684]
  80. [2022-12-22 14:12:14][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/login/ 200 [0.00, 127.0.0.1:6795]
  81. [2022-12-22 14:12:14][dvadmin.utils.backends.authenticate():19] [INFO] superadmin 正在使用本地登录...
  82. check_hostname requires server_hostname
  83. [2022-12-22 14:12:14][django.channels.server.log_action():147] [INFO] HTTP POST /api/login/ 200 [0.20, 127.0.0.1:6795]
  84. [2022-12-22 14:12:14][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/system/user/user_info/ 200 [0.00, 127.0.0.1:6795]
  85. [2022-12-22 14:12:14][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/user/user_info/ 200 [0.01, 127.0.0.1:6795]
  86. [2022-12-22 14:12:14][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/system/menu/web_router/ 200 [0.00, 127.0.0.1:6795]
  87. [2022-12-22 14:12:15][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/menu/web_router/ 200 [0.02, 127.0.0.1:6795]
  88. [2022-12-22 14:12:15][django.channels.server.log_action():168] [INFO] WebSocket HANDSHAKING /ws/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjcxNjk2NzM0LCJpYXQiOjE2NzE2ODk1MzQsImp0aSI6Ijg0NWViYmNmMWI
  89. yNzRmNjZhYjk4MGQ5YWQ3M2EyNjUwIiwidXNlcl9pZCI6MX0.1u0lApZzDKzGUpppfuCQyN9OWKLV7-aZVV5Agvt_peI/ [127.0.0.1:6815]
  90. [2022-12-22 14:12:15][django.channels.server.log_action():164] [INFO] WebSocket CONNECT /ws/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjcxNjk2NzM0LCJpYXQiOjE2NzE2ODk1MzQsImp0aSI6Ijg0NWViYmNmMWIyNzR
  91. mNjZhYjk4MGQ5YWQ3M2EyNjUwIiwidXNlcl9pZCI6MX0.1u0lApZzDKzGUpppfuCQyN9OWKLV7-aZVV5Agvt_peI/ [127.0.0.1:6815]
  92. [2022-12-22 14:12:22][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/system/menu/ 200 [0.00, 127.0.0.1:6795]
  93. [2022-12-22 14:12:23][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/menu/ 200 [0.35, 127.0.0.1:6795]
  94. [2022-12-22 14:12:24][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/system/dept/?limit=20&page=1&lazy=1 200 [0.00, 127.0.0.1:6795]
  95. [2022-12-22 14:12:24][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/dept/?limit=20&page=1&lazy=1 200 [0.02, 127.0.0.1:6795]
  96. [2022-12-22 14:12:25][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/system/role/?limit=20&page=1 200 [0.00, 127.0.0.1:6795]
  97. [2022-12-22 14:12:25][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/role/?limit=20&page=1 200 [0.02, 127.0.0.1:6795]
  98. [2022-12-22 14:12:26][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/system/user/?user_type=0&query=%7Busername%2Cname%2Cdept%2Crole%2Cmobile%2Cemail%2Cgender%2Cuser_type%2Cis_active%2Cavatar%2Cdescription%2Cmodif
  99. ier_name%2Cdept_belong_id%2Cupdate_datetime%2Ccreate_datetime%2Cdept_name%2Crole_info%7Bname%7D%2Cdept_name_all%2Cid%7D&limit=20&page=1 200 [0.00, 127.0.0.1:6795]
  100. [2022-12-22 14:12:26][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/user/?user_type=0&query=%7Busername%2Cname%2Cdept%2Crole%2Cmobile%2Cemail%2Cgender%2Cuser_type%2Cis_active%2Cavatar%2Cdescription%2Cmodifier_
  101. name%2Cdept_belong_id%2Cupdate_datetime%2Ccreate_datetime%2Cdept_name%2Crole_info%7Bname%7D%2Cdept_name_all%2Cid%7D&limit=20&page=1 200 [0.03, 127.0.0.1:6795]
  102. [2022-12-22 14:12:26][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/system/message_center/?limit=20&page=1 200 [0.00, 127.0.0.1:6795]
  103. [2022-12-22 14:12:26][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/message_center/?limit=20&page=1 200 [0.01, 127.0.0.1:6795]
  104. [2022-12-22 14:12:27][django.channels.server.log_action():147] [INFO] HTTP OPTIONS /api/system/api_white_list/?limit=20&page=1 200 [0.00, 127.0.0.1:6795]
  105. [2022-12-22 14:12:45][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/menu/ 200 [0.02, 127.0.0.1:6795]
  106. [2022-12-22 14:12:46][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/dept/?limit=20&page=1&lazy=1 200 [0.02, 127.0.0.1:6795]
  107. [2022-12-22 14:12:47][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/role/?limit=20&page=1 200 [0.02, 127.0.0.1:6795]
  108. [2022-12-22 14:12:48][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/user/?user_type=0&query=%7Busername%2Cname%2Cdept%2Crole%2Cmobile%2Cemail%2Cgender%2Cuser_type%2Cis_active%2Cavatar%2Cdescription%2Cmodifier_
  109. name%2Cdept_belong_id%2Cupdate_datetime%2Ccreate_datetime%2Cdept_name%2Crole_info%7Bname%7D%2Cdept_name_all%2Cid%7D&limit=20&page=1 200 [0.03, 127.0.0.1:6795]
  110. [2022-12-22 14:12:48][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/message_center/?limit=20&page=1 200 [0.01, 127.0.0.1:6795]
  111. [2022-12-22 14:12:49][django.channels.server.log_action():147] [INFO] HTTP GET /api/system/api_white_list/?limit=20&page=1 200 [0.01, 127.0.0.1:6795]
  1. ## 前端♝
  2. ```bash
  3. # 克隆项目
  4. git clone https://gitee.com/liqianglog/django-vue-admin.git
  5. # 进入项目目录
  6. cd web
  7. # 安装依赖
  8. npm install --registry=https://registry.npm.taobao.org
  9. # 启动服务
  10. npm run dev
  11. # 浏览器访问 http://localhost:8080
  12. # .env.development 文件中可配置启动端口等参数
  13. # 构建生产环境
  14. # npm run build

后端💈

  1. 1. 进入项目目录 cd backend
  2. 2. 在项目根目录中,复制 ./conf/env.example.py 文件为一份新的到 ./conf 文件夹下,并重命名为 env.py
  3. 3. env.py 中配置数据库信息
  4. mysql数据库版本建议:8.0
  5. mysql数据库字符集:utf8mb4
  6. 4. 安装依赖环境
  7. pip3 install -r requirements.txt
  8. 5. 执行迁移命令:
  9. python3 manage.py makemigrations
  10. python3 manage.py migrate
  11. 6. 初始化数据
  12. python3 manage.py init
  13. 7. 初始化省市县数据:
  14. python3 manage.py init_area
  15. 8. 启动项目
  16. python manage.py runserver 0.0.0.0:8000
  17. 或使用 daphne :
  18. daphne -b 0.0.0.0 -p 8000 application.asgi:application

访问项目

https://github.com/mr0yun/BookManager