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

How to extract old record from archive table in web2py?

I want to find record of particular table whose particular field is modified yesterday and also find current value of field and old value. For example, I have company table with fields id, name and address. I want to track name field and find…
Gaurav Vichare
  • 1,143
  • 2
  • 11
  • 26
0
votes
1 answer

Janrain facebook login in web2py

I am using janrain facebook login to login in web2py. Facebook is returning profile picture, age and other public profile details. However, I am not able to access those details. Where are those details stored?
Anurag Mishra
  • 11
  • 1
  • 4
0
votes
1 answer

How can I calculate the cost given the discount% in web2py/sqlite?

I have two tables, a product table which contains: Product ----------- ProductName Supplier,'reference supplier' sku Description Price then I have a supplier table Supplier --------- SupplierName Discount My question is, how can I calculate in…
weemo
  • 7
  • 1
  • 4
0
votes
1 answer

web2py firebird db fails connect

I trying to connect a web2py app to a firebird database in another server. This is the output message: Ticket ID 127.0.0.1.2016-01-11.12-27-33.cdefb9f6-3cc5-46ce-85dc-a2a12220e7f6 Failure to connect, tried 5 times: Traceback (most recent call…
Fábio Filho
  • 111
  • 1
  • 10
0
votes
1 answer

web2py function not triggered on user request

Using web2py (Version 2.8.2-stable+timestamp.2013.11.28.13.54.07), on 64-bit Windows, I have the following problem There is an exe program that is started on user request (first an txt file is created then p is triggered). p =…
Yebach
  • 1,661
  • 8
  • 31
  • 58
0
votes
1 answer

RiotJS (& web2py): Keep two elements in sync

With RiotJS I created a simple element that has a contenteditable div in it for the user to modify (myFunction will style it according to some criteria). Now I want to have that element at the beginning and at the end of my website, and they should…
jogi
  • 11
  • 3
0
votes
1 answer

How do I "link" a web2py database?

I am trying to make a database for stock data in web2py like, Company A holds data for equity in 2010, 2011, 2012... and Company B holds data for equity in 2010, 2011, 2012... This is what I come up with. db.define_table( 'company', …
tompa
  • 3
  • 2
0
votes
1 answer

when using web2py ,why the url changed automatically when using auth

I defined a function in controller file(test.py) the code is: def user(): return dict(form=auth()) then,when I visit http://localhost:8000/demo/test/user why the url changed to http://localhost:8000/demo/default/user/login automatically?
gjy
  • 3
  • 1
0
votes
1 answer

Unable to access my web2py app login page by running docker container using gae

I am new to docker, I'm trying to run my web2py app using docker container in gae, my Dockerfile create the docker image, below is my dockerfile FROM ubuntu:trusty MAINTAINER john #install python RUN apt-get install -y -qq wget python…
Chandu
  • 51
  • 1
  • 7
0
votes
1 answer

Embedding d3.js graph in a web2py bootstrap page

Below is an example of how I am using d3.js with web2py controller. This is working for me. But, I would prefer to use d3.js within an existing bootstrap page using web2py's default bootstrap layout. When I put this d3.js code into the bootstrap…
ChrisGuest
  • 3,398
  • 4
  • 32
  • 53
0
votes
1 answer

Ajax call in web2py with a # passed in request.vars chops the later part

var x = "www.something.com#something" ajax("default?q="+x,"",""); Here, in the controller, the value obtained in request.vars is only www.something.com instead of www.something.com#something Looks like anything written after # is not taken into…
0
votes
1 answer

Invalid ticket in web2py app on nginx

I have an iaas server running nginx for a web2py application. The web2py welcome page views without problem, but my test application encounters an internal error. It runs just fine on my laptop on localhost. On the server the ticket link says…
User
  • 15
  • 3
0
votes
1 answer

How to dynamically change variable name in form.vars.var_name

I have defined counter variable in controller. I can define tables and fields dynamically. tables = [db.define_table('example_table_%s' % x, Field('example_field_%s' % x, type='string', ...) ... ) for x in range(0, counter+1)] I can…
Henri
  • 5
  • 1
0
votes
1 answer

Unable to unpack tuple of db fields into db().select() function

Rather than unpacking a list of fields, I was attempting to unpack a tuple of fields, and pass the result into the db().select() function, as in the following: def get_record(self, record_id, fields): try: return…
Boa
  • 2,609
  • 1
  • 23
  • 38
0
votes
1 answer

How to add dynamically created tables to SQLFORM in web2py

I have defined counter and dict variables in controller. I can define tables dynamically. for x in range(0,counter+1): dict['%s' % x] = db.define_table('example_table_%s' % x, Field('example_field', type='string', ...) ... …
Henri
  • 5
  • 1