web2py

Prevent web2py from caching ?

Hi ! I'm working with web2py and for some reason web2py seems to fail to notice when code has changed in certain cases. I can't really narrow it down, but from time to time changes in the code are not reflected, web2py obviously has the old version cached somewhere. The only thing that helps is quitting web2py and restarting it (i'm u...

web2py server-side comments

In a web2py view, how do I comment out server-side code? In ASP.NET, I can surround any HTML or code tags with <%-- and --%> and that block will not be compiled or sent to the client. Velocity does the same thing with #* and *#. Is there an equivalent in web2py? ASP.NET <div> <p><%=foo.bar%></p> <%-- don't print twice! <p><%...

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 <head> from the view file? layout.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{=T.accepted_language or 'en'}...

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 file? Is there a central place in which I could initialize a logger that can be shared b...

web2py external libraries

hi together, how can i import other external libraries in web2py? is it possible to load up libs in the static file? can somebody give me an example? thanks peter ...

Web2py controllers with parameters?

I am building an app using Web2py framework... I don't want to have to use the request object to get all of the querystring parameters, instead I'd like to build my controller with named parameters and have the router unpack the querystring (or form data) dictionary into the named parameters and call my controller. so instead of a contr...

how to turn off Web2py ticketing system?

I want to Web2py to just return the error screen/stack-trace... i don't want this ticketing system in place. how can I turn it off? ...

Is there a /users/www-data type directory in RedHat/Fedora?

I'm trying to setup web2py on my Fedora server, and the instructions, written for Debian, are telling me to install it in the /users/www-data directory. I realize that Fedora uses a default 'apache' user for running Apache, and Debian uses a 'www-data' user, but there's no corresponding /users/apache directory on my machine... Here are...

Web2py default app

I am planning to publish my site soon on Dreamhost using passenger WSGI as mentioned in the dreamhost setup documentation. My issue is that I am wanting www.mydomain.com to go directly to my new application, instead of needing to go to web2py.mydomain.com/MyApp/Default. What is the best way to solve this issue? Do I use DNS redirects ...

web2py defining db tables and requires - alter table?

I'm trying to use a legacy sqlite db in web2py. I cannot change the schema as the db is currently in use by a couple other apps. My problem is that the db tables have requires that look like this: TableC requires TableB, TableB requires TableA, TableA requires Table C. So, of course I get an error when the table required isn't define...

web2py: how to enable "request_reset_password" function?

Hello, I'm new to web2py but eager to learn it fast. I try to enable "request_reset_passwor" function but every time I enter this page: http://127.0.0.1:8000/project/default/user/request_reset_password I receive message that the function is disabled. Can you please tell me what should I do and where to get it working? Thank you ...

Version control for my web server

I'm building a Web2Py-based web application and am doing most of my development right on a remote EC2 development server. I would like to version control the entire system, including all python modules, web pages, and Apache config files. The files are obviously scattered across my Linux box, but I would like to be able to checkout/com...

In web2py, can I specify an existing named field as the autonumber ID in a legacy database?

I have dozens of tables in an existing MSSQL database all with autonumber ID primary keys, but none that are named 'id'. They are instead named PropertyID, ClientID, etc. The official documentation seems to suggest renaming each of these fields to 'id': Legacy Databases web2py can connect to legacy databases under some condi...

Google app engine users Auth: djangoappengine Vs Web2py Vs Webpy

I'm going to develop a small web application on Gae with a registration section, login\logout and stuff like that. Since Google app Engine does not support session out of the box and i don't want to restrict access using google Accounts, i am forced to pick a Framework that offers this kind of facilities. My choices are: Web2py Djan...

Using Web2Py in Making a blog in Python (Google App Engine)? Is it a good Idea?

I know there are tons of blogging platforms out there (Wordpress,Drupal,etc) but I want to make my own blog engine or blog platform from scratch using python as a learning tool. The idea of using Google App Engine solves the issues in hosting. Blogs relatively consumes less amount of disk space and If it scales then there's no problem of...

Help with Python code

I need some help understanding what's happening here. This code is from a models/log.py module in web2py, and is meant to allow for global logging. def _init_log(): logger=logging.getLogger(request.application) ... return logger logging=cache.ram('mylog',lambda:_init_log(),time_expire=99999999) Can someone explain how...

How to add NOT NULL constraint on foreign keys in Web2py

I am having trouble in making my models to generate foreign keys as not null in Web2py. I have tried everything that I knew and all that I could find on the web. Here is a simple example: db = DAL('sqlite://storage.db') users=db.define_table('user', Field('name') ) cars=db.define_table('cars', Field('user', users, notnull=True), Field(...

Generating custom forms from DB schema

Hi, I am a current web2py user, but find I still go back to Django once in a while (where I started). Specifically when working on projects where I want to make use of some specific django apps/plugins/extensions that don't yet exist in web2py. One thing that I can't live without in web2py, which I am looking for a solution for in Dja...

Using web2py on Eclipse

I am trying to use the steps I found on the net to make web2py work on Eclipse, but I must have something setup wrong because Eclipse gives me error on the imports. For instance the instructions say to do this at the top of controllers: if 0: from gluon.globals import * from gluon.html import * from gluon....

How to setup web2py fixtures

I'm trying to find a way to create fixtures for my web2py application. I came across http://thadeusb.com/weblog/2010/4/21/using_fixtures_in_web2py that suggests creating a x_fixtures.py file to place all the fixtures in. The problem is that after a while, the file gets huge and a pain to navigate through. What I want to be able to do i...