python之自动化(django)

1、安装

我用的是pip install Django 在命令行中安装

然后django-admin startproject autotext(在命令行中)

这句话是创建一个django 项目

然后切换到你所创建项目的目录下

输入:

python manage.py runserver

当你出现以下错误时

You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.

Run 'python manage.py migrate' to apply them.

输入:

python manage.py migrate

当你出现语言类错误输入:

set PYTHONIOENCODING=utf-8

出现以下东西证明你的django安装完成:

Watching for file changes with StatReloader

Performing system checks...

System check identified no issues (0 silenced).

March 13, 2024 - 18:41:38

然后你需要在命令行输入:

python manage.py createsuperuser

来创建一个最高权限的超级用户.

最后你可以使用浏览器来进入django

http://127.0.0.1:8000/admin(你的超级用户叫啥那么admin就换成啥就行)

后面的下次再讲反正不少。

相关推荐
workflower1 小时前
时序数据获取事件
开发语言·人工智能·python·深度学习·机器学习·结对编程
C++业余爱好者2 小时前
Java 提供了8种基本数据类型及封装类型介绍
java·开发语言·python
AI Echoes3 小时前
构建一个LangChain RAG应用
数据库·python·langchain·prompt·agent
派大鑫wink4 小时前
从零到精通:Python 系统学习指南(附实战与资源)
开发语言·python
小小测试开发4 小时前
提升App UI自动化性能与效率:从脚本到架构的全链路优化指南
ui·架构·自动化
c骑着乌龟追兔子4 小时前
Day 38 官方文档的阅读
python
課代表4 小时前
bat 批处理从文本文件自动创建文件夹
自动化·脚本·bat·批处理·txt·文件编码·文件夹创建
羸弱的穷酸书生4 小时前
国网 i1协议 python实现
开发语言·python
weixin_462022354 小时前
RAW-Adapter: Adapting Pre-trained Visual Model to Camera RAW Images
python·计算机视觉
电子硬件笔记4 小时前
Python语言编程导论第三章 编写程序
开发语言·python·编辑器