Django setting.py添加app

简介: 在django创建app中,修改models.py添加对应的数据库表,后执行makemigrations Mynewsite提示: App Mynewsite could not be found.

在django创建app中,修改models.py添加对应的数据库表,后执行

makemigrations Mynewsite

提示: App Mynewsite could not be found. Is it in INSTALLED_APPS?
这时候需要在settings.py中找到INSTALLED_APPS =,添加app名
[图片上传失败...(image-6896ee-1534752078152)]

重新执行后出现:

Migrations for 'Mynewsite':
  Mynewsite\migrations\0001_initial.py:
    - Create model UserMessage

证明可以创建成功

目录
相关文章
|
12月前
|
SQL 安全 关系型数据库
一日一技:如何让Django 的app migration重新与数据库同步
一日一技:如何让Django 的app migration重新与数据库同步
127 0
|
Web App开发 索引 Python
django 一个项目多个App项目搭建
django 一个项目多个App项目搭建
2320 0
|
数据库 Python 前端开发
Django的Project和App的区别
Django的Project和App的区别
1550 0
|
Python 测试技术 数据库
第10章节-Python3.5-Django创建App 9
# 创建app python manage.py startapp cmdb python manage.py startapp openstack python manage.
1636 0
|
Python
django 添加comments app
django 添加comments app 参看 django comments 文档 安装和配置comments 1.安装comments,运行:pip install django-contrib-comments命令 2.
646 0
|
关系型数据库 PostgreSQL 数据库管理
Writing your first Django app, part 1(转)
Let’s learn by example. Throughout this tutorial, we’ll walk you through the creation of a basic poll application.
1342 0
|
SQL 关系型数据库 数据库管理
Writing your first Django app, part 1
Let’s learn by example. Throughout this tutorial, we’ll walk you through the creation of a basic poll application. It’ll consist of two parts: A public site that lets people view polls
1664 0