深度阅读

How to create a new Django app within a project?

作者
作者
2023年08月22日
更新时间
6.48 分钟
阅读时间
0
阅读量

To create a new Django app within a project, you can use the following command in the terminal, where “myapp” is the name of the new app you want to create:

python manage.py startapp myapp

This will create a directory called “myapp” within your Django project directory, with the necessary files and directories for a new Django app. You can then start adding functionality to the new app by editing the files within the directory. Don’t forget to add the new app to the INSTALLED_APPS list in your project’s settings.py file, so that Django knows to include it in the project.

INSTALLED_APPS = [
    #...
    'myapp',
]

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。