Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 5.03 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  paster serve --reload production.ini
  2. Starting subprocess with file monitor
  3. Traceback (most recent call last):
  4.   File "/usr/bin/paster", line 9, in <module>
  5.     load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
  6.   File "/usr/lib/python2.6/site-packages/paste/script/command.py", line 84, in run
  7.     invoke(command, command_name, options, args[1:])
  8.   File "/usr/lib/python2.6/site-packages/paste/script/command.py", line 123, in invoke
  9.     exit_code = runner.run(args)
  10.   File "/usr/lib/python2.6/site-packages/paste/script/command.py", line 218, in run
  11.     result = self.command()
  12.   File "/usr/lib/python2.6/site-packages/paste/script/serve.py", line 276, in command
  13.     relative_to=base, global_conf=vars)
  14.   File "/usr/lib/python2.6/site-packages/paste/script/serve.py", line 313, in loadapp
  15.     **kw)
  16.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 204, in loadapp
  17.     return loadobj(APP, uri, name=name, **kw)
  18.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 224, in loadobj
  19.     global_conf=global_conf)
  20.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 248, in loadcontext
  21.     global_conf=global_conf)
  22.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 278, in _loadconfig
  23.     return loader.get_context(object_type, name, global_conf)
  24.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 409, in get_context
  25.     section)
  26.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 431, in _context_from_use
  27.     object_type, name=use, global_conf=global_conf)
  28.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 361, in get_context
  29.     global_conf=global_conf)
  30.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 248, in loadcontext
  31.     global_conf=global_conf)
  32.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 285, in _loadegg
  33.     return loader.get_context(object_type, name, global_conf)
  34.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 561, in get_context
  35.     object_type, name=name)
  36.   File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 587, in find_egg_entry_point
  37.     possible.append((entry.load(), protocol, entry.name))
  38.   File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
  39.     entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  40.   File "/var/www/management/config/middleware.py", line 8, in <module>
  41.     from pylons.error import error_template
  42. ImportError: cannot import name error_template
  43.  
  44. And Python and Pylons version:
  45.  
  46. Python 2.6.6 (r266:84292, May  1 2012, 13:52:17)
  47. [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
  48. Type "help", "copyright", "credits" or "license" for more information.
  49. >>> import pylons
  50. >>> pylons
  51. <module 'pylons' from '/usr/lib/python2.6/site-packages/Pylons-1.0-py2.6.egg/pylons/__init__.pyc'>
  52.  
  53. The middleware.py file in /var/www/management/config/middleware.py:
  54.  
  55. """Pylons middleware initialization"""
  56. from paste.cascade import Cascade
  57. from paste.registry import RegistryManager
  58. from paste.urlparser import StaticURLParser
  59. from paste.deploy.converters import asbool
  60.  
  61. from pylons import config
  62. from pylons.error import error_template
  63. from pylons.middleware import error_mapper, ErrorDocuments, ErrorHandler, \
  64.     StaticJavascripts
  65. from pylons.wsgiapp import PylonsApp
  66.  
  67. from svnadmin.config.environment import load_environment
  68.  
  69. def make_app(global_conf, full_stack=True, **app_conf):
  70.     """Create a Pylons WSGI application and return it
  71.  
  72.     ``global_conf``
  73.         The inherited configuration for this application. Normally from
  74.         the [DEFAULT] section of the Paste ini file.
  75.  
  76.     ``full_stack``
  77.         Whether or not this application provides a full WSGI stack (by
  78.         default, meaning it handles its own exceptions and errors).
  79.         Disable full_stack when this application is "managed" by
  80.         another WSGI middleware.
  81.  
  82.     ``app_conf``
  83.         The application's local configuration. Normally specified in the
  84.         [app:<name>] section of the Paste ini file (where <name>
  85.         defaults to main).
  86.     """
  87.     # Configure the Pylons environment
  88.     load_environment(global_conf, app_conf)
  89.  
  90.     # The Pylons WSGI app
  91.     app = PylonsApp()
  92.  
  93.     # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
  94.  
  95.     if asbool(full_stack):
  96.         # Handle Python exceptions
  97.         app = ErrorHandler(app, global_conf, error_template=error_template,
  98.                            **config['pylons.errorware'])
  99.  
  100.         # Display error documents for 401, 403, 404 status codes (and
  101.         # 500 when debug is disabled)
  102.         app = ErrorDocuments(app, global_conf, mapper=error_mapper, **app_conf)
  103.  
  104.     # Establish the Registry for this application
  105.     app = RegistryManager(app)
  106.  
  107.     # Static files
  108.     javascripts_app = StaticJavascripts()
  109.     static_app = StaticURLParser(config['pylons.paths']['static_files'])
  110.     app = Cascade([static_app, javascripts_app, app])
  111.     return app