I realized why I had that problem, it's not the 'render =
web.template.render('template/', base='layout')' line. The problem
triggers when I launch the spawn-fcgi command outside the webpy-app
folder.
Regards
2010/8/26 Carlos Ríos Vera <[email protected]>:
> Well, answering to myself,
>
> I edited the line:
> render = web.template.render('template/', base='layout')
> to:
> render = web.template.render('./template/', base='layout')
>
> and it's working now =)
>
> 2010/8/26 Carlos Ríos Vera <[email protected]>:
>> Hello webpythoners,
>>
>> I'm trying to use webpy with the nginx httpd over a Debian stable
>> linux box. My configuration in nginx is this:
>>
>>
>> elsour:/etc/nginx/sites-enabled# ls
>> visualdep
>> elsour:/etc/nginx/sites-enabled# cat visualdep
>>
>> server {
>> listen 80;
>> server_name localhost;
>>
>> access_log /var/log/nginx/visualdep.access.log;
>>
>> location / {
>> root /home/lbfm/VisualDEP/src;
>> fastcgi_param REQUEST_METHOD $request_method;
>> fastcgi_param QUERY_STRING $query_string;
>> fastcgi_param CONTENT_TYPE $content_type;
>> fastcgi_param CONTENT_LENGTH $content_length;
>> fastcgi_param GATEWAY_INTERFACE CGI/1.1;
>> fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
>> fastcgi_param REMOTE_ADDR $remote_addr;
>> fastcgi_param REMOTE_PORT $remote_port;
>> fastcgi_param SERVER_ADDR $server_addr;
>> fastcgi_param SERVER_PORT $server_port;
>> fastcgi_param SERVER_NAME $server_name;
>> fastcgi_param SERVER_PROTOCOL $server_protocol;
>> fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
>> fastcgi_param PATH_INFO $fastcgi_script_name;
>> fastcgi_pass 127.0.0.1:9001;
>> fastcgi_pass_header Authorization;
>> }
>>
>> location /static/ {
>> root /home/lbfm/VisualDEP/src;
>> if (-f $request_filename){
>> rewrite ^/static/(.*)$ /static/$1 break;
>> }
>> }
>>
>>
>> error_page 500 502 503 504 /50x.html;
>> location = /50x.html {
>> root /var/www/nginx-default;
>> }
>>
>> }
>> ====================================
>>
>> I launch it via: spawn-fcgi -f /home/lbfm/VisualDEP/src/index.py -a
>> 127.0.0.1 -p 9001
>>
>> I got this error when I try to load the page via www-browser:
>>
>> /var/log/nginx/error.log:
>>
>> 2010/08/26 00:14:44 [error] 17262#0: *1 FastCGI sent in stderr:
>> "Traceback (most recent call last):
>> File "/home/lbfm/VisualDEP/src/web/application.py", line 242, in process
>> return self.handle()
>> File "/home/lbfm/VisualDEP/src/web/application.py", line 233, in handle
>> return self._delegate(fn, self.fvars, args)
>> File "/home/lbfm/VisualDEP/src/web/application.py", line 412, in _delegate
>> return handle_class(cls)
>> File "/home/lbfm/VisualDEP/src/web/application.py", line 387, in
>> handle_class
>> return tocall(*args)
>> File "/home/lbfm/VisualDEP/src/index.py", line 25, in GET
>> return render.index()
>> File "/home/lbfm/VisualDEP/src/web/template.py", line 983, in __getattr__
>> t = self._template(name)
>> File "/home/lbfm/VisualDEP/src/web/template.py", line 977, in _template
>> self._cache[name] = self._load_template(name)
>> File "/home/lbfm/VisualDEP/src/web/template.py", line 968, in _load_template
>> raise AttributeError, "No template named " + name
>> AttributeError: No template named index" while reading upstream,
>> client: 201.222.255.118, server: localhost, request: "GET / HTTP/1.1",
>> upstream: "fastcgi://127.0.0.1:9001", host: "elsour"
>>
>> ==============================
>> in index.py I have this:
>>
>> #!/usr/bin/env python
>>
>> import web
>> import os
>> import time
>>
>> import upload, results
>> import visualization
>> #import querysql
>>
>> render = web.template.render('template/', base='layout')
>>
>> urls = (
>> "/upload", upload.app_upload,
>> "/results", results.app_results,
>> "/visualization", visualization.app_visualization,
>> "/*", "index"
>> )
>>
>> app = web.application( urls, locals() )
>>
>>
>> class index:
>> def GET(self, a=None):
>> return render.index()
>>
>>
>> if __name__ == "__main__":
>> web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
>> app.run()
>>
>> ==================
>>
>> I have tested the app (deleting the 'web.wsgi.runwsgi = lambda func,
>> addr=None: web.wsgi.runfcgi(func, addr)' line and launch it via python
>> index.py) and I get everything ok, I don't get the templator error.
>>
>>
>> Any ideas?
>>
>> Thanks
>>
>>
>> --
>> http://crosvera.blogspot.com
>>
>> Carlos Ríos V.
>> Estudiante de Ing. (E) en Computación e Informática.
>> Universidad del Bío-Bío
>> VIII Región, Chile
>>
>> Linux user number 425502
>>
>
>
>
> --
> http://crosvera.blogspot.com
>
> Carlos Ríos V.
> Estudiante de Ing. (E) en Computación e Informática.
> Universidad del Bío-Bío
> VIII Región, Chile
>
> Linux user number 425502
>
--
http://crosvera.blogspot.com
Carlos Ríos V.
Estudiante de Ing. (E) en Computación e Informática.
Universidad del Bío-Bío
VIII Región, Chile
Linux user number 425502
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.