Questions tagged [web2py]

web2py is a open-source full-stack web framework written in Python.

web2py is a free, open-source web framework for agile development of secure database-driven web applications; it is written in Python.

web2py is a full-stack framework. It includes an ORM (called the Data Abstraction Layer), its own template engine and typical form widget helpers and controls.

Created by a team of professionals and academics, one of its key principles is no backward incompatible changes. Development is led by Massimo Di Pierro, Associate Professor in Computer Science at DePaul University in Chicago.

Additional resources:

  1. Project Website
  2. Documentation
  3. Source Code
  4. Sample Websites
  5. Wikipedia Page
  6. Google Group

Simple Example (from What is web2py?):

Model Definition:

db=DAL('sqlite://storage.db')
db.define_table('image', 
    Field('name'),
    Field('file','upload'))

Controller:

def index():
    form = SQLFORM(db.image)
    if form.process().accepted:
        response.flash = 'image uploaded'
    return dict(form = form,counter=None,_class='boxCode')

View:

{{extend 'layout.html'}}
<h1>Image upload form</h1>
{{form}}
2141 questions
5
votes
2 answers

Django vs Pylons vs Web2py : registration, invitation, events

I am comparing these 3 very different frameworks on a few precise points. I already know Django has more users and that Pylons is more flexible. I am a bad programmer so I am looking for a framework which makes things easy for me. First, I want…
David
  • 51
  • 2
5
votes
2 answers

Foreign keys in web2py database

I use web2py framework with two tables. How can I refer one field from first table into second table?
enthusiastic
  • 732
  • 2
  • 9
  • 18
5
votes
6 answers

Showing flash messages in DJango with close button

I want to display flash messages in Django with the close button. Existing message framework in Django allows to display messages and does not allow to close it. As an example, web2py provides such flash messages. I am looking for similar…
Utsav Chokshi
  • 1,357
  • 1
  • 13
  • 35
5
votes
1 answer

Can I do this in Web2Py?

As a way of evaluating Web2Py I tried to reimplement a web page in Web2Py. It seemed quite simple to start with but I'm not sure if it works the way I think. I have a simple page with an input field and button to add an email address. It has a menu…
kenneedham
  • 187
  • 1
  • 3
  • 14
5
votes
5 answers

Version control for my web server

I'm building a Web2Py-based web application and am doing most of my development right on a remote EC2 development server. I would like to version control the entire system, including all python modules, web pages, and Apache config files. The…
Yarin
  • 173,523
  • 149
  • 402
  • 512
5
votes
1 answer

How to pass data from python to javascript in web2py

I see some relevant posts to my query. Tornado is used in the below link How to pass variable from python to javascript I know that it can be done using json but I am not clear how to implement it. In the web2py default controller I am returning a…
5
votes
2 answers

Prevent web2py from caching?

I'm working with web2py and for some reason web2py seems to fail to notice when code has changed in certain cases. I can't really narrow it down, but from time to time changes in the code are not reflected, web2py obviously has the old version…
Joe
  • 61
  • 2
5
votes
3 answers

Sending email from an web2py on GAE

I am trying to send a mail from my web2py app hosted on GoogleAppEngine. But it is not working. I used the mail function that was given with the web2py. Does anybody how to do this? I read in the GAE Documentation that python mail library would not…
felix
  • 11,304
  • 13
  • 69
  • 95
5
votes
2 answers

How do you read the .prof files generated by web2py's profiler?

If I run web2py with the -F option, it will generate a .prof file. How do I read the contents of this file? Hotshot doesn't appear to work (I tried RunSnakeRun as well).
Chris
  • 5,876
  • 3
  • 43
  • 69
5
votes
1 answer

web2py dal sql 'like' equivalent

Hello everyone i'm wondering if there is a 'like' equivalent in web2py dal. I would like to do something like this: db().select(db.person.name like 'JA') thank you very much for your help! Jason
user2386854
  • 173
  • 1
  • 11
5
votes
1 answer

missing "pass" in view

{{extend 'layout.html'}} {{import xml.etree.ElementTree as ET}}

This is a Stations detail page

{{filename = xmlfile}} {{fh = open(filename, "r")}} {{while True:}} {{line = fh.readline()}} {{print(line,…
NoviceInPython
  • 113
  • 1
  • 2
  • 9
5
votes
1 answer

run python code using html5

Basically I want to create a sexy GUI using HTML5 then call code that I wrote in python. I have just discovered some tutorials about web2py, however I am getting the videos now from youtube so I can only watch when I get home. (Life of a student…
Kwekuq
  • 123
  • 1
  • 1
  • 10
5
votes
3 answers

selenium count elements of xpath

i have a webpage with a table containing many Download links i want to let selenium click on the last one : table: item1 Download item2 Download item3 Download selenium must click on Download next item3 i used xpath to find all elments then get…
Ben Ishak
  • 669
  • 3
  • 11
  • 27
5
votes
2 answers

Any clever way to unescape data from JSON string?

I am sending some jsonrpc requests to a web2py server, with a celery backend. Sometimes, I get errors which I want to analyze. The errors come escaped in the jsonrpc reply, so they are not easy to understand. I get something like this: {"version":…
blueFast
  • 41,341
  • 63
  • 198
  • 344
5
votes
1 answer

Escaping special characters in web2py database connection strings

I am using web2py to connect to a db with an 'at' sign in the password, eg 'P@sswd' . db = DAL('mysql://user1:P@sswd@localhost/test') This gets interpreted as a connection to host 'sswd@localhost' using password 'P'. I have tried the obvious URL…
ChrisGuest
  • 3,398
  • 4
  • 32
  • 53