pycharm运行django出错 15
pycharm中建立django工程,然后运行其中任意文件,提示Youhaveunappliedmigrations;yourappmaynotworkproperlyu...
pycharm 中建立django工程,然后运行其中任意文件,提示
You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
(可以打开localhost的网页,网页显示:‘
It worked!
Congratulations on your first Django-powered page.
Of course, you haven't actually done any work yet. Next, start your first app by running python manage.py startapp [app_label].
You're seeing this message because you have DEBUG = True in your Django settings file and you haven't configured any URLs. Get to work!
’)
请问这个是在cmd命令中使用吗?(我在cmd中试用了一下:)
我是python3(python2.7也试用了)
然后在cmd中(进入到了python文件目录)输入'python manage.py migrate'
提示:invalid syntax
请问这个如何解决? 展开
You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
(可以打开localhost的网页,网页显示:‘
It worked!
Congratulations on your first Django-powered page.
Of course, you haven't actually done any work yet. Next, start your first app by running python manage.py startapp [app_label].
You're seeing this message because you have DEBUG = True in your Django settings file and you haven't configured any URLs. Get to work!
’)
请问这个是在cmd命令中使用吗?(我在cmd中试用了一下:)
我是python3(python2.7也试用了)
然后在cmd中(进入到了python文件目录)输入'python manage.py migrate'
提示:invalid syntax
请问这个如何解决? 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏15(财富值+成长值)
1个回答
展开全部
首先你打开localhost的提示是正常,说明你搭建django是成功了,只是你没有创建任何app,或者你创建了app但是没有同步到数据库(python manage.py makemigratons,python manage.py migrate,这两个命令必须在django1.7以上版本),如果你还没有任何app也可以执行,会创建内置的用户系统,等等。可以到localhost:8000/admin查看是否创建成功。
初始化数据库时会咨询你是否创建超级用户(即管理员)
然后python manage.py migrate并不是在python文件目录执行,而是到你创建django项目中执行,找到manage.py 这个文件的路径
初始化数据库时会咨询你是否创建超级用户(即管理员)
然后python manage.py migrate并不是在python文件目录执行,而是到你创建django项目中执行,找到manage.py 这个文件的路径
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询