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
6
votes
2 answers

create a web2py docker image and access it through browser

I'm trying to build a docker image of web2py on top of ubuntu. Given the docker file ####################### # Web2py installation # ####################### # Set the base image for this installation FROM ubuntu # File…
6
votes
2 answers

web2py application logging

What is the recommended way to log application-specific messages in web2py? I found the documentation on HTTP logging, but I'm thinking more of messages for debugging and tracking. Should I simply use the logging module in each separate controller…
MikeWyatt
  • 7,842
  • 10
  • 50
  • 71
6
votes
1 answer

How to load static files from view HTML in web2py?

Given a view with layout, how can I load static files (CSS and JS, essentially) into the from the view file? layout.html
MikeWyatt
  • 7,842
  • 10
  • 50
  • 71
6
votes
1 answer

Designing to easily migrate to Google App Engine

I am going to start designing a web app shortly, and while I have lots of experience doing it in the SQL world, I have no idea what I need to take into consideration for doing so with the goal of migrating to GAE in the very near…
6
votes
4 answers

Generate HTML Table from Python Dictionary

How would I convert below dictionary into html table {'Retry': ['30', '12', '12'] 'Station MAC': ['aabbccddeea', 'ffgghhiijj', 'kkllmmnnoo'] Download': ['70.', '99', '90'] } Html table format I am trying to achieve is Retry MAC …
Error_Coding
  • 273
  • 2
  • 4
  • 13
6
votes
1 answer

what's the most extensible/flexible FOSS e-commerce software? (or should I roll-my-own?)

I need to build an internal order entry and tracking system for a grocery store which requires many of the features of existing e-commerce systems, such as product catalog, customer_to_order relations/views, movement reporting, order statuses, etc. …
Tony
  • 625
  • 1
  • 6
  • 17
6
votes
1 answer

DAL without web2py

I am using web2py to power my web site. I decided to use the web2py DAL for a long running program that runs behind the site. This program does not seem to update its data or the database (sometimes). from gluon.sql import * from gluon.sql import…
Jay
  • 433
  • 3
  • 9
6
votes
3 answers

"download link " fails in IE

I was trying to implement a "download link" and put it beside one of my report table so that users can download a csv file and open it with applications like Excel. The records are generated dynamically based on the query made by users. So somewhere…
satoru
  • 31,822
  • 31
  • 91
  • 141
6
votes
2 answers

Scanning user-uploaded files for malware in a python-based web framework

I'd like to ask web2py and django users which tools/modules they use to scan user-uploaded files for malicious software, viruses, etc. Can you offer any recommendations, based on your personal experience? Thank you.
Lamps1829
  • 2,231
  • 3
  • 24
  • 32
5
votes
4 answers

Different ways to debug a web2py application

As I am new to web2py, I wonder what are the ways available for debugging a web2py application. So far, I've come across the following scenarios: when a runtime error occurs in a web2py app, an error ticket is generated and normally useful…
skyork
  • 7,113
  • 18
  • 63
  • 103
5
votes
3 answers

How does web2py query expressions work?

I just recently had a chance to take a look at web2py framework and although I have some prior experience with Django and more so with plain Python, I couldn't make sense out of the Query system that web2py employs. Let's take this example from…
ntpl
  • 155
  • 6
5
votes
1 answer

Best practice for populating dropdown based on other dropdown selection in web2py?

I would like to create a form that contains dropdown fields. After entering text or selecting an option in one dropdown I would like to populate the options in another. Is there a best practice for doing so specifically with web2py?
carrier
  • 32,209
  • 23
  • 76
  • 99
5
votes
1 answer

Help getting first web2py Cron Task working

I'm running web2py locally with Windows 7 and live on a Linux Ubuntu server and I haven't been able to get my cron job to run in either. My crontab looks like this: */1 * * * * root *autoemail/send_autoemails and my function works fine when…
LennonR
  • 1,433
  • 18
  • 35
5
votes
1 answer

How to make multiple web2py apps use the same layout.html?

I have three applications, but I want them to use the same layout.html and css. Is there any way to achieve this? EDIT: I put the static folder and layout.html etc in /common/ under the web2py root. Here's what I did in the model: import os global…
Aram Kocharyan
  • 20,165
  • 11
  • 81
  • 96
5
votes
1 answer

How to display web2py errors directly (auto redirect to ticket)

When developing a web2py application, its pretty normal to have various syntax errors, db issues and such. However, when debugging these problems (in a non production system), a ticket link is presented by default, instead of the actual ticket. Is…
Tom Feiner
  • 20,656
  • 20
  • 48
  • 51