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

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

相关推荐
free-elcmacom8 小时前
深度学习<4>高效模型架构与优化器的“效率革命”
人工智能·python·深度学习·机器学习·架构
liliangcsdn8 小时前
python模拟beam search优化LLM输出过程
人工智能·python
逆风水手9 小时前
Ansible自动化运维入门指南
linux·运维·自动化·ansible
天空属于哈夫克39 小时前
外部群公告的动态更新算法
自动化·企业微信·api·rpa
王琦03189 小时前
Python 函数详解
开发语言·python
胡伯来了9 小时前
13. Python打包工具- setuptools
开发语言·python
小鸡吃米…9 小时前
Python 中的多层继承
开发语言·python
中國移动丶移不动10 小时前
Python MySQL 数据库操作完整示例
数据库·python·mysql
落叶,听雪10 小时前
AI建站推荐
大数据·人工智能·python
ZAz_10 小时前
DAY 45 预训练模型
python