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就换成啥就行)

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

相关推荐
大模型码小白3 小时前
【Python零基础教程】继承、多态与魔法函数:面向对象编程三大核心特性详解
java·大数据·开发语言·人工智能·python·ai编程
麻雀飞吧4 小时前
最新量化学习路径,交易认知和技术实现要并行
人工智能·python
微硬创新5 小时前
耐达讯自动化 CC-Link IE 转 PROFINET网关在污水厂智能化升级实战
人工智能·物联网·网络协议·自动化·信息与通信
C^h8 小时前
python函数学习
人工智能·python·机器学习
Fanta丶8 小时前
4.Python set()集合、dict(字典、映射)、 数据容器的通用功能
python
决战灬8 小时前
langgraph之interrupt(理论篇)
人工智能·python·agent
兜客互动8 小时前
2026年AI关键词拓展挖掘软件,高效助力内容创作精准获流
人工智能·python
weixin_538601978 小时前
智能体测开Day30pytest测试框架
python
MC皮蛋侠客8 小时前
uv 系列(七):CI/CD、Docker 与私有索引——生产级交付
python·ci/cd·docker·uv
邪神与厨二病9 小时前
牛客周赛 Round 153
python·算法