Incidencia #21280

WSGI対応

Abrir Fecha: 2010-04-04 07:04 Última actualización: 2011-03-21 15:07

Informador:
Propietario:
Estado:
Cerrado
Componente:
Hito:
(Ninguno)
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
Ninguno

Details

WSGIに対応して欲しい。

Ticket History (3/3 Histories)

2010-04-04 07:04 Updated by: okamototk
  • New Ticket "WSGI対応" created
2010-04-09 21:55 Updated by: jun66j5
Comentario

trac/admin/templates/deploy_trac.wsgi を参考に ↓ のような感じで dispatch_request を挿げ替えて...

  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Copyright (C)2008-2009 Edgewall Software
  5. # Copyright (C) 2008 Noah Kantrowitz <noah@coderanger.net>
  6. # All rights reserved.
  7. #
  8. # This software is licensed as described in the file COPYING, which
  9. # you should have received as part of this distribution. The terms
  10. # are also available at http://trac.edgewall.org/wiki/TracLicense.
  11. #
  12. # This software consists of voluntary contributions made by many
  13. # individuals. For the exact contribution history, see the revision
  14. # history and logs, available at http://trac.edgewall.org/log/.
  15. #
  16. # Author: Noah Kantrowitz <noah@coderanger.net>
  17. import os
  18. def application(environ, start_request):
  19. if not 'trac.env_path_parent_dir' in environ:
  20. environ.setdefault('trac.env_path', '${env.path}')
  21. if 'PYTHON_EGG_CACHE' in environ:
  22. os.environ['PYTHON_EGG_CACHE'] = environ['PYTHON_EGG_CACHE']
  23. elif 'trac.env_path' in environ:
  24. os.environ['PYTHON_EGG_CACHE'] = os.path.join(environ['trac.env_path'],
  25. '.egg-cache')
  26. elif 'trac.env_path_parent_dir' in environ:
  27. os.environ['PYTHON_EGG_CACHE'] = os.path.join(environ['trac.env_path_parent_dir'],
  28. '.egg-cache')
  29. from tram.main import dispatch_request
  30. return dispatch_request(environ, start_request)
あとはこのファイルを http://trac.edgewall.org/wiki/TracModWSGI の要領で設置すれば動作すると思います。

2011-03-21 15:07 Updated by: okamototk
  • Resolución Update from Ninguno to Fixed
  • Estado Update from Open to Cerrado
  • Ticket Close date is changed to 2011-03-21 15:07
Comentario

TraMのgenshi-jaブランチに追加しました(たいぶ前ですが....)。あとREADME.jaに使い方を追記しました。

Attachment File List

No attachments

Editar

Please login to add comment to this ticket » Entrar