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

Why does matplotlib not work on a digitalocean VPS with web2py?

I've got a digitalocean droplet and I deployed web2py using this script. I installed matplotlib as follows: ssh root@ipdroplet apt-get install python-matplotlib and I can indeed import matplotlib if I simply run python on the command line after…
evan54
  • 3,585
  • 5
  • 34
  • 61
0
votes
1 answer

Using SpatiaLite with web2py?

As explained in this post, I've been attempting to use the web2py database abstraction layer's SpatiaLite adapter, and I'm receiving a "RuntimeError: Failure to connect, tried 5 times" message. I've installed the SpatiaLite DLLs into Windows'…
Boa
  • 2,609
  • 1
  • 23
  • 38
0
votes
1 answer

Web2py's port no of server from inside the application

How do I get the port no on the server (on which web2py app is deployed) from inside the web2py application (for ex. controller or module)? I am using urllib to interact with another action inside the controller by doing this response =…
0
votes
1 answer

"Adapter does not support geometry" exception when declaring geometry field

In my application, an "Adapter does not support geometry" exception is being thrown when attempting to create a field of type, "geometry()". For my test application, I'm using an sqlite DB (production will use postgres): db =…
Boa
  • 2,609
  • 1
  • 23
  • 38
0
votes
0 answers

Web2py is not connecting with my MySQL database

I have a system running on Google App Engine in Python with web2py. Before it was connected with a Google Cloud SQL database. Now I need it to connect to a database at DreamHost. db = DAL ('mysql: // User:…
0
votes
1 answer

web2py: json serializer and javascript has problems with quotes around python string

I want a complex 2d list to be brought from python to javascript. Javascript handles the numbers and list syntax (brackets and commas) just fine, but it can't understand the quotes around a string. I have tried embedding the list directly to the…
DiMarzio
  • 153
  • 1
  • 10
0
votes
1 answer

web2py: How to make a SQLFORM.grid() of a requested table?

I want to form a SQLFORM.grid() of a user requested table. Basically so that the user can change which table they want to view. This is what I've come up with so far: The action. It initializes the grid to None, unless something else is…
DiMarzio
  • 153
  • 1
  • 10
0
votes
1 answer

Web2py SQLFORM update or insert depending on record existence checked at callback

I got stuck with the following challenge. Can I use the callback function to decide whether to update a record or to insert a new one at form.process() call? Simply put, I need a SQLFORM that users will fill with a textual reference identifier, and…
Frédéric
  • 88
  • 8
0
votes
1 answer

Web2py: using data from one database to define tables in another database

I am new to web2py but am familiar with database design, Python and other web frameworks like Django. Web2py looks a really great frameowrk and I would like to use it to develop my current project. For this project I would like to define two…
heather
  • 31
  • 4
0
votes
2 answers

web2py make 20 entries on a page

I have a lot of entries in the table that I want to display, and as I already have other things on the same page, I want to make this table show only 10-20 entries per page. How can I add that? Here is the code I wrote in view: {{if…
spoke
  • 257
  • 1
  • 6
  • 19
0
votes
0 answers

How do I set up my computer to serve website using web2py?

I've got web2py working so I can access my webapp from my computer locally. I also have tornado working and listening on port 8080 as I want to use websockets. I've chosen the "Public (0.0.0.0)" option when firing up the server and listening on port…
evan54
  • 3,585
  • 5
  • 34
  • 61
0
votes
1 answer

where to deploy a web2py app that uses websockets?

I asked this question and it seems pythonanywhere doesn't support websockets. pythonanywhere - How do I use websockets to transmit messages as per the web2py messaging example? so the question is where could I deploy the app as effortlessly as…
evan54
  • 3,585
  • 5
  • 34
  • 61
0
votes
0 answers

Delaying backgroung image in web2py view

I would like to give the background-image it's own class so I can use the javascript code on it. However, if I remove it from the current div the background-image can not be displayed because it is the background-image for this div. This is the…
Joe T. Boka
  • 6,554
  • 6
  • 29
  • 48
0
votes
1 answer

Web2Py add newlines in a column's text while rendering HTML table

I am using the following code to dynamically generate the content of my HTML table using Web2Py helpers: response_results = [] for row in db(db.table.column_name == selected_column_val).select(db.table.ALL): body_col = row.body_col row_data…
MSR
  • 173
  • 3
  • 16
0
votes
1 answer

Populate a Dropdown Nav Menu from database in Web2py

Good day everyone! Is this possible in Web2py? View Students First Year (populate from the database) Section A (populate from the database) Section B and so on Section C Second Year (populate from the database) Section A and so on Section…
MeSH
  • 101
  • 1
  • 10
1 2 3
99
100