Big Sur更新后的一些麻烦
我使用Django 2.1.15和Python 3.8
根据帖子和文档,我安装了连接器
brew install mysql-connector-c 和
pip install mysql-python 安装mysql之后
brew install mysql 和客户端
pip install mysqlclient 尝试运行django,我得到这个错误:
django.db.utils.OperationalError: (2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 54")这是我的setting.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'BATABASE',
'USER': 'sa',
'PASSWORD': 'password',
'HOST': '192.168.1.10',
'PORT': '1433',
}
}发布于 2021-03-07 14:31:02
你可以试试这个https://github.com/imagineai/create-django-app
npm安装-g imagine && imagine创建-f django -n myapp
它将自动检测您的Python版本并安装适当的依赖项。您还可以在im文件中选择所需的数据库。
https://stackoverflow.com/questions/66513822
复制相似问题