Articles of django

centos:无法写入whoosh索引

在这里遇到了问题。 在我的开发服务器中,当我尝试使用django / haystack和whoosh后端引擎进行search时,遇到了一个问题。 The path to your Whoosh index '/home/foo/bar/whoosh/index' is not writable for the current user/group. 嗯,这似乎是一个明显的权限问题,但是当我检查我的文件夹 drwxrwxr-x 2 foodball django 4096 Apr 27 03:17 index 这似乎是正确的,因为用户apache被添加到组django 。 我可以知道什么似乎是问题,是apache不是用户进程正在运行?

cx_Oracle – InterfaceError:无法获取Oracle环境句柄

我已经在Ubuntu 12.04上使用uWSGI在NGINX之后安装了Django。 我使用Postgresql作为应用程序的主数据库,但是我需要从Oracle数据库中检索一些数据。 我已成功安装了Instant Client和cx_Oracle,并且可以从命令行脚本和./manage.py shell中成功连接和查询Oracle数据库。 但是,当我通过uwsgi运行应用程序时,我收到以下错误: InterfaceError: Unable to acquire Oracle environment handle 我感到困惑,因为当我检查ORACLE_HOME和LD_LIBRARY_PATH它们是正确的,并在当时的环境可用。 另外,我正在使用instantclient版本11.2.0.3.0查询Oracle 10g数据库。 我已经在网上查了很多提议的解决scheme,但似乎没有任何工作在我的情况。 有人有什么我可以尝试下一步的指针? 非常感谢。

将django项目从mod_python迁移到mod_wsgi时,Apache conf会发生变化

不知道这是否是正确的地方问这个问题,但我正在从mod_python到mod_wsgi的django项目迁移,我想确保我有我的Apacheconfiguration正确。 旧的configuration如下所示: DocumentRoot /srv/www/PROJECT/ <location "/"> Options +FollowSymLinks allow from all SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE PROJECT.settings PythonPath "['/srv/www/PROJECT'] + sys.path" PythonDebug On PythonInterpreter PROJECT </location> <location "/site_media/"> Options +FollowSymLinks SetHandler None </location> <location "/admin_media/"> Options +FollowSymLinks SetHandler None </location> <Location "/server-status"> SetHandler server-status Allow from .test.org localhost 127.0.0.1 </Location> 阅读文档,似乎所有我必须做的是: WSGIDaemonProcess PROJECT processes=2 […]

Apache / mod_wsgi / Django找不到MySQL共享库

我一直坚持在Apache / mod_wsgi / Django部署的服务器上找不到MySQL库的情况,尽pipePython本身可以正确导入库。 这是我的Apache日志错误: [Tue Jul 10 12:52:02 2012] [error] [client 127.0.0.1] File "/remote/projects1/pdrtke/python/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/utils/importlib.py", line 35, in import_module [Tue Jul 10 12:52:02 2012] [error] [client 127.0.0.1] __import__(name) [Tue Jul 10 12:52:02 2012] [error] [client 127.0.0.1] File "/remote/projects1/pdrtke/python/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/db/backends/mysql/base.py", line 14, in <module> [Tue Jul 10 12:52:02 2012] [error] [client 127.0.0.1] raise ImproperlyConfigured("Error loading MySQLdb […]

gentoo上的lighttpd + django 10秒钟来回答

我想在gentoo机器上用fastcgi在lighttpd上运行Django站点。 每次我尝试访问该网站时,我都会在10秒左右之后得到回应。 我使用套接字让lighttpd与我的Django站点通信,但一个TCP端口也没有帮助。 这可能是一个lighttpd问题? 我试图从互联网服务器以及从localost,这是lighttpd给我在error.log 2012-07-10 14:36:36: (response.c.300) — splitting Request-URI 2012-07-10 14:36:36: (response.c.301) Request-URI : / 2012-07-10 14:36:36: (response.c.302) URI-scheme : http 2012-07-10 14:36:36: (response.c.303) URI-authority: owntube 2012-07-10 14:36:36: (response.c.304) URI-path : / 2012-07-10 14:36:36: (response.c.305) URI-query : 2012-07-10 14:36:36: (response.c.300) — splitting Request-URI 2012-07-10 14:36:36: (response.c.301) Request-URI : /owntube.fcgi/ 2012-07-10 14:36:36: (response.c.302) URI-scheme […]

我怎样才能让Pinax的OpenID与NAT协同工作?

我在NAT后部署了一个Pinax gunicorn部署,向外的Apache服务器向gunicorn服务器做ReverseProxy。 总的来说,它运作良好,但是当我尝试使用OpenIDlogin时,出现错误: Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request POST /openid/register/. Reason: Error reading from remote server 我怎样才能让Pinax与NAT合作?

用Python“pip”安装时出错:无法获取索引基URL http://

我正在尝试安装本地版本的ScrumDo进行testing。 只有在我的安装中,我必须运行: 源bin /激活 pip install -r requirements.txt 我得到的错误: 下载/解压django-storages 无法获取索引库urlhttp://b.pypi.python.org/simple/ 无法find满足django-storages要求的任何下载 根本没有发现django-storages的分布 存储完整的日志./pip-log.txt 我GOOGLE了一下,search这里和堆栈溢出,发现我应该添加一个–proxy =选项和/或取消设置我的http_proxy环境variables。 然而,我的安装没有代理,环境var没有设置。 我试过跑步 pip install -r requirements.txt –proxy = 然而,错误仍然是一样的。 我还创build了一个/root/.pip/pip.conf,其中包含: [全球] index-url = http://b.pypi.python.org/simple 并检查它的服务器实际上在线,如果包Django-Storages存在,这是真实的。 我尝试过的最后一件事,因为ScrumDo的安装文档如此说: pip安装-U Django == 1.1.4 再次没有成功…错误总是保持不变,任何人有任何想法? 我的pip-error.log显示以下内容(该URL在同一networking中的另一台机器上的firefox中也可以使用,不需要代理): /var/www/ScrumDo/pinax-env/bin/pip run on Mon Jul 30 10:24:08 2012 proxy): Downloading/unpacking Django==1.1.4 proxy): Getting page http://b.pypi.python.org/simple/Django proxy): Could […]

获取“403访问被拒绝”错误,而不是服务文件(使用django,gunicorn nginx)

获取“403访问被拒绝”错误,而不是服务文件(使用django,gunicorn nginx) 我正在尝试使用nginx从django提供私人文件。 对于X-Access-Redirect设置,我遵循以下指南 http://www.chicagodjango.com/blog/permission-based-file-serving/ 这是我的网站configuration文件(/ etc / nginx / site-available / sitename): server { listen 80; listen 443 default_server ssl; server_name localhost; client_max_body_size 50M; ssl_certificate /home/user/site.crt; ssl_certificate_key /home/user/site.key; access_log /home/user/nginx/access.log; error_log /home/user/nginx/error.log; location / { access_log /home/user/gunicorn/access.log; error_log /home/user/gunicorn/error.log; alias /path_to/app; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme […]

是否可以在Webfaction中部署elasticsearch?

我想在Webfaction服务器上部署elasticsearch (ES)。 我有256MB的内存,并运行一个大约100MB的Django应用程序。 我需要索引约10,000条logging。 是否有可能在大约128MB内存的池中运行ES?

在一个主机上部署多个django实例

我想在lighttpd的一个主机上设置多个Django实例。 我的问题是让Djangos FCGI在由我的Web服务器提供的子目录上工作。 所以我的目标是: www.myhost.org/django0 – > localhost:3000上的django1.fcgi www.myhost.org/django1 – > localhost:3001上的django2.fcgi www.myhost.org/django2 – > localhost:3002上的django3.fcgi 不幸的是,下面的configuration甚至不适用于一个: $HTTP["url"] =~ "^/django0/static($|/)" { server.document-root = "/home/django0/django/static/" } $HTTP["url"] =~ "^/django0/media($|/)" { server.document-root = "/usr/lib/python2.7/dist-packages/django/contrib/admin/media/" } $HTTP["url"] =~ "^/django0($|/)" { proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "3001", "check-local" => "disable", ) ) […]