標籤:
1. 在執行python manage.py shell之後的一些錯誤:
[email protected]:~/myobject$ python manage.py shell/usr/lib/python2.7/dist-packages/pkg_resources.py:1049: UserWarning: /home/wyl/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable). warnings.warn(msg, UserWarning)Python 2.7.8 (default, Oct 20 2014, 15:05:19) Type "copyright", "credits" or "license" for more information.IPython 2.3.0 -- An enhanced Interactive Python.? -> Introduction and overview of IPython‘s features.%quickref -> Quick reference.help -> Python‘s own help system.object? -> Details about ‘object‘, use ‘object??‘ for extra details.In [1]:
有人說是許可權問題,只要執行一下使用權限設定語句就OK了,可是我執行了一下的一句許可權語句但是還是不OK。
使用權限設定語句:
chmod g-wx,o-wx ~/.python-eggs
語句執行之後的錯誤:
[email protected]:~/myobject$ python manage.py shellPython 2.7.8 (default, Oct 20 2014, 15:05:19) Type "copyright", "credits" or "license" for more information.IPython 2.3.0 -- An enhanced Interactive Python.? -> Introduction and overview of IPython‘s features.%quickref -> Quick reference.help -> Python‘s own help system.object? -> Details about ‘object‘, use ‘object??‘ for extra details.In [1]:
錯誤確實是不一樣了。但是出現以上錯誤是什麼原因呢?
其實到這一步已經沒有錯誤了,這個只是不是python的操作介面而已,這是ipython的操作介面,而且這個比python的操作更人性化,這個還帶tab命令補全的功能,是不是很爽啊!
In [3]: frofrom frozenset In [3]: from django.django.conf django.forms django.templatetagsdjango.contrib django.http django.testdjango.core django.middleware django.utilsdjango.db django.shortcuts django.viewsdjango.dispatch django.template In [3]: from django.ddjango.db django.dispatch In [3]: from django.db import connconnection connections In [3]: from django.db import connectionIn [4]: cursor = connection.cursor()In [5]:
python manage.py shell之後的一些錯誤: