另起一个新的Django项目 djangoProject_poll_test

........

把.tar.gz包下载到某个路径

D:\此电脑下分类\桌面\django-polls\dist\django-polls-0.1.tar.gz

安装子应用

定位到压缩包位置 执行

(venv) D:\此电脑下分类\桌面\django-polls\dist>
(venv) D:\此电脑下分类\桌面\django-polls\dist>python -m pip install django-polls-0.1.tar.gz
Processing d:\此电脑下分类\桌面\django-polls\dist\django-polls-0.1.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: Django>=4.0 in e:\python\0code\studybuddy\venv\lib\site-packages (from django-polls==0.1) (4.0.5)
Requirement already satisfied: tzdata in e:\python\0code\studybuddy\venv\lib\site-packages (from Django>=4.0->django-polls==0.1) (2022.1)
Requirement already satisfied: sqlparse>=0.2.2 in e:\python\0code\studybuddy\venv\lib\site-packages (from Django>=4.0->django-polls==0.1) (0.4.2)
Requirement already satisfied: asgiref<4,>=3.4.1 in e:\python\0code\studybuddy\venv\lib\site-packages (from Django>=4.0->django-polls==0.1) (3.5.2) DEPRECATION: Source distribution is being reinstalled despite an installed package having the same name and version as the installed package. pip 2
1.2 will remove support for this functionality. A possible replacement is use --force-reinstall. You can find discussion regarding this at https://
github.com/pypa/pip/issues/8711.
Building wheels for collected packages: django-polls
Building wheel for django-polls (PEP 517) ... done
Created wheel for django-polls: filename=django_polls-0.1-py3-none-any.whl size=529100 sha256=e1b1dc64f611731e5e9e9bd0ad1784571b86c43a9cc8912b1a7
5abda32eec09a
Stored in directory: c:\users\大飞斗\appdata\local\pip\cache\wheels\8d\95\18\87a91d3e9c9b7975ad9909d81d99733f5a863ee9e320a85e55
Successfully built django-polls
Installing collected packages: django-polls
Attempting uninstall: django-polls
Found existing installation: django-polls 0.1
Uninstalling django-polls-0.1:
Successfully uninstalled django-polls-0.1
Successfully installed django-polls-0.1
WARNING: You are using pip version 21.1.2; however, version 23.0 is available.
You should consider upgrading via the 'E:\PYTHON\0CODE\StudyBuddy\venv\Scripts\python.exe -m pip install --upgrade pip' command. (venv) D:\此电脑下分类\桌面\django-polls\dist>
(venv) D:\此电脑下分类\桌面\django-polls\dist>

按照README.rst编辑配置文件

