草庐IT

Optimizer-Settings

全部标签

python - 安装 Graphite 时出现 Django 错误 - settings.DATABASES 配置不正确。请提供 ENGINE 值

我正在尝试在ubuntu上安装GRAPHITE。我按照博客中的说明进行操作。http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/当我到达运行命令的部分时..我收到以下错误。我对如何解决零线索。我使用的是最新版本的Django1.4。cd/opt/graphite/webapp/graphite/sudopythonmanage.pysyncdbsudopythonmanage.pysyncdb/opt/graphite/webapp/graphite/thirdparty/pytz/__init_

python - 安装 Graphite 时出现 Django 错误 - settings.DATABASES 配置不正确。请提供 ENGINE 值

我正在尝试在ubuntu上安装GRAPHITE。我按照博客中的说明进行操作。http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/当我到达运行命令的部分时..我收到以下错误。我对如何解决零线索。我使用的是最新版本的Django1.4。cd/opt/graphite/webapp/graphite/sudopythonmanage.pysyncdbsudopythonmanage.pysyncdb/opt/graphite/webapp/graphite/thirdparty/pytz/__init_

python - 如何在Pyramid应用程序启动期间获取Registry()。settings?

我习惯于在Django和gunicorn上开发Web应用程序。如果是Django,则Django应用程序中的任何应用程序模块都可以通过django.conf.settings获得部署设置。“settings.py”是用Python编写的,因此可以动态定义任意定义和预处理。在使用gunicorn的情况下,它具有按优先级排列的三个配置位置,并且一个设置注册表类实例将这些位置组合在一起(但通常这些设置仅用于gunicorn而不是应用程序。)命令行参数。配置文件。(例如Django,用可以具有任意任意值的Python设置动态。)Paster应用程序设置。对于Pyramid,根据Pyramid文

python - 如何在Pyramid应用程序启动期间获取Registry()。settings?

我习惯于在Django和gunicorn上开发Web应用程序。如果是Django,则Django应用程序中的任何应用程序模块都可以通过django.conf.settings获得部署设置。“settings.py”是用Python编写的,因此可以动态定义任意定义和预处理。在使用gunicorn的情况下,它具有按优先级排列的三个配置位置,并且一个设置注册表类实例将这些位置组合在一起(但通常这些设置仅用于gunicorn而不是应用程序。)命令行参数。配置文件。(例如Django,用可以具有任意任意值的Python设置动态。)Paster应用程序设置。对于Pyramid,根据Pyramid文

python - 如何停止收到 ImportError : Could not import settings 'mofin.settings' when using django with wsgi?

我无法让wsgi导入我的项目“mofin”的设置文件。apache错误日志中的错误列表如下mod_wsgi(pid=4001):ExceptionoccurredwithinWSGIscript'/var/www/wsgi-scripts/django.wsgi'.Traceback(mostrecentcalllast):File"/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py",line228,in__call__self.load_middleware()File"/usr/lib/python2.5/s

python - 如何停止收到 ImportError : Could not import settings 'mofin.settings' when using django with wsgi?

我无法让wsgi导入我的项目“mofin”的设置文件。apache错误日志中的错误列表如下mod_wsgi(pid=4001):ExceptionoccurredwithinWSGIscript'/var/www/wsgi-scripts/django.wsgi'.Traceback(mostrecentcalllast):File"/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py",line228,in__call__self.load_middleware()File"/usr/lib/python2.5/s

python - Django 使用 get_user_model 与 settings.AUTH_USER_MODEL

阅读Django文档:get_user_model()InsteadofreferringtoUserdirectly,youshouldreferencetheusermodelusingdjango.contrib.auth.get_user_model().ThismethodwillreturnthecurrentlyactiveUsermodel–thecustomUsermodelifoneisspecified,orUserotherwise.Whenyoudefineaforeignkeyormany-to-manyrelationstotheUsermodel,you

python - Django 使用 get_user_model 与 settings.AUTH_USER_MODEL

阅读Django文档:get_user_model()InsteadofreferringtoUserdirectly,youshouldreferencetheusermodelusingdjango.contrib.auth.get_user_model().ThismethodwillreturnthecurrentlyactiveUsermodel–thecustomUsermodelifoneisspecified,orUserotherwise.Whenyoudefineaforeignkeyormany-to-manyrelationstotheUsermodel,you

python - 使用 "settings"模块创建常量?

我对Python比较陌生。我希望创建一个“设置”模块,用于存储各种特定于应用程序的常量。这是我想要设置我的代码的方式:settings.pyCONSTANT='value'脚本.pyimportsettingsdeffunc():var=CONSTANT#dosomemorecodingreturnvar我收到一条Python错误说明:globalname'CONSTANT'isnotdefined.我注意到在Django的源代码中,他们的settings.py文件中的常量名称和我一样。我对如何将它们导入脚本并通过应用程序引用感到困惑。编辑感谢您的所有回答!我尝试了以下方法:impor

python - 使用 "settings"模块创建常量?

我对Python比较陌生。我希望创建一个“设置”模块,用于存储各种特定于应用程序的常量。这是我想要设置我的代码的方式:settings.pyCONSTANT='value'脚本.pyimportsettingsdeffunc():var=CONSTANT#dosomemorecodingreturnvar我收到一条Python错误说明:globalname'CONSTANT'isnotdefined.我注意到在Django的源代码中,他们的settings.py文件中的常量名称和我一样。我对如何将它们导入脚本并通过应用程序引用感到困惑。编辑感谢您的所有回答!我尝试了以下方法:impor