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
3
votes
1 answer

Unable to open a Python subprocess in Web2py (SIGABRT)

I've got an Apache2/web2py server running using the wsgi handler functionality. Within one of the controllers, I am trying to run an external executable to perform some processing on 2 files. My approach to this is to use the subprocess module to…
zashu
  • 747
  • 1
  • 7
  • 22
3
votes
3 answers

GAE-ready asynchronous operations in Python?

I've got a Python app making 3 different api calls one after another in the same block of code. I'd like to execute these calls asynchronously, and then perform an action when they're all complete. A couple notes: Other answers regarding async…
Yarin
  • 173,523
  • 149
  • 402
  • 512
3
votes
0 answers

web2py deployment on dotcloud

Has anyone managed to deploy web2py app on dotcloud using their latest CLI? I've tried following their old doc: http://olddocs.dotcloud.com/tutorials/web2py, to deploy the standard web2py. It just doesn't work for me - it gives me "uWSGI Error wsgi…
skyork
  • 7,113
  • 18
  • 63
  • 103
3
votes
1 answer

A reference manual for Web2Py

I've recently switched from PHP to Web2Py and was wondering if Web2Py has a manual like PHP does. The Web2Py book and the Alter Ego blog are very nice, but I am looking for a quick reference for the Classes and Methods available in Web2Py.
S P
  • 1,801
  • 6
  • 32
  • 55
3
votes
1 answer

$.ajax function : send json data : parse at serverside function

I am using $.ajax function to send json data to serverside function. var jsonObjects = [{id:1, name:"amit"}, {id:2, name:"ankit"},{id:3,name:"atin"},{id:1, name:"puneet"}]; $.ajax({ url: "{{=URL('myControllerName')}}", type: "POST", …
Vineet
  • 624
  • 1
  • 11
  • 26
3
votes
1 answer

Web2py ...Connecting to the correct controller

I have 2 tables : business and article. And I have 3 controllers : Home, Articles, Businesses. In Home page controller the following code returns a list of Businesses and Articles: def index(): lists=…
praveen
  • 41
  • 3
3
votes
1 answer

Best way to embed a google map using web2py

What's the best way to show a map (google maps or otherwise) with web2py. Ideally, I have a pair of lat/longs or zip codes and I'd like to show the route.
David Nehme
  • 21,379
  • 8
  • 78
  • 117
3
votes
2 answers

Python M2Crypto DLLs load failed, The specified module could not be found

I'm trying to use this slice for my web2py app http://www.web2pyslices.com/slices/take_slice/106 i installed the module M2Crypto and followed the slice, when loading the page i receive this error Traceback (most recent call last): File…
Elteroooo
  • 2,913
  • 3
  • 33
  • 40
3
votes
2 answers

Why does web2py crash for me upon startup?

I"m trying to get web2py running on an Ubuntu machine. All the docs seem to indicate that to run it on a *nix system, you download the source and do: python web2py.py I grabbed the source (stable source, not the trunk, version 1.99.4) and tried the…
Adam Parkin
  • 17,891
  • 17
  • 66
  • 87
3
votes
1 answer

Custom CSS classes for SQLFORM widget input in web2py

Given this SQLFORM in the controller: form = SQLFORM.factory(db.source_server, db.target_server) with the following table definition: db.define_table('target_server', Field('target_url', 'string'), …
Kenny Meyer
  • 7,849
  • 6
  • 45
  • 66
3
votes
1 answer

Modifying SQL table schema with web2py

I'm having problems modifying SQL table schema in web2py. If I change the field type of an existing field in db.define_table, the SQL column's new type seems to register in web2py, but doesn't actually change anything in the database, which leads…
Yarin
  • 173,523
  • 149
  • 402
  • 512
3
votes
1 answer

How do I aggregate accounts using OAuth & web2py?

Tumblr provides a very simple interface to link your Twitter and Facebook accounts for posting through their service. I'd like to do something similar in my application - provide a single point for people to aggregate different accounts like Flickr,…
Matt Norris
  • 8,596
  • 14
  • 59
  • 90
3
votes
1 answer

How to change the SQLFORM style in web2py views

I would like to have a custom view of login and register forms in my views, without loosing the functionalities of SQLFORM. How can I change the "look" of the forms in views. Please give me some pointers like which CSS file I should be modifying. I…
athinker
  • 71
  • 1
  • 3
3
votes
1 answer

web2py unit testing on GAE

How can I test web2py units that are intended to be run on GAE? I learned to run tests using this method: python web2py.py -S api -M -R applications/api/tests/test.py But how do I run tests with dev_appserver.py & web2py.py?
andrei
  • 315
  • 3
  • 7
3
votes
1 answer

web2py DAL multiple left joins

Is it possible? I tried the following: rows=db().select(db.division.ALL, db.department.ALL, db.section.ALL, \ left=db.section.on(db.department.id==db.section.department_id) & \ …
synergetic
  • 7,756
  • 8
  • 65
  • 106