=====
Polls
===== Polls is a Django app to conduct web-based polls. For each question,
visitors can choose between a fixed number of answers. Detailed documentation is in the "docs" directory. Quick start
----------- 1. Add "polls" to your INSTALLED_APPS setting like this:: INSTALLED_APPS = [
...
'polls',
] 2. Include the polls URLconf in your project urls.py like this:: path('polls/', include('polls.urls')), 3. Run ``python manage.py migrate`` to create the polls models. 4. Start the development server and visit http://127.0.0.1:8000/admin/
to create a poll (you'll need the Admin app enabled). 5. Visit http://127.0.0.1:8000/polls/ to participate in the poll.
  1. urls.py

  1. settings.py

启动

可见数据还是空的

也无法用之前的用户登录

新建用户 newf 并登录

(venv) E:\PYTHON\0CODE\djangoProject_poll_test>
(venv) E:\PYTHON\0CODE\djangoProject_poll_test>
(venv) E:\PYTHON\0CODE\djangoProject_poll_test>python manage.py createsuperuser
Username: newf
Email address: newf@qq.com
Password:
Password (again):
The password is too similar to the username.
This password is too short. It must contain at least 8 characters.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully. (venv) E:\PYTHON\0CODE\djangoProject_poll_test>
(venv) E:\PYTHON\0CODE\djangoProject_poll_test>
(venv) E:\PYTHON\0CODE\djangoProject_poll_test>python manage.py runserver 5000
Watching for file changes with StatReloader
Performing system checks... System check identified no issues (0 silenced).
February 17, 2023 - 21:28:03
Django version 4.0.5, using settings 'djangoProject_poll_test.settings'
Starting development server at http://127.0.0.1:5000/
Quit the server with CTRL-BREAK.
[17/Feb/2023 21:28:05] "POST /admin/login/?next=/admin/ HTTP/1.1" 302 0
[17/Feb/2023 21:28:05] "GET /admin/ HTTP/1.1" 200 4394
[17/Feb/2023 21:28:06] "GET /static/admin/img/icon-changelink.svg HTTP/1.1" 200 380
[17/Feb/2023 21:28:06] "GET /static/admin/img/icon-addlink.svg HTTP/1.1" 200 331

效果

回忆之前

我们设置的后台风格修改的html文件

在这里

都没有生效,因为

他们都被隔离到主项目的templages里面了

卸载

(venv) E:\PYTHON\0CODE\djangoProject_poll_test>
(venv) E:\PYTHON\0CODE\djangoProject_poll_test>
(venv) E:\PYTHON\0CODE\djangoProject_poll_test>python -m pip uninstall django-polls
Found existing installation: django-polls 0.1
Uninstalling django-polls-0.1:
Would remove:
e:\python\0code\studybuddy\venv\lib\site-packages\django_polls-0.1.dist-info\*
e:\python\0code\studybuddy\venv\lib\site-packages\polls\*
Proceed (y/n)? y
Successfully uninstalled django-polls-0.1 (venv) E:\PYTHON\0CODE\djangoProject_poll_test>
(venv) E:\PYTHON\0CODE\djangoProject_poll_test>

5.安装&卸载子应用 投票的更多相关文章

  1. WPF 自己动手来做安装卸载程序

    原文:WPF 自己动手来做安装卸载程序 前言 说起安装程序,这也许是大家比较遗忘的部分,那么做C/S是小伙伴们,难道你们的程序真的不需要一个炫酷的安装程序么? 声明在先 本文旨在教大家以自己的方式实现 ...

  2. Apache源码包安装和子配置文件介绍--update.2014-12-5

    安装apache: 官网:http://httpd.apache.org/download.cgi#apache24 1.wget http://mirror.bit.edu.cn/apache//h ...

  3. inno安装卸载时检测程序是否正在运行卸载完成后自动打开网页-代码无效

    inno安装卸载时检测程序是否正在运行卸载完成后自动打开网页-代码无效 inno setup 安装卸载时检测程序是佛正在运行卸载完成后自动打开网页-代码无效 --------------------- ...

  4. Windows Service的安装卸载 和 Service控制(转)

    Windows Service的安装卸载 和 Service控制 原文地址:http://www.cnblogs.com/Peter-Zhang/archive/2011/10/15/2212663. ...

  5. 帮同事写了几行代码,在 安装/卸载 程序里 注册/卸载 OCX控件

    写了个小控制台程序,这个程序用来注册 / 卸载OCX控件,用在Inno Setup做的安装卸载程序里. #include "stdafx.h" #include <windo ...

  6. 15个Linux Yum命令实例--安装/卸载/更新

    在linux环境中, 安装, 卸载更新包是一个极为常见的操作.大部分的linux环境都提供了包的管理工具, 例如:apt-get, dpkg, rpm, yum等等. 一些Linux环境中,yum是默 ...

  7. Delphi安装/卸载OCX控件的方法

    delphi  安装卸载ocx 请参见 如下 http://blog.csdn.net/xt_chaoji/article/details/7027298 打开Delphi,关闭所有项目. 1.    ...

  8. Windows Service的安装卸载 和 Service控制

    原文 Windows Service的安装卸载 和 Service控制 本文内容包括如何通过C#代码安装Windows Service(exe文件,并非打包后的安装文件).判断Service是否存在. ...

  9. Android实训案例(六)——四大组件之一BroadcastReceiver的基本使用,拨号,短信,SD卡,开机,应用安装卸载监听

    Android实训案例(六)--四大组件之一BroadcastReceiver的基本使用,拨号,短信,SD卡,开机,应用安装卸载监听 Android中四大组件的使用时重中之重,我这个阶段也不奢望能把他 ...

  10. Linux系统Vi/Vim编辑器的简单介绍、安装/卸载、常用命令

    Linux系统Vi/Vim编辑器的简单介绍.安装/卸载.常用命令 1.介绍 vi(Visual Interface)编辑器是Linux和Unix上最基本的文本编辑器,工作在字符模式下.由于不需要图形界 ...

随机推荐

  1. 18道经典链表题刷题总结——WeetCode1 链表系列

    系列文章目录和关于我 前言: WeetCode = Week leetCode 寓意每周刷点leetCode 题目 链表是我恢复刷题手感最喜欢做的系列,其没用太多的算法思想,单纯考验对指针的理解,和c ...

  2. linux内核中的likely与unlikely

    前言 内核版本:linux 4.9.x.在linux内核中,经常可以看见if( likely(x))或if( unlikely(x))的语句,本文将基于likely和unlikely的定义和作用进行一 ...

  3. i春秋Zone

    打开网页是个简单的表单填写, 尝试注入....没用 查看源码,没找到什么有用的信息 只有抓包了 发现一个cookie的login值为0,改为1试试 没什么特别的回显,但这应该就是登录与否的判定了,所以 ...

  4. JavaEE Day01 基础加强

    今日内容 1.Junit单元测试(测试类) 2.反射 3.注解 一.Junit单元测试 1.概述 测试分类 1. 黑盒测试:不需要写代码,给输入值,看程序是否能够输出期望的值 2.白盒测试:需要写代码 ...

  5. 使用JavaScript制作一个页面的电子时钟

    题目:做一个电子时钟,显示当前的年月日,时分秒,要求自动变化. 案例分析: 1.使用一个div盒子来展示时钟的内容: 2.将盒子在JavaScrip里面获取div盒子: 3.我们需要一个定时器setI ...

  6. 《HTTP权威指南》– 5.Web服务器

    Web服务器概念: 实现了HTTP和相关的TCP连接处理,负责管理Web服务器提供的资源,以及对Web服务器的配置.控制及扩展方面的管理. 各种不同的形式: 通过软件Web服务器:运行在标准的.有网络 ...

  7. 微服务项目Git仓库自动化脚本

    说明 基于微服务项目,产生的的多项目仓库管理脚本. 目录结构 xxxx Xxx1Api/ Xxx2Api/ git_clone_api.sh git_branch_dev.sh git_pull_al ...

  8. 使用Typora写博客,图片即时上传

    背景 习惯使用markdown的人应该都知道Typora这个神器,它非常简洁高效.虽然博客园的在线markdown编辑器也不错,但毕竟是网页版,每次写东西需要登录系统-进后台-找到文章-编辑-保存草稿 ...

  9. (已转)C++知识图谱

  10. [图像处理] YUV图像处理入门1

    目前数字图像处理技术已经应用生活各个方面,但是大部分教程都是利用第三方库(如opencv)对RGB图像格式进行处理.对于YUV图像格式的图像处理教程较少.于是博主搬运总结了多个大牛的文章,总结出来这个 ...