记录一下,接了一个python2 django1.x的项目,很老了导致很多扩展无法安装
os version:macos catalina python version: 2.7.18
而django后端使用sqllite以外需要对应客户端引擎,而安装时编译依赖C客户端即实际mysql组件。
使用的数据库后端。 内建的数据库后端有:
‘django.db.backends.postgresql’ ‘django.db.backends.mysql’ ‘django.db.backends.sqlite3’ ‘django.db.backends.oracle’
并且修改配置实例
text 1 2 3 4 5 6 7 8 9 10 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'USER': 'mydatabaseuser', 'NAME': 'mydatabase', 'TEST': { 'NAME': 'mytestdatabase', }, }, } brew unlink mysql
error: command ‘gcc’ failed with exit status 1 text 1 2 3 4 5 6 creating build/temp.macosx-10.9-x86_64-2.7 gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,2,5,'final',1) -D__version__=1....