5.安装&卸载子应用 投票
另起一个新的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.
- urls.py
- 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.安装&卸载子应用 投票的更多相关文章
- WPF 自己动手来做安装卸载程序
原文:WPF 自己动手来做安装卸载程序 前言 说起安装程序,这也许是大家比较遗忘的部分,那么做C/S是小伙伴们,难道你们的程序真的不需要一个炫酷的安装程序么? 声明在先 本文旨在教大家以自己的方式实现 ...
- Apache源码包安装和子配置文件介绍--update.2014-12-5
安装apache: 官网:http://httpd.apache.org/download.cgi#apache24 1.wget http://mirror.bit.edu.cn/apache//h ...
- inno安装卸载时检测程序是否正在运行卸载完成后自动打开网页-代码无效
inno安装卸载时检测程序是否正在运行卸载完成后自动打开网页-代码无效 inno setup 安装卸载时检测程序是佛正在运行卸载完成后自动打开网页-代码无效 --------------------- ...
- Windows Service的安装卸载 和 Service控制(转)
Windows Service的安装卸载 和 Service控制 原文地址:http://www.cnblogs.com/Peter-Zhang/archive/2011/10/15/2212663. ...
- 帮同事写了几行代码,在 安装/卸载 程序里 注册/卸载 OCX控件
写了个小控制台程序,这个程序用来注册 / 卸载OCX控件,用在Inno Setup做的安装卸载程序里. #include "stdafx.h" #include <windo ...
- 15个Linux Yum命令实例--安装/卸载/更新
在linux环境中, 安装, 卸载更新包是一个极为常见的操作.大部分的linux环境都提供了包的管理工具, 例如:apt-get, dpkg, rpm, yum等等. 一些Linux环境中,yum是默 ...
- Delphi安装/卸载OCX控件的方法
delphi 安装卸载ocx 请参见 如下 http://blog.csdn.net/xt_chaoji/article/details/7027298 打开Delphi,关闭所有项目. 1. ...
- Windows Service的安装卸载 和 Service控制
原文 Windows Service的安装卸载 和 Service控制 本文内容包括如何通过C#代码安装Windows Service(exe文件,并非打包后的安装文件).判断Service是否存在. ...
- Android实训案例(六)——四大组件之一BroadcastReceiver的基本使用,拨号,短信,SD卡,开机,应用安装卸载监听
Android实训案例(六)--四大组件之一BroadcastReceiver的基本使用,拨号,短信,SD卡,开机,应用安装卸载监听 Android中四大组件的使用时重中之重,我这个阶段也不奢望能把他 ...
- Linux系统Vi/Vim编辑器的简单介绍、安装/卸载、常用命令
Linux系统Vi/Vim编辑器的简单介绍.安装/卸载.常用命令 1.介绍 vi(Visual Interface)编辑器是Linux和Unix上最基本的文本编辑器,工作在字符模式下.由于不需要图形界 ...
随机推荐
- Centos7 mysql网络源安装范例(其他系统也可参考)
1. 以下是一个通配的el7系列的yum源,可适应aarch64,x86_64,i386内核,但是可能会慢一点 # cat > /etc/yum.repos.d/mysql-community. ...
- 关于linux mint(nemo)添加右键菜单修改方法
前言 其实在 linux mint 桌面上右键弹出的菜单,以及在资源管理器 nemo 中右键菜单,这些都是基于 nemo,进行的操作,所以更改右键菜单也就是更改nemo的配置文件 操作 在目录 /ho ...
- x=x+=x-=x-x;
int x=10; x=x+=x-=x-x; // x=x+(x-(x-x)) System.out.println(x); 输出结果20
- 第二十六节:urllib、requests、selenium请求库代理设置
1.urllib代理设置 1 from urllib.error import URLError 2 from urllib.request import ProxyHandler 3 from ur ...
- 【Shell案例】【打印指定行用sed、for循环、head和tail配合使用】4、输出第5行的内容
描述写一个 bash脚本以输出一个文本文件 nowcoder.txt 中第5行的内容. 示例:假设 nowcoder.txt 内容如下:welcometonowcoderthisisshellcode ...
- 【离线数仓】Day02-用户行为数据仓库:分层介绍、环境搭建(hive、tez)、LZO压缩、建表查询导入加索引、编写脚本
一.数仓分层概念 1.为什么要分层 ODS:原始数据层 DWD层:明细数据层 DWS:服务数据层 ADS:数据应用层 2.数仓分层 3.数据集市与数据仓库概念 4.数仓命名规范 ODS层命名为odsD ...
- 输出图形字符的命令 banner
输出图形字符的命令 banner 有趣的 Linux 命令.来自实验楼操作系统课程 安装 sudo apt install sysvbanner 截图 其他 还有两个类似的命令toilet,figle ...
- Linux开发板连接WPA加密的AP路由器
Linux目前有两种方法配置网络: wireless-tools wpa_supplicant iw支持的驱动较多,但只支持WEP加密:wpa_supplicant有部分驱动支持不完善,但支持WEP. ...
- Django路由层之路由分发 名称空间 虚拟环境 视图层之三板斧 JsonRsponse对象 request对象获取文件 FBV与CBV CBV源码剖析 模板层
目录 路由层之路由分发 路由层之名称空间 方式1:名称空间 方式2:别名不冲突即可 虚拟环境 pycharm创建虚拟环境 命令行形式创建虚拟环境 视图层之三板斧 HttpRsponse render ...
- 德摩根定律的证明 De Morgan's law
De Morgan's Laws Lemma 1: \((\bigcup_n S_n)^c=\bigcap_n S_n^c\) Proof for Lemma 1: \[\because \foral ...