error: [Errno 88] Socket operation on non-socket

297 views
Skip to first unread message

Bubi Zemer

unread,
Jul 6, 2013, 12:35:03 PM7/6/13
to we...@googlegroups.com
I got this message once in a while, and i can't trace it back to where it comes from, or why:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/flup/server/fcgi_base.py", line 982, in _setupSocket
    sock.getpeername()
error: [Errno 88] Socket operation on non-socket

I'm using ubuntu 12 server,
web.__version__  == '0.37'
apache2, mod_cgi


Did you see this message before?
Can you advise me how to investigate it?

Thank you

Klerik

unread,
Jul 10, 2013, 2:24:33 PM7/10/13
to we...@googlegroups.com

Is possible add more arguments to base template, I have only page argument.

 

In code.py I have:

sablona = web.template.render("/home/klerik/Workspace/blog/static/", base="base")

 

In base.html I have on top:

$def with (page)

 

I need more arguments like on other templates, is it possible? If yes, give me some easy sample.

 

Thanks

 

Klerik

Tae Sandoval Murgan

unread,
Jul 10, 2013, 2:27:57 PM7/10/13
to we...@googlegroups.com
Do you mean something like:

$def with (content)
<html>
<head>
<title>$content.title</title>
</head>
<body>
$:content
</body>
</html>

? Check this: http://webpy.org/cookbook/layout_template

Scott Gelin

unread,
Jul 10, 2013, 2:33:56 PM7/10/13
to we...@googlegroups.com
I may have misunderstood the question, but If you need more variables specific to a template, you can include them in the first line of your template:

$def with (this=None, that=None, works=None)

and pass them via your render statement:
return render().templatename(additional,variables,gohere)

If you want global variables that your base template can use - (or any other template, for that matter)  check out: 


sablona = web.template.render("/home/klerik/Workspace/blog/static/", base="base", globals={'variablename':'some value'})


and $variablename will be accesible within your templates




--
You received this message because you are subscribed to the Google Groups "web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webpy+un...@googlegroups.com.
To post to this group, send email to we...@googlegroups.com.
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Klerik

unread,
Jul 10, 2013, 3:28:19 PM7/10/13
to we...@googlegroups.com

My English is a little worse, so I was wrong about the issue expressed, but even so, you helped me, and I can solve using global variables (somehow I did not realize it). Anyway, my question was whether to base the template I add another variable, as it does with other templates.
Eg. the template index to send the class Index quite a lot:

return sablona.index (seznam_zapisku, ziskej_kategorie, ziskej_datum, pages, cislo_strany)

and then in the template index have that kind of writing:

$ def with (seznam_zapisku, ziskej_kategorie, ziskej_datum, pages, cislo_strany)

It goes something like this done even with the base template?

This time it translated by google, so hopefully it will be more understanding :).

 

Klerik.

--

Klerik

Reply all
Reply to author
Forward
0 new messages