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

Does web2py have these?

I am finishing up a project in PHP with Yii and phing. Even though Yii is the best web framework I've used to date, I prefer writing Python over PHP. So, I've been looking at web2py and have some questions: Does web2py provide Javascript form…
Simian
  • 1,622
  • 3
  • 17
  • 32
7
votes
2 answers

How can I throttle Python threads?

I have a thread doing a lot of CPU-intensive processing, which seems to be blocking out other threads. How do I limit it? This is for web2py specifically, but a general solution would be fine.
Chris
  • 5,876
  • 3
  • 43
  • 69
7
votes
3 answers

web2py upload with original filename

I want to upload file with SQL.factory() I would just like to maintain the original filename my code currently is form = SQLFORM.factory( Field('file_name', requires=IS_NOT_EMPTY()), Field('file', 'upload',uploadfolder=upload_folder)) if…
Yebach
  • 1,661
  • 8
  • 31
  • 58
7
votes
2 answers

Cleaning up web2py my controllers

My controllers are getting a bit cluttered in my web2py app, and I would like to move functions to another place. I was initially thinking of moving them to modules, but I access the db sometimes, and have other parameters set in db.py (me for user…
Charles L.
  • 5,795
  • 10
  • 40
  • 60
7
votes
1 answer

Give me some awesome Web2py Tip & Tricks which makes you more productive

I have been working with web2py following its official web2py book and got to learn too many things. But a book never teaches a productive workflow. I would like to know what workflow you people use to increase you productivity and understanding of…
Shiv Deepak
  • 3,122
  • 5
  • 34
  • 49
7
votes
3 answers

Selenium selecting a dropdown option with for loop from dictionary

I have a form with inputs and dropdown lists: [...] [...] I pass the values to Selenium as Dictionary: dict = {'user':'Test User 1', [...]} And I use a…
Elteroooo
  • 2,913
  • 3
  • 33
  • 40
7
votes
3 answers

How to integrate SockJS with another web framework

As an alternative to Socket.io, there is SockJS (https://github.com/sockjs/sockjs-client), which seems to be better maintained and more stable than Socket.io. This question is about the conceptual understanding the architecture of using SockJS with…
MLister
  • 10,022
  • 18
  • 64
  • 92
6
votes
1 answer

web2py Debugging with Eclipse

I am using Eclipse (with PyDev) to delevop a web2py application. I have followed this guide to set things up. Now, I want to debug my application using Eclipse. However, for some reason, execution does not (always) stop when it reaches a…
Georg
  • 283
  • 2
  • 12
6
votes
3 answers

web2py insert methods

Web2py docs have two methods for inserting into a database db.tbl[0] = newRow and db.tbl.insert(newRowAsDict) The documentation implies that they are synonyms, but they appear to be different. For one, the insert method throws an exception if…
David Nehme
  • 21,379
  • 8
  • 78
  • 117
6
votes
1 answer

Reusable HTML snippets and sub-views in web2py

I have some reusable HTML snippets that I want to 'include' in a number of web2py views. Using components with LOAD means having to write separate controller functions which need to load their own data. Is there a way to: Reuse dumb (no data) html…
Yarin
  • 173,523
  • 149
  • 402
  • 512
6
votes
3 answers

CMS+blog+e-commerce: django or web2py

At the moment we are running few smaller PHP sites (small company, private, non-profit org, friends...) and would like to migrate them to Python in order to be able to tweak them more easily and/or extend their functionality due to being familiar…
gour
  • 967
  • 9
  • 22
6
votes
4 answers

is there a Heroku type hosting solution for python/web2py?

I am interested to know if there are any python/web2py hosting platforms similar to Heroku for Ruby on Ralils? Something that is easily configurable and scalable?
jason
  • 5,391
  • 6
  • 23
  • 26
6
votes
1 answer

Decoding base64 content from Github API

Hi I'm currently trying to decode the base64 returned from the Github API /:username/:repo/contents/:filepath which returns a json object { "type": "file", "encoding": "base64", "size": 5362, "name": "README.md", "path":…
Sean Urgel
  • 234
  • 3
  • 12
6
votes
1 answer

No such file or directory: mod_wsgi : Unable to connect to WSGI daemon process 'web2py' on '/var/run/apache2/wsgi.30303.0.1.sock'

The webapp is deployed on EC2 and following error is faced randomly once or twice a day making the webapp inaccessible for some period of time. It is automatically corrected after some time. (2)No such file or directory: [client xxx.xx.xx.xxx:xxxxx]…
Aurish Hammad
  • 63
  • 1
  • 3
6
votes
1 answer

Embedding pygal in web2py

pygal, renders an svg and returns in the graphs dictionary. I try to embed it into a web2py page. That works. But I can't figure out how to reduce the size of the graphs on the page. the view: {{extend 'layout.html'}}

Hello…

Davoud Taghawi-Nejad
  • 16,142
  • 12
  • 62
  • 82