simple progs using web.py run on 1 system, but fail on another system

57 views
Skip to first unread message

arthur sherman

unread,
May 15, 2015, 5:21:45 AM5/15/15
to we...@googlegroups.com
i have a few simple python progs which run nicely on 1 system, but fail on another system w/ the error:

No template named formtest.

both systems are debian based, both running python 2.7.x.
specifically, the (works:doesn't work)- (Ubuntu 13.10: Debian 7  )  (python 2.7.5+:  python 2.7.3 )
permissions for the prog and the web tree are identical on both systems.
the program runs on each system by a user w/ the same privs.

i hope this is something simple i'm overlooking.
any ideas?
tnx,
ams

here's an example of a program that runs on 1 sys and fails on the other:

#!/usr/bin/env python
# scanip.py 
import web
from web import form

render = web.template.render('templates/')

urls = (
    '/', 'index'
)
app = web.application(urls, globals())

scanip = form.Form(
    form.Textbox('Enter ip scan spec (ex. 192.168.5.0/24): '),
)

scanspec = scanip()
#print scanspec.render()

class index: 
    def GET(self): 
        form = scanip()
        # make sure you create a copy of the form by calling it (line above)
        # Otherwise changes will appear globally
        return render.formtest(form)

    def POST(self): 
        form = scanip() 
        if not form.validates(): 
            return render.formtest(form)
#        else:
#            return "Grrreat success! boe: %s, bax: %s" % (form.d.boe, form['bax'].value)
#            return "success!"

if __name__=="__main__":
    web.internalerror = web.debugerror
    app.run()

Marios Zindilis

unread,
May 15, 2015, 6:48:32 AM5/15/15
to we...@googlegroups.com
Does the file formtest.html exist in the templates directory? If yes, try to define the templates directory with an absolute path (e.g. /var/www/html/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/d/optout.



--
Marios Zindilis
Reply all
Reply to author
Forward
0 new messages