# Socket module helper for socket(2) _socket socketmodule.c # Socket module helper for SSL support; you must comment out the other # socket line above, and possibly edit the SSL variable: #SSL=/usr/local/ssl _ssl _ssl.c \ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ -L$(SSL)/lib -lssl -lcrypto
之后就进行一系列的更新就行了
问题三: 升级过python后pip安装的命令无法在命令行使用
解决办法 把升级过的python目录加入PATH中
问题四: vagrant目录中创建虚拟环境出错 提示
Traceback (most recent call last): File "/usr/local/python3/bin/virtualenv", line 11, in <module> sys.exit(main()) File "/usr/local/python3/lib/python3.6/site-packages/virtualenv.py", line 712, in main symlink=options.symlink) File "/usr/local/python3/lib/python3.6/site-packages/virtualenv.py", line 927, in create_e nvironment site_packages=site_packages, clear=clear, symlink=symlink)) File "/usr/local/python3/lib/python3.6/site-packages/virtualenv.py", line 1389, in install _python os.symlink(py_executable_base, full_pth) OSError: [Errno 71] Protocol error: 'python' -> '/vagrant/devops/venv/bin/python3'
解决办法 虚拟环境在vagrant中的bug,加入–always-copy参数运行即可成功创建
This error can be fixed if you createthe virtual env outside the /vagrant/ shared folder...
If go tothe home folderof your vagrant user, you can createthe virtualenv in there without this problem!
Just the venv must be out of this /vagrant/ directory... after that you can go work as usually activating this venv and working with your sorce code inthe usual /vagrat/ shared dir.
问题六:UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 8-11: ordinal not in range(128)
解决方法 字符集问题,在程序开头加上:
reload(sys) sys.setdefaultencoding( "utf-8" )
指定字符集即可解决。
问题七:在IDE的命令行下提示django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
if __name__ == '__main__': dir = os.path.dirname(os.path.abspath(__file__)) dir = os.path.join(dir, 'db') sys.path.insert(0, dir) settings_path = 'db.settings' os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_path) django.setup()
之后就可以导入models操作数据库。
问题十:ERROR in ./node_modules/_element-ui@2.4.2@element-ui/lib/theme-chalk/fonts/element-icons.ttf
问题描述
ERROR in ./node_modules/_element-ui@2.4.2@element-ui/lib/theme-chalk/fonts/element-icons.ttf Module parse failed: Unexpected character ' ' (1:0) You may need an appropriate loader to handle thisfile type. (Source code omitted forthis binary file) @ ./node_modules/_css-loader@0.28.11@css-loader!./node_modules/_element-ui@2.4.2@element-ui/lib/theme-chalk/index.css 7:411-447 @ ./node_modules/_element-ui@2.4.2@element-ui/lib/theme-chalk/index.css @ ./src/main.js @ multi ./node_modules/_webpack-dev-server@2.11.2@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
auth.User.groups: (fields.E304) Reverse accessor for ‘User.groups’ clashes withreverse accessor for ‘User.groups’. HINT: Addor change a related_name argument to the definition for ‘User.groups’ or ‘User.groups’. auth.User.user_permissions: (fields.E304) Reverse accessor for ‘User.user_permissions’ clashes withreverse accessor for ‘User.user_permissions’. HINT: Addor change a related_name argument to the definition for ‘User.user_permissions’ or ‘User.user_permissions’. users.User.groups: (fields.E304) Reverse accessor for ‘User.groups’ clashes withreverse accessor for ‘User.groups’. HINT: Addor change a related_name argument to the definition for ‘User.groups’ or ‘User.groups’. users.User.head_url: (fields.E210) Cannot use ImageField because Pillow isnot installed. HINT: Get Pillow at https://pypi.python.org/pypi/Pillow or run command “pip install Pillow”. users.User.user_permissions: (fields.E304) Reverse accessor for ‘User.user_permissions’ clashes withreverse accessor for ‘User.user_permissions’. HINT: Addor change a related_name argument to the definition for ‘User.user_permissions’ or ‘User.user_permissions’.
问题十四:Django执行manage.py migrate无效,提示No migrations to apply.
问题描述 已有的model,修改之后,想重新建模,于是将migrations文件夹中除__init__.py之外其他文件都删掉,再次执行以下步骤python manage.py makemigrations确认成功,执行python manage.py migrate,提示No migrations to apply. 表示一脸懵逼。
解决办法 造成多次应用migrations失败的原因是,当前model是修改过的,原来的migrations已经被我删除,但是,重新生成的migrations使用递增整数记名,所以,在django_migrations表中0001,0002等前面几个数字的文件都已被记录,在Django看来,被记录了就相当于已应用,所以,会出现刚开始的No migrations to apply.到数据库中删除相应记录和对应migration文件即可。即:
第一步:
删除该app名字下的migrations下的__init__.py等文件。
第二步:
进入数据库,找到django_migrations的表,删除该app名字的所有记录。
第三步:执行下面这两条命令:(在项目目录下)
python manage.py makemigrations
python manage.py migrate
问题十五:celery + redis执行异步任务时报错 AttributeError: ‘unicode’ object has no attribute ‘iteritems’
问题十七 修改过Django默认user模型后提示:django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'.
解决方法 Since you are using a custom User model, your can first comment out 一旦你使用自定义的用户模型,你可以首先在INSTALL_APPS注释: