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

MemoryError on large files with base64

I am faced with a problem that I am hoping to get some insight on. I have encrypted videos in my web application that decrypts the videos in to a BytesIO memory object then base64 encoded, allowing the video to be played through an HTML5 video…
Maurth
  • 1
  • 2
0
votes
1 answer

web2py sqlform grid links on left join problems

I have a custom controller in SQLFORM.grid and I am using links. The problem is (so it appears) that since I am using left join there when my custom function works, edit and view do not work. So my links is the following links = [lambda row:…
Yebach
  • 1,661
  • 8
  • 31
  • 58
0
votes
1 answer

web2py redirect to a incorrect page

I am learning web2py. I found a redirect error between 2 very simple actions. This application which I simple modify from the web2py manual is just used to help me to understand the controlflow,request.args and request.vars of web2py. Here is the…
Yibing Liu
  • 21
  • 5
0
votes
1 answer

python database table linking

I'm new to Python and I'm trying to make a simple bulletin board system app using web2py. I am trying to add a post into a certain board and I linked the post and board by including the following field in my post table: Field('board_id', db.board).…
0
votes
2 answers

Web2py parsing json return values

I'm just starting with web2py and python, I am trying to utilize a rest web service using Requests, the call goes through ok and I get the appropriate data back but I am having trouble finding information on how to parse the response to a field.…
cmhdev
  • 43
  • 8
0
votes
1 answer

How to check if my user's profile is complete in web2py?

I have made a 'user_details' table whose 'user_id' field I have referenced to default 'auth_user' table. Now after registration, I show the user his profile and ask him to complete it. But, the problem is that how can I check if the profile is…
0
votes
1 answer

Web2py - Sharing a list among modules

I have a list of id's, that I got from database insertion, to send to other functions in other modules. I have a main module say asd.py and I want to share a list id_list with the functions in other two modules : foo.py and bar.py . This is…
TheSoulkiller
  • 979
  • 8
  • 11
0
votes
1 answer

web2py : non identical field constraint

I would like to define the following table with a non identical field value as a follower should not follow himself : db.define_table('followers', Field('follower', db.auth_user, requires=(db.subscription.follower !=…
John Doe
  • 1,570
  • 3
  • 13
  • 22
0
votes
1 answer

Inserting records in db and summing with default values?

I'm trying to add(or update in case it isn't alreadythere) some records to a db in a loop and I want to fill the entries with the sum of the default db values with some other values, but somehow, when trying to insert,it's not working. It's…
Carla Raquel
  • 115
  • 3
0
votes
2 answers

Auth - register form redirects to profile - Web2py

My problem is silly but I still can't find the answer. I'm using auth functions of web2py but I'm customizing of what I need for example I created my own controller with my own functions using auth Once I logged in , I want to create a new user but…
0
votes
2 answers

web2py select distinct values

I have a table like col1, col2, col3, col4, col5. I want to select distinct values of col3 and my query looks like below: db().select(db.table.col1, db.table.col3, distinct=db.table.col3) The query fails.
0
votes
2 answers

How to implement valid https in web2py

I am using the following web2py slice in attempt to use https for a service worker function in a page. http://www.web2pyslices.com/slice/show/1507/generate-ssl-self-signed-certificate-and-key-enable-https-encryption-in-web2py I have tried opening…
ballade4op52
  • 2,142
  • 5
  • 27
  • 42
0
votes
1 answer

web2py: DAL find() not working

tl;dr: read the last paragraph I have a function which is supposed to return three row objects in a list. And the row objects are as following: row from table mining belongs to the current savestate process is either 1, 2 or 3, respectively for the…
DiMarzio
  • 153
  • 1
  • 10
0
votes
2 answers

@auth.requires_permission not working ver 2

Good day to all web2py experts! I can't find a way on how to use the web2py Decorators @auth.requires_permission('read','person') def f(): .... in the pdf manual it says that: prevents visitors from accessing the function f unless the visitor is a…
MeSH
  • 101
  • 1
  • 10
0
votes
0 answers

How to import and save data from csv in web2py database table?

I used SQlite database. I wrote code like this Module: db.py db = DAL('sqlite://storage.sqlite') db.define_table('data3') db.data3.import_from_csv_file(open('mypath/test.csv'),'r') Controller: def website_list(): return dict(websites =…
Kaggler
  • 21
  • 3