草庐IT

execute_manager

全部标签

python - 结构错误 : Fatal error: local() encountered an error (return code 2) while executing 'git commit -m ' message'

我正在尝试设置一个fabfile来部署我的Django应用。我不明白为什么会出现此错误:Fatalerror:local()encounteredanerror(returncode2)whileexecuting'gitcommit-m'changedsettingsforprodserver'$fabcreate_branch_deploy_to_prodserver[localhost]run:gitcheckoutprodserver_server[localhost]run:gitmergemaster[localhost]run:cpsettings_prodserver.

python - 找不到 manage.py collectstatic 命令,Django 1.5.1

我是python的新手,当我运行$pythonmanage.pycollectstatic命令,返回'未知命令:'collectstatic''根据我的研究发现,settings.py似乎有问题,这是我的settings.py:importosDEBUG=TrueTEMPLATE_DEBUG=DEBUGADMINS=(#('','your_email@example.com'),)MANAGERS=ADMINSDATABASES={'default':{'ENGINE':'django.db.backends.sqlite3','NAME':'basic_code.sqlite3',#

python - Pycharm manage.py 自动完成错误

我正在使用Django1.10和Pycharm2016.2.在每个Django项目中,manage.py命令都可以正常工作,但自动完成会出现以下错误:Failedtogetrealcommandsonmodule"projects_name"pythondiedwithcode1Fileopt/Pycharm/helpers/.../jb_manage_tasks_provider.pyFileopt/pycharm/helpers.../parser.pyFilemyvirtualenvfolder/lib/python3.5/sitepackages/django/core/man

python - 无法使用 python ./manage.py dumpdata app 转储数据

我在Django项目中创建了一个应用程序。出于测试目的,我想创建fixture文件。我发现我可以转储我的数据库,以便在它已经有数据的情况下自动创建fixture。我想使用fixture,所以我使用了命令python./manage.pydumpdataapp,但它返回了一个包含大量\x02的列表。但是如果我使用python./manage.pyauth它运行完美。知道为什么我的dumpdata只显示\x02。提前致谢。我附上以下链接的截图:http://www.cs.ait.ac.th/~fon/wp-content/uploads/2011/01/Screenshot.png

python - Scrapy:将参数传递给 cmdline.execute()

我知道从命令行运行scrapy蜘蛛时如何传递参数。但是,当我尝试使用scrapy的cmdline.execute()从脚本以编程方式运行它时遇到问题。我需要传递的参数是我之前格式化为字符串的列表,就像这样:numbers="one,two,three,four,five"colors="red,blue,black,yellow,pink"cmdline.execute('scrapycrawlmyspider-aarg1='+numbers+'-aarg2='+colors)蜘蛛是...classMySpider(Spider):name="myS"def__init__(self,

python - django_openid_auth TypeError openid.yadis.manager.YadisServiceManager 对象不是 JSON 可序列化的

我在我的项目中使用了django_openid_auth,它在一段时间内运行良好。但是今天,我测试了应用程序并遇到了这个异常:Environment:RequestMethod:GETRequestURL:http://localhost:7777/google/login/DjangoVersion:1.6PythonVersion:2.7.3InstalledApplications:('django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.sites

python - 为什么带有 SQL 查询参数的 psycopg2 cursor.execute() 会导致语法错误?

在Python中为psycopg2中的execute()指定参数时,像这样:cursor.execute('SELECT*FROM%s',("my_table",))我收到这个错误:psycopg2.ProgrammingError:syntaxerroratornear"'my_table'"LINE1:SELECT*FROM'my_table'我做错了什么?看起来psycopg2正在向查询添加单引号,而这些单引号导致了语法错误。如果我不使用参数,它会正常工作:cursor.execute('SELECT*FROMmy_table') 最佳答案

python - ORA-01861 : literal does not match format string when executing get model object in django

我在django中有一个模型对象,就像这样......fromdjango.dbimportmodelsclassPerson(models.Model):employee_title=models.CharField(max_length=150)pk_person_id=models.IntegerField(primary_key=True)department_name=models.CharField(max_length=240)cost_center=models.CharField(max_length=150)user_name=models.CharField(ma

python - 在 Google 应用引擎的 django-nonrel 中使用 manage.py 时出现异常 AttributeError 消息

我正在使用Python2.7和django-nonrel用于在Google应用引擎上运行Django项目。我使用的是Google应用引擎SDK的1.6版。我运行pythonmanage.pysyncdb或pythonmanage.pydeploy。命令完成后,我收到以下消息:ExceptionAttributeError:"'NoneType'objecthasnoattribute'mkstemp'"in>ignored为什么我会收到这条消息,有什么办法可以解决吗? 最佳答案 已经报道过了。参见this.显然,它不会破坏任何东西。

python - gdb.execute 阻塞 python 脚本中的所有线程

我正在使用Python2.7编写GDB脚本。我只是使用gdb.execute("stepi")执行单步执行指令。如果被调试程序处于空闲状态并等待用户交互,gdb.execute("stepi")不会返回。如果有这种情况,我想在不终止gdb的情况下停止调试session。为此,我创建了一个线程,如果当前指令运行超过x秒,该线程将终止调试进程:fromctypesimportc_ulonglong,c_boolfromosimportkillfromthreadingimportThreadfromtimeimportsleepimportsignal#Weneedmutableprimi