问题总结:
1.未安装django。导致执行报错:
解决办法:pip安装包即可
2.安装成功后,run manage.py文件 提示:
Type 'manage.py help <subcommand>' for help on a specific subcommand.
Available subcommands:
[django]
check
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
makemigrations
migrate
optimizemigration
runserver
sendtestemail
shell
showmigrations
sqlflush
sqlmigrate
sqlsequencereset
squashmigrations
startapp
startproject
test
testserver
Note that only Django core commands are listed as settings are not properly configured (error: No module named 'pymysql').
解决办法:Pycharm中配置好文件的执行参数
先把pymysql安装以后,继续解决配置问题
Type 'manage.py help <subcommand>' for help on a specific subcommand.
Available subcommands:
[auth]
changepassword
createsuperuser
[contenttypes]
remove_stale_contenttypes
[django]
check
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
makemigrations
migrate
optimizemigration
sendtestemail
shell
showmigrations
sqlflush
sqlmigrate
sqlsequencereset
squashmigrations
startapp
startproject
test
testserver
[sessions]
clearsessions
[staticfiles]
collectstatic
findstatic
runserver
解决办法:
https://blog.csdn.net/qq_37960324/article/details/117225993
https://blog.csdn.net/weixin_46900108/article/details/119773973
发现自己本地没有安装mysql (任务管理器里面没有mysql服务所以需要先安装一个mysql 推荐安装5.7版本的)
导致启动以后报错
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([WinError 10061] 由于目标计算机积极拒绝,无法连接。)")
The above exception was the direct cause of the following exception:
安装mqsql的时候使用下面这个教程
https://blog.csdn.net/weixin_43423484/article/details/124408565
注意保存自己的密码 ,本地没有存放data文件的需要先建一个文件目录/mysql/data什么的否则会安装报错
建好以后就可以了如下图:
描述:Windows系统cmd命令窗口无法粘贴解决的方法步骤
步骤:
按一下ESC键,即可粘贴
解决1130错误
https://blog.csdn.net/weixin_46077728/article/details/119424190
()
一直启动不起来 发现是配置里面数据库信息对不上 在setting.py 改成本地的数据库账号密码host后可以继续下一步 其他问题
You have 21 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): Mall, admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
https://blog.csdn.net/weixin_42029241/article/details/121870327
python manage.py migrate 看到一连串ok可以了继续运行