web2py

Anyone out there using web2py? [closed]

牧云@^-^@ 提交于 2019-12-02 13:53:15
Is anyone out there* using web2py ? Specifically: In production? With what database? With Google Application Engine? by "out there" I mean at stackoverflow. massimo You are welcome to ask the same question on the google group . You will find more than 500 users there and some of them are development companies building projects for their clients. My impression is that most of them use postgresql (that's what I do to) and some others use the Google App Engine. In fact web2py is the only framework that allows you to write code once and the same code will run on GAE, SQLite, MySQL, PostgreSQL,

how to pass value from view to controller in web2py

孤街浪徒 提交于 2019-12-02 09:29:16
I want to insert the value of lang to mysql table. How to pass the value of lang to controller view <script type="text/javascript"> function test(it) { var lang=it.value; } </script> <form> <p>language <select id="select" onchange="test(this)"> <option value ="0">c</option> <option value ="1">cc</option> <option value="2">pas</option> <option value="3">java</option> <option value ="4">rb</option> </select> </p> </form> conteoller def problem(lang): { } Thanks! web2py doesn't work quite like that. Before proceeding, I suggest you read some of the introductory documenation as well as the

i am trying send email using web2py with gmail and using smtp setting i have attached all code

流过昼夜 提交于 2019-12-02 08:32:01
i am trying to create a form in web2py which sends message to an email account on submission mainly i used SQLFORM.factory to create the form then i used gluon.tools import mail to import the send email functionality. i have set up everything i can think of but still on running this code in web2py it gives out that "fail to send email sorry". from gluon.tools import Mail mail = Mail() mail.settings.server = 'smtp@gmail.com:465' mail.settings.sender = 'myemail@gmail.com' mail.settings.login = 'myemail@gmail.com:secret' def index(): form = SQLFORM.factory( Field('name', requires=IS_NOT_EMPTY()),

Can not import copy_reg

爱⌒轻易说出口 提交于 2019-12-02 06:14:40
问题 I am hosting my Web2py app on PythonAnyware and have an issue importing copy_reg which web2py apparently needs. In previous versions this was no issue. The trace back is as follows: Traceback (most recent call last): File "/home/richdijk/web2py/gluon/restricted.py", line 220, in restricted exec ccode in environment File "/home/richdijk/web2py/applications/im/models/db.py", line 78, in <module> auth.define_tables(username=False, signature=False) File "/home/richdijk/web2py/gluon/tools.py",

standalone use of DAL in web2py

我是研究僧i 提交于 2019-12-02 04:06:14
问题 I have sqlite database from web2py application. I want to use gluon library to work with data. I've read this post, but I got error DAL object has no attribute 'user . As I understand I need to use definitions of tables (in myapp/models/tables.py ). How can I use DAL with existing database outside of web2py (using only gluon library). Here is my code: from gluon.sql import DAL, Field from gluon.validators import * module_path = os.path.abspath(os.path.dirname(__file__)) print module_path

web2py url validator

泄露秘密 提交于 2019-12-02 03:24:10
In a shorten-er built by web2by i want to validate url's first, if it's not valid goes back to the first page with an error message. this is my code in controller (mvc arch.) but i don't get what's wrong..!! import urllib def index(): return dict() def random_maker(): url = request.vars.url try: urllib.urlopen(url) return dict(rand_url = ''.join(random.choice(string.ascii_uppercase + string.digits + string.ascii_lowercase) for x in range(6)), input_url=url) except IOError: return index() BigHandsome Couldn't you check the http response code using httplib. If it was 200 then the page is valid,

library of react components in webpack bundle export to use in on runtime rendering

只谈情不闲聊 提交于 2019-12-02 01:56:47
问题 I am upgrading a legacy web2py (python) application to use react components. I am using webpack to transpile the jsx files to minified js bundle. I want to be able to use: ReactDOM.render( <ComponentA arg1="hello" arg2="world" />, document.getElementById('react-container') ); Where ComponentA is included in the bundle and the bundle is included on the web2py view. The issue is that I can't access ComponentA in the view. The following example will work: <script> var ComponentA = React

Can not import copy_reg

三世轮回 提交于 2019-12-02 01:04:47
I am hosting my Web2py app on PythonAnyware and have an issue importing copy_reg which web2py apparently needs. In previous versions this was no issue. The trace back is as follows: Traceback (most recent call last): File "/home/richdijk/web2py/gluon/restricted.py", line 220, in restricted exec ccode in environment File "/home/richdijk/web2py/applications/im/models/db.py", line 78, in <module> auth.define_tables(username=False, signature=False) File "/home/richdijk/web2py/gluon/tools.py", line 1784, in define_tables format='%(first_name)s %(last_name)s (%(id)s)')) File "/home/richdijk/web2py

standalone use of DAL in web2py

左心房为你撑大大i 提交于 2019-12-01 23:43:31
I have sqlite database from web2py application. I want to use gluon library to work with data. I've read this post , but I got error DAL object has no attribute 'user . As I understand I need to use definitions of tables (in myapp/models/tables.py ). How can I use DAL with existing database outside of web2py (using only gluon library). Here is my code: from gluon.sql import DAL, Field from gluon.validators import * module_path = os.path.abspath(os.path.dirname(__file__)) print module_path dbpath = module_path + '/../databases/' db_name = "storage.sqlite" db = DAL('sqlite://' + db_name, folder

library of react components in webpack bundle export to use in on runtime rendering

爷,独闯天下 提交于 2019-12-01 22:46:33
I am upgrading a legacy web2py (python) application to use react components. I am using webpack to transpile the jsx files to minified js bundle. I want to be able to use: ReactDOM.render( <ComponentA arg1="hello" arg2="world" />, document.getElementById('react-container') ); Where ComponentA is included in the bundle and the bundle is included on the web2py view. The issue is that I can't access ComponentA in the view. The following example will work: <script> var ComponentA = React.createClass({ render: function() { var p = React.createElement('p', null, 'Passed these props: ',this.props