How to deploy the pyramid web site to the Bluehost?

170 views
Skip to first unread message

Peter

unread,
Jul 25, 2012, 9:39:51 PM7/25/12
to pylons...@googlegroups.com
I could only found that a page in bluehost tell how to deploy pylons web site on bluehost.

Here is the method:

Here is what you will need to do in summary:
  1. install python >= 2.4
  2. create a pylons development environment
  3. create a pylons project
  4. create a cgi script to run your project

add a python script in under the cgi-bin folder, the code is

#!/home/vexiterc/pylons/env/bin/python2.6

import sys
from paste.deploy import loadapp
import wsgiref.handlers

sys.path = ['/home/vexiterc/pylons/helloworld'] + sys.path

wsgi_app = loadapp('config:/home/vexiterc/pylons/helloworld/development.ini')
wsgiref.handlers.CGIHandler().run(wsgi_app)


I try the pyramid the same way, but got the error: 

Traceback (most recent call last):
  File "/usr/lib64/python2.6/wsgiref/handlers.py", line 93, in run
    self.result = application(self.environ, self.start_response)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/router.py", line 187, in __call__
    response = self.handle_request(request)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/tweens.py", line 20, in excview_tween
    response = handler(request)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid_tm-0.5-py2.6.egg
/pyramid_tm/__init__.py", line 100, in tm_tween
    response = handler(request)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/router.py", line 164, in handle_request
    response = view_callable(context, request)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/config/views.py", line 352, in rendered_view
    context)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/renderers.py", line 396, in render_view
    return self.render_to_response(response, system, request=request)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/renderers.py", line 426, in render_to_response
    result = self.render(value, system_values, request=request)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/renderers.py", line 422, in render
    result = renderer(value, system_values)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/chameleon_zpt.py", line 51, in __call__
    result = self.template(**system)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/Chameleon-2.9.2-py2.6.eg
g/chameleon/template.py", line 125, in __call__
    return self.render(**kwargs)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/Chameleon-2.9.2-py2.6.eg
g/chameleon/zpt/template.py", line 259, in render
    return super(PageTemplate, self).render(**vars)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/Chameleon-2.9.2-py2.6.eg
g/chameleon/template.py", line 190, in render
    raise_with_traceback(exc, tb)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/Chameleon-2.9.2-py2.6.eg
g/chameleon/template.py", line 172, in render
    self._render(stream, econtext, rcontext)
  File "mytemplate_3ba821d8cd01cf830ff0b49bf0c738b80ea7a1c1.py", line 152, in re
nder
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/url.py", line 586, in static_url
    return info.generate(path, self, **kw)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/config/views.py", line 1634, in generate
    return request.route_url(route_name, **kw)
  File "/home2/mywebsite/env/lib/python2.6/site-packages/pyramid-1.3.2-py2.6.egg/
pyramid/url.py", line 244, in route_url
    app_url = self.application_url
  File "build/bdist.linux-x86_64/egg/webob/request.py", line 469, in application
_url
    return self.host_url + url_quote(bscript_name, PATH_SAFE)
  File "build/bdist.linux-x86_64/egg/webob/request.py", line 458, in host_url
    url += host
TypeError: cannot concatenate 'str' and 'NoneType' objects

 - Expression: "${request.static_url('petertest:static/favicon.ico')}"
 - Filename:   ... /public_html/PeterTest/petertest/templates/mytemplate.pt
 - Location:   (8:34)
 - Source:     ... ef="${request.static_url('petertest:static/favicon.ico')}" /
...
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  repeat: {...} (0)
               renderer_name: templates/mytemplate.pt
               req: <Request - at 0x13aab50>
               request: <Request - at 0x13aab50>
               one: <MyModel - at 0x28c4390>
               project: PeterTest
               renderer_info: <RendererHelper - at 0x28ba250>
               context: <instance None at 0x27eba70>
               view: <function my_view at 0x286b0c8>
Status: 500 Dude, this is whack!
Content-Type: text/plain
Content-Length: 59

A server error occurred.  Please contact the administrator.


































Reply all
Reply to author
Forward
0 new messages