草庐IT

display-manager

全部标签

python - "django.db.utils.ProgrammingError: relation "app_user "does not exist"在 manage.py 测试期间

我的设置:Django1.8.3python2.7.10Ubuntu14.04django-two-factor-auth==1.2.0当我运行pythonmanage.pytest时出现以下错误:Traceback(mostrecentcalllast):File"/src/venv/bin/django-admin.py",line5,inmanagement.execute_from_command_line()File"/src/venv/lib/python2.7/site-packages/django/core/management/__init__.py",line33

python - 将 django manage.py 输出(在 Windows 中)重定向到文本文件

我正在尝试将manage.py的输出重定向到文本文件,但只有部分输出被重定向到文本文件。如何将所有输出重定向到文本文件?我的命令提示符:C:\Development\web-py\p1st2\pianos1st-system>pythonmanage.pytest>test_results.txt.....................................................................................................................------------------------------

python - 记录更改列表中的 Django-admin : How to display link to object info page instead of edit form ,?

我正在为正在处理的应用程序自定义Django-admin。所以到目前为止,定制是工作文件,添加了一些View。但我是想知道如何将change_list显示中的记录链接更改为显示信息页面而不是更改表单?!在这篇博文中:http://www.theotherblog.com/Articles/2009/06/02/extending-the-django-admin-interface/汤姆说:”您可以通过定义一个函数然后添加my_func.allow_tags=True"我没完全理解!!现在我有配置文件功能,当我点击记录列表中的成员我可以显示它(或添加另一个按钮称为-个人资料-),以及如

python - Django:覆盖 get_FOO_display()

总的来说,我不熟悉python重写方法和使用super()的方式。问题是:我可以覆盖get_FOO_display()吗?classA(models.Model):unit=models.IntegerField(choices=something)defget_unit_display(self,value):...usesuper(A,self).get_unit_display()我想覆盖get_FOO_display()因为我想使我的显示复数化。但是super(A,self).get_unit_display()不起作用。 最佳答案

python - Django:python manage.py migrate 什么都不做

我刚开始学习Django,当我尝试应用我的迁移时,第一个问题出现了。我启动服务器,输入pythonmanage.pymigrate什么也没有发生。没有错误,没有崩溃,只是没有响应。Performingsystemchecks...Systemcheckidentifiednoissues(0silenced).Youhave13unappliedmigration(s).Yourprojectmaynotworkproperlyuntilyouapplythemigrationsforapp(s):admin,auth,contenttypes,sessions.Run'pythonm

python - Django:在admin list_display中显示相关对象的数量

我想在Django的list_display属性中显示相关对象的数量。例如,我们有一个类别字段,我们想显示在该类别中发布了多少博文到目前为止我已经试过了:管理员.py:from.modelsimportCategoryclassCategoryAdmin(admin.ModelAdmin):defcategory_post_count(self,obj):returnobj.post_set.countcategory_post_count.short_description="PostsCount"list_display=['category','category_post_cou

python celery - ImportError : No module named _curses - while attempting to run manage. py celeryev

背景Windows7x64Python2.7Django1.4带Redisbundle的celery在尝试运行manage.pyceleryev时,我在终端中收到以下错误importcursesFile'c:\Python2\lib\curses\__init__.py',line15,infrom_cursesimport*ImportError:Nomodulenamed_curses我试过查看其他帖子,但未能解决这个问题。关于导致此错误的原因有什么想法吗?提前致谢。 最佳答案 根据http://docs.python.org/

python - 哪个是最pythonic : installing python modules via a package manager ( macports, apt)或通过pip/easy_install/setuptools

通常我倾向于通过包管理器安装东西,用于unixy的东西。然而,当我编写大量perl程序时,我会使用CPAN、更新版本等等。一般来说,我过去常常通过包管理器安装系统的东西,通过它自己的包管理器(gem/easy_install|pip/cpan)安装语言的东西现在主要使用python,我想知道最佳实践是什么? 最佳答案 系统python版本及其库经常被发行版中的软件使用。只要您使用的软件对与您的发行版相同的python版本和所有库感到满意,那么使用发行包就可以正常工作。然而,您经常需要软件包的开发版本,或更新版本,或旧版本。然后它就不

python - Satchmo 克隆satchmo.py ImportError : cannot import name execute_manager

我让satchmo尝试,但我在第一次尝试时遇到了一个很大的问题,我不明白哪里出了问题。当我将$pythonclonesatchmo.py制作成清晰的django项目时,它会报错:$pythonclonesatchmo.pyCreatingtheSatchmoApplicationCustomizingthefilesPerforminginitialdatasynchingTraceback(mostrecentcalllast):File"manage.py",line18,infromdjango.core.managementimportexecute_managerImport

python - Tcl 错误 : no display name and no $DISPLAY environment variable on EC2

我想在AmazonEC2(LinuxAMI)上使用iPython。我已经安装了Anaconda并启动了iPython来测试我已经创建的一些脚本。现在我只对在终端中运行它感兴趣(不是作为笔记本)。在我的代码开头,我总是这样做:importjsonimportnumpyasnpimportpandasaspdfrompandasimportSeries,DataFrame但是,我在我的文本编辑器中尝试了CTRL+C,然后在终端中使用%paste我得到了错误:TclError:nodisplaynameandno$DISPLAYenvironmentvariable如果我按照这个建议尝试ss