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
3 answers

web2py: how to copy a python array into a javascript one

I'm currently having an issue with getting javascript and python to communicate in web2py. controller: def testDB(): a=[] a.append('a') a.append('b') a.append('c') return dict(m=a) (Eventually this will be…
James
  • 53
  • 1
  • 6
3
votes
1 answer

Using a lambda for a model default in Web2py

I'm try to use a lambda to set a default value based on a value in another table. Here is my model: db.define_table('trip_instance', timestamp, sos_table, Field('trip_type_id', db.trip_type, label='Trip Type', …
LennonR
  • 1,433
  • 18
  • 35
3
votes
1 answer

Are there any open-source references for the web2py remote-procedure-calls?

Are there any open-source references for the web2py remote procedure calls (i.e. @service.run) to get information from and post it to a table in the database?
John
  • 31
  • 1
3
votes
1 answer

IntegrityError when adding null value to foreign key using web2py

I am receiving an IntegrityError from web2py when trying to insert a record into a table named Foods. The table has a foreign key to Recipes, but I would like to add a row without a recipe_id.
colinjwebb
  • 4,362
  • 7
  • 31
  • 35
3
votes
1 answer

Web2py form field options

I am using web2py forms and i want to have some fields only visible to user (as fixed which cannot be edited). I tried making various combinations of editable, writeable, readonly but was of no use. I looked into web2py book too but that also seems…
Jatin Kumar
  • 2,635
  • 9
  • 36
  • 46
3
votes
1 answer

web2py with configuration per environment

Does web2py support, out of the box, configuration per environment (development, staging, production, etc.)? Something similar to Grails and Ruby on Rails. I read/skimmed through official book but could not find anything.
Jarek Rozanski
  • 780
  • 1
  • 6
  • 13
3
votes
1 answer

Web2py - Using a Gmail address

I am beginner with web2py. I have just created a new project. I want to use a gmail address, let's say g@gmail.com. What do I need to modify ? mail.settings.server = 'logging' or 'smtp.gmail.com:587' # your SMTP server mail.settings.sender =…
Bobby
  • 31
  • 2
3
votes
2 answers

Unable to start web2py

I installed Web2py on my machine. When I click web2py.exe, a console appears for a second and disappears. Nothing more than that. What must be missing?
VJOY
  • 3,752
  • 12
  • 57
  • 90
3
votes
5 answers

web2py: Restrict user to only rows created by the user

I would like to restrict users to database entries only they have created. Is their any standard web2py way of doing this? auth.requires_permission looked good, but it appears to require a hard-coded row id, which doesn't solve my problem.
naveed
  • 1,395
  • 2
  • 15
  • 29
3
votes
2 answers

Standalone web2py-DAL with Pyramid - requests, threads and memory

I'm building an app on Pyramid framework and would like to use the web2py-DAL with it. Firebird-embedded is the database of choice. That works great until I try to call multiple views from one web page asynchronously. Different errors like "Invalid…
3
votes
4 answers

How to run web2py in ubuntu?

I downloaded the source code package from http://web2py.com/examples/default/download , but I can't start web2py using this command: tom@ubuntu:~/web2py$ python web2py.py -a 'your password' -i 127.0.0.1 -p 8000 Traceback (most recent call last): …
Tom
  • 2,857
  • 9
  • 46
  • 59
3
votes
1 answer

multiselect list with quantity option for each item

I have a free text field in my html page, but I want to fill it with given strings. So lets say I have strings, "apple", "banana" and "pineapple", and now I want to have a button "add content" that opens a modal box, or if it's easier simply a list…
merhart
  • 125
  • 1
  • 7
3
votes
3 answers

improving web2py performance - database and apache

Could somebody please give some tips on how to improve web2py performance (WSGI apache + MySQL)? I have an application that receives Ajax requests from the client every few seconds to access database and return results. The server is a Ubuntu…
Andrei
  • 71
  • 1
  • 3
3
votes
2 answers

Would anyone recommend using the web2py framework instead of the Google App Engine?

My project amounts to a vertical Q and A site not unlike Quora. Just as on Quora, I want users to be able to follow other users and follow topics. All questions will be tagged in one of 15 topics. If Google App Engine is not a good framework for…
Spencer
  • 21,348
  • 34
  • 85
  • 121
3
votes
1 answer

Using the ajax function to store data in database (web2py framework)

I am having a big problem. I have the following tables db.define_table('post', Field('user_email', default=auth.user.email if auth.user_id else None), Field('title', 'string', requires=IS_NOT_EMPTY()), …
TheMathNoob
  • 307
  • 3
  • 16