阿里云蛋疼的pip

qq20161103-1

阿里云的主机确实蛋疼,连pip都更新不了也是醉了。参考这个帖子的办法,修改更新服务器吧:

 
mkdir ~/.pip
cat > ~/.pip/pip.conf < < EOF
[global]
trusted-host=mirrors.aliyun.com
index-url=http://mirrors.aliyun.com/pypi/simple/
EOF

Apache2 Django {“detail”:”Authentication credentials were not provided.”}

其实项目已经是很久之前就完成了,部署到服务器上去之后后续的工作由于懒散一致没做,近几天开始进行重新继续项目之后发现一个很蛋疼的问题,在iOS端提交数据的时候提示:

{“detail”:”Authentication credentials were not provided.”},搜索之后发现原来是mod_wsgi转发数据的时候将authorization header 去掉了,所以会导致认证失败。可以参考链接:

http://stackoverflow.com/questions/26906630/django-rest-framework-authentication-credentials-were-not-provided

修复也很简单,修改/etc/apache2/apache2.conf文件添加如下一行即可:

WSGIPassAuthorization On

Ubuntu 14.04 Pycharm 桌面快捷方式

QQ截图20160331152917

网上关于ubuntu安装pycharm的文章最后的桌面图标的创建都千篇一律,可能很多人压根都没试试到底能不能用。这里贴个能用的图标代码:

 

#!/usr/bin/env xdg-open

[Desktop Entry]
Categories=Development;
Comment[zh_CN]=
Comment=
Exec=/home/obaby/soft/pycharm-2016.1/bin/pycharm.sh %f
GenericName[zh_CN]=IDE
GenericName=IDE
Icon=/home/obaby/soft/pycharm-2016.1/bin/pycharm.png
MimeType=
Name[zh_CN]=PyCharm
Name=PyCharm
Path=
StartupNotify=true
Terminal=false
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=obaby

JetBrains License Server (PyCharm5)

QQ截图20160330160643
Server Address:

http://jetbrains-1.h4ck.ws:8888
http://jetbrains-2.h4ck.ws:8888

Compatible Products (all versions):

IntelliJ IDEA – https://www.jetbrains.com/idea
PhpStorm – https://www.jetbrains.com/phpstorm
PyCharm – https://www.jetbrains.com/pycharm
RubyMine – https://www.jetbrains.com/ruby
WebStorm – https://www.jetbrains.com/webstorm
AppCode – https://www.jetbrains.com/objc
CLion – https://www.jetbrains.com/clion
DataGrip – https://www.jetbrains.com/datagrip

Continue Reading