DEV Community

Too Leng
Too Leng

Posted on

django

应用中的文件说明如下:

learn/admin.py 用于控制后台管理的文件,在后面的实验中会用到。
learn/apps.py 用于管理应用本身的文件,包括应用的名字如何命名,默认就是 learn 。
learn/init.py 空文件,前面已经介绍过。
learn/migrations 这是用于记录数据库变更信息的目录,Django 中自带的数据库版本控制功能就体现在这个目录,在学习数据存储时会详细介绍。
learn/models.py 创建映射类的文件,熟悉 Flask 的同学一定不陌生。
learn/tests.py 编写测试代码的文件。
learn/views.py 创建视图函数的文件,视图函数用于处理客户端发来的请求。
source dj2.2.9/bin/activate
python3 manage.py runserver 0:8080

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay