[web2py] Fail to add entry to list:reference field
Hello there, I'm using a list:reference type field (f_keypersons in the code below). Having two issues here: 1. When adding/editing a record the dropdown appears on the corresponding field with correct options, but NO +/- sign as usual list fields. 2. After select one option value and submit the field is still blank when listing this record again. Checking the record in appadmin, the value under this field is [2L] while it is supposed to be [2] which is the id in the referenced table. Trying to manually assign a value to this field but can' change it. Any help is appreciated. https://lh6.googleusercontent.com/-2xTeiWv_i7k/UWFbepS2nOI/Bug/KkIlCjMV5ts/s1600/1.png Related code: db.define_table('t_prospects', Field('f_account', db.t_accounts, required=True, label=T('Account')), Field('f_project', db.t_projects, required=True, label=T('Project')), Field('f_keypersons', type='list:reference t_contacts', requires= IS_IN_DB(db, 't_contacts.id', '%(f_name)s'), label=T('Key Person')), auth.signature, format='%(f_account)s', migrate=settings.migrate) db.t_prospects.f_account.requries = [IS_NOT_EMPTY(), IS_IN_DB(db, 't_accounts.id', '%(f_name)s')] db.t_prospects.f_project.requries = [IS_NOT_EMPTY(), IS_IN_DB(db, 't_projects.id', '%(f_project)s')] db.define_table('t_contacts', Field('f_name', type='string', required=True, label=T('Name')), Field('f_tel1', type='string', label=T('Telephone 1')), Field('f_tel2', type='string', label=T('Telephone 2')), Field('f_fax', type='string', label=T('Fax')), Field('f_mobile', type='string', label=T('Mobile')), Field('f_email1', type='string', label=T('Email 1')), Field('f_email2', type='string', label=T('Email 2')), Field('f_remarks', type='list:string', label=T('Remarks')), auth.signature, format='%(f_name)s', migrate=settings.migrate) db.t_contacts.f_name.requires=IS_NOT_EMPTY() -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: UnicodeEncodeError on GAE
Encountered the same issue, removing 'str()' and it worked. Thanks 在 2012年2月16日星期四UTC+8下午10时59分28秒,sherdim写道: I Think it is a bug as for 1.99.4 When a form tries to keep values w/ non ascii characters if form.accepts(request.vars,session, formname=sP, keepvalues=True): File C:\a\w2p\gluon\html.py, line 1801, in accepts status = self._traverse(status,hideerror) File C:\a\w2p\gluon\html.py, line 743, in _traverse newstatus = c._traverse(status,hideerror) and newstatus File C:\a\w2p\gluon\html.py, line 751, in _traverse self._postprocessing() File C:\a\w2p\gluon\html.py, line 1585, in _postprocessing _value = str(self['_value']) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128) Is str instruction ever needed? If yes - additional check for unicodes with proper utf-8 conversion is needed just before. IMHO str at 1585 is excessive - all is fine when deleted -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Issues running auth.wiki() based app in GAE launcher
Hi there, After developing the app in Web2py IDE I'm trying to run it in GAE launcher. Some issues encountered: 1. Two users created in database in IDE, register disabled. When firing up the page, login page popped up as designed but I couldn't login with existing user account (possibly because database not indexed yet). Re-enable registration and create the account which is supposed to already exist in database, succeeded and the logged in. This basically means database is empty now uder GAE launcher. 2. All pages created under auth.wiki() are gone. only showing '[wiki]' tag. This is could be the same reason of database records since those pages are stored in wiki page tables. Can someone advise on the solutions? Thanks. Spring -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Issues running auth.wiki() based app in GAE launcher
Hi Niphlod, Thank you for the replay. It explains clearly. However, I understand how to export database from appadmin, but for importing do I have to write the function or there is similar function already provided in GAE Launcher? Spring 在 2013年3月28日星期四UTC+8下午7时46分41秒,Niphlod写道: GAE doesn't work with sqlite, but with its own storage.. every data you stored in sqlite is not available. If you want to migrate tables you can export them using appadmin while working on sqlite and then start the app in the GAE launcher and import the previously saved data into it. On Thursday, March 28, 2013 11:41:11 AM UTC+1, Spring wrote: Hi there, After developing the app in Web2py IDE I'm trying to run it in GAE launcher. Some issues encountered: 1. Two users created in database in IDE, register disabled. When firing up the page, login page popped up as designed but I couldn't login with existing user account (possibly because database not indexed yet). Re-enable registration and create the account which is supposed to already exist in database, succeeded and the logged in. This basically means database is empty now uder GAE launcher. 2. All pages created under auth.wiki() are gone. only showing '[wiki]' tag. This is could be the same reason of database records since those pages are stored in wiki page tables. Can someone advise on the solutions? Thanks. Spring -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Issues running auth.wiki() based app in GAE launcher
Right I don't why I got the idea Appadmin doesn't work in GAE, maybe during jump reading of some posting... Problem solved. Thanks. 在 2013年3月28日星期四UTC+8下午8时25分12秒,Niphlod写道: you can import and export data from appadmin. On Thursday, March 28, 2013 1:17:04 PM UTC+1, Spring wrote: Hi Niphlod, Thank you for the replay. It explains clearly. However, I understand how to export database from appadmin, but for importing do I have to write the function or there is similar function already provided in GAE Launcher? Spring 在 2013年3月28日星期四UTC+8下午7时46分41秒,Niphlod写道: GAE doesn't work with sqlite, but with its own storage.. every data you stored in sqlite is not available. If you want to migrate tables you can export them using appadmin while working on sqlite and then start the app in the GAE launcher and import the previously saved data into it. On Thursday, March 28, 2013 11:41:11 AM UTC+1, Spring wrote: Hi there, After developing the app in Web2py IDE I'm trying to run it in GAE launcher. Some issues encountered: 1. Two users created in database in IDE, register disabled. When firing up the page, login page popped up as designed but I couldn't login with existing user account (possibly because database not indexed yet). Re-enable registration and create the account which is supposed to already exist in database, succeeded and the logged in. This basically means database is empty now uder GAE launcher. 2. All pages created under auth.wiki() are gone. only showing '[wiki]' tag. This is could be the same reason of database records since those pages are stored in wiki page tables. Can someone advise on the solutions? Thanks. Spring -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: After modifying routes.py, GAE still routing to Welcome rather than my app
Ok, today I finally solved this problem. the default_application in routes.py is case-sensitive. I named my application folder in a upper case and caused missing of default app then web2py goes for welcome. 在 2011年11月6日星期日UTC+8下午9时28分27秒,Spring写道: Hi there, I'm facing a problem with GAE deployment. GAE still routes to Welcome rather than my app when hitting www.myapp.com. And because I skipped the Welcome app in app.yaml, it gives invalid request. Tried manually to go to www.myapp.com/myapp/default/index, still invalid request. Things seem to be fine when running the app locally with both web2py and GAE launcher. I even tried to give a new version number and re-deploy, but the same happened. Contents of routes.py modified as follows: default_application = 'go2chongqing'# ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' # ordinarily set in app-specific routes.py routes_app = ((r'/(?Pappgo2chongqing|welcome|admin|app)\b.*', r'\gapp'), (r'(.*)', r'go2chongqing'), (r'/?(.*)', r'go2chongqing')) routes_in and routes_out remain unchanged. = Can anybody help on this. Thanks in advance. Spring -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Is database on GAE overwritten when re-deploy app via GAE launcher?
Hello there, Logically I think the GAE database should not be overwritten when re-deploy. Anyone please confirm this? Thanks. Spring -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Is database on GAE overwritten when re-deploy app via GAE launcher?
Thanks for the kind reply, Massimo. 在 2013年3月29日星期五UTC+8上午3时12分13秒,Massimo Di Pierro写道: it is not overwritten. On Thursday, 28 March 2013 11:15:05 UTC-5, Spring wrote: Hello there, Logically I think the GAE database should not be overwritten when re-deploy. Anyone please confirm this? Thanks. Spring -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] [FYI] Pyodel is now a plugin
Hello Alan, I tried pyodel and faced with the same issue of google login requirement. I signed in with google account but redirect to the Sign in with your google accounthttps://www.google.com/accounts/ServiceLogin?service=ahpassive=truecontinue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttp://pyodel.appspot.com/ltmpl=gmshdf=ChILEgZhaG5hbWUaBlB5b2RlbAwSAmFoIhSZY5By1PCj3EjZf9NrJ3GmqIjN_SgBMhR51VTpu4b1JO0uu3RNmEpSXxw4bA. page, cannot go any further. In fact my own app is facing the same problem. When at the page of Sign in with your google accounthttps://www.google.com/accounts/ServiceLogin?service=ahpassive=truecontinue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttp://pyodel.appspot.com/ltmpl=gmshdf=ChILEgZhaG5hbWUaBlB5b2RlbAwSAmFoIhSZY5By1PCj3EjZf9NrJ3GmqIjN_SgBMhR51VTpu4b1JO0uu3RNmEpSXxw4bA. only signing with the app creator's google account can pass it. Somehow I assume it's because the logging is set to login as app administrator by some unknown means. I hope you or someone may come up with a solution. Regards, Spring 在 2012年10月18日星期四UTC+8下午11时45分15秒,Alan Etkin写道: El jueves, 18 de octubre de 2012 12:29:17 UTC-3, Bill Thayer escribió:Just tried it again. Logged in with my email and password then it took me to a blank page with one line on top that says to sign in with google password. I must admit this is some kind of app issue. However, I have created a fake user and authenticated without a Google account. I'll have to check how GAE handles app users so I can fix this somehow. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] How to display 'text' field contents in several paragraphs rather than in single line
Hello there, I have defined a 'text' field in the table. The content consists of multiple paragraphs, when displayed in the view the content squeezes into a single line. It seems all 'enter' in original text was replaced by a space. How can I display the text as paragraphs as it is input? Thanks for any replay. related piece of code: #Model db.define_table('t_leads', Field('f_owner', type='string', label=T('Owner')), Field('f_location', type='string', label=T('Location')), Field('f_status', type='string', label=T('Status')), Field('f_description', type='text', label=T('Description')), auth.signature, format='%(f_lead_designation)s', migrate=settings.migrate) #View td bgcolor=#FF{{=lead.f_description}}/td -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: How to display 'text' field contents in several paragraphs rather than in single line
Thanks Anthony, it works perfectly. 在 2013年3月27日星期三UTC+8下午9时10分28秒,Anthony写道: When a text field is submitted, line breaks are stored as standard line break characters (i.e., \n). When you then insert the stored text into HTML, the line breaks will be included in the HTML, but browsers ignore line breaks when rendering (i.e., they are treated as single spaces). If you want to convert text line breaks to HTML line breaks (i.e., br / elements), you have to do so explicitly -- for example: {{=XML(lead.f_description.replace('\n', 'br /'), sanitize=True)}} Wrapping the string in XML() is necessary to prevent the web2py template engine from escaping the br / elements, and sanitize=True keeps XML() safe from insecure code that might be injected into the submitted text. Anthony On Wednesday, March 27, 2013 3:33:50 AM UTC-4, Spring wrote: Hello there, I have defined a 'text' field in the table. The content consists of multiple paragraphs, when displayed in the view the content squeezes into a single line. It seems all 'enter' in original text was replaced by a space. How can I display the text as paragraphs as it is input? Thanks for any replay. related piece of code: #Model db.define_table('t_leads', Field('f_owner', type='string', label=T('Owner')), Field('f_location', type='string', label=T('Location')), Field('f_status', type='string', label=T('Status')), Field('f_description', type='text', label=T('Description')), auth.signature, format='%(f_lead_designation)s', migrate=settings.migrate) #View td bgcolor=#FF{{=lead.f_description}}/td -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] non-wiki-editor sees [wiki] dropdown menu
Hello everybody, I'm using auth.wiki() in my simple app. Now I have 2 user records, the first user is in groups of user_1 and wiki-editor, the other user is in group of CommonUser. What I understand is according to autho.wiki() settings, the *[wiki]* menu will only be exposed to user_1 and wiki-editor. Now when i loggin with role of CommonUser I can still see the *[wiki]* but when clicking any function it gives 401 UNAUTHORIZED error (which should be so). How to hide *[wiki]* from non-wiki-editor users in my case? Thanks for any reply. Spring -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] [Newbie]How to query and display table records defined in db.py in pages of auth.wiki()
Hi there, I've going through the web2py group trying various keywords but didn't find a clear answer: in the pages of auth.wiki, how can I query and display tables defined in db.py? Or, more importantly is this possible. Accordingly to the introduction of auth.wiki it sounds like a Swiss knife that handles a lot of needs, so I believe there is a simple way out. It would be wonderful if it can be achieved with Markmin just embedding youtube video. Any reply appreciated. Spring -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: [Newbie]How to query and display table records defined in db.py in pages of auth.wiki()
Thanks for explaining. 在 2013年3月26日星期二UTC+8下午10时33分05秒,Spring写道: Hi there, I've going through the web2py group trying various keywords but didn't find a clear answer: in the pages of auth.wiki, how can I query and display tables defined in db.py? Or, more importantly is this possible. Accordingly to the introduction of auth.wiki it sounds like a Swiss knife that handles a lot of needs, so I believe there is a simple way out. It would be wonderful if it can be achieved with Markmin just embedding youtube video. Any reply appreciated. Spring -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Error when listing newly created database tables from appadmin
Agree with it. According to my practice empty can table can be referenced and the dropdown list is created by without any item. By defining the referenced tables first does solve my problem. 在 2013年3月25日星期一UTC+8下午10时48分02秒,Cliff Kachinske写道: As I understand it, the table does not have to exist when using the 'reference sometable' syntax. Or anyway that's how it's supposed to work. I'm not 100% confident in it, though so I always make it a practice to create the reference tables first. On Monday, March 25, 2013 6:31:16 AM UTC-4, Alan Etkin wrote: I think I kinda figured out the problem. The order of defining tables seems matter. Tables to be referenced need to be defined before the referencing tables. Guess it's a rookie mistake. I don't think it's a matter of table definition order. Maybe there aren't any referenced records in the table so the dropdown widget is not created. About the modified_on created_on, web2py has some features that create tables under the hood, i.e., for record versioning. Perhaps you want to disable them at the model by changing the feature options (they are documented in the book) -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Error when listing newly created database tables from appadmin
Hello Alan, Thanks for the reply. I noticed the common thing of the two error tables is that they're both referenced by some other tables while do not reference to any. Showing one of referencing table: db.define_table('t_clients_in', Field('f_account_id', type='reference t_accounts', label=T('Account ID')), Field('f_lead_id', type='reference t_leads', label=T('Lead ID')), Field('f_status', type='string', label=T('Involvement Status')), Field('f_sow', type='string', label=T('Scope of Work')), Field('f_needs', type='list:string', label=T('Needs')), #Field('f_last_update', type='datetime', # label=T('Last Update')), Field('f_remarks', type='list:string', label=T('Remarks')), auth.signature, format='%(f_account_id)s', migrate=settings.migrate) I'm not sure if the table reference was used correctly in field definition. Now I hashed out all datetime field definition because I found there was two fields of modified_on and created_on which i have no idea where they're from since I didn't define them... One more question here is, for the above table t_clients_in, the first two fields f_account_id and f_lead_id refer to another two tables respectively. When use new record in Appadmin, f_account_id is a fill-in while f_lead_id becomes a dropdown (which is good). I cannot see where the difference comes from. Thanks in advance. Spring I think the problem may not be about the table definitions, but about the data that DAL is trying to retrieve for the datetime type fields. Are you reading a database from another application? I'd check that the values stored for the datetime fields have the proper format. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Error when listing newly created database tables from appadmin
I think I kinda figured out the problem. The order of defining tables seems matter. Tables to be referenced need to be defined before the referencing tables. Guess it's a rookie mistake. Spring 在 2013年3月25日星期一UTC+8上午9时13分56秒,Spring写道: Hello Alan, Thanks for the reply. I noticed the common thing of the two error tables is that they're both referenced by some other tables while do not reference to any. Showing one of referencing table: db.define_table('t_clients_in', Field('f_account_id', type='reference t_accounts', label=T('Account ID')), Field('f_lead_id', type='reference t_leads', label=T('Lead ID')), Field('f_status', type='string', label=T('Involvement Status')), Field('f_sow', type='string', label=T('Scope of Work')), Field('f_needs', type='list:string', label=T('Needs')), #Field('f_last_update', type='datetime', # label=T('Last Update')), Field('f_remarks', type='list:string', label=T('Remarks')), auth.signature, format='%(f_account_id)s', migrate=settings.migrate) I'm not sure if the table reference was used correctly in field definition. Now I hashed out all datetime field definition because I found there was two fields of modified_on and created_on which i have no idea where they're from since I didn't define them... One more question here is, for the above table t_clients_in, the first two fields f_account_id and f_lead_id refer to another two tables respectively. When use new record in Appadmin, f_account_id is a fill-in while f_lead_id becomes a dropdown (which is good). I cannot see where the difference comes from. Thanks in advance. Spring I think the problem may not be about the table definitions, but about the data that DAL is trying to retrieve for the datetime type fields. Are you reading a database from another application? I'd check that the values stored for the datetime fields have the proper format. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Error when listing newly created database tables from appadmin
Hi there, I've created 7 tables from my app and 2 of them cause error when to be listed from Appadmin (/appadmin/select/db?query=db.t_leads.id0). Don't see anything particular in the table definition that may cause the problem. Any help would be apprecicated. Traceback Traceback (most recent call last): File D:\web2py\applications\myapp\controllers/appadmin.py, line 232, in select File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 9810, in select File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 2218, in select File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1676, in select File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1657, in _select_aux File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 2028, in parse File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1876, in parse_value File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1916, in parse_datetime ValueError: need more than 1 value to unpack Traceback Traceback (most recent call last): File D:\web2py\applications\myapp\controllers/appadmin.py, line 232, in select File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 9810, in select File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 2218, in select File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1676, in select File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1657, in _select_aux File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 2028, in parse File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1876, in parse_value File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1920, in parse_datetime ValueError: invalid literal for int() with base 10: 'Dull white' The definition is as follows: db.define_table('t_leads', Field('f_lead_designation', type='string', label=T('Lead')), Field('f_owner', type='string', label=T('Owner')), Field('f_location', type='string', label=T('Location')), Field('f_status', type='string', label=T('Status')), Field('f_description', type='string', label=T('Description')), Field('f_links', type='list:string', label=T('Links')), Field('f_participants', type='list:string', label=T('Participants')), Field('f_schedule', type='list:string', label=T('Schedule')), Field('f_last_update', type='datetime', label=T('Last Update')), Field('f_remarks', type='list:string', label=T('Remarks')), auth.signature, format='%(f_lead_designation)s', migrate=settings.migrate) db.define_table('t_accounts', Field('f_account_name', type='string', label=T('Account Name')), Field('f_account_number', type='string', label=T('Account Number')), Field('f_address', type='string', label=T('Address')), Field('f_website', type='string', label=T('Website')), Field('f_last_update', type='datetime', label=T('Last Update')), Field('f_remarks', type='list:string', label=T('Remarks')), auth.signature, format='%(f_account_name)s', migrate=settings.migrate) -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Subfolders under /static/img
Hello there, I have created subfolders under static/img for better img organizing. When tested with web2py and GAE launcher, it works fine. But when I tried to deploy on GAE, in the console it says cloning 170 files; cloned 100 files. When I check the webpage on mydomain.com, all img under subfolder of static/img are not available. Obviously, subfolders under static/img were not deployed. Is there any config to include the those subfolders, or this kind of subfolder under /static/img is not supported, ie. all img have to be under /static/img. Thanks. -Spring
[web2py] After modifying routes.py, GAE still routing to Welcome rather than my app
Hi there, I'm facing a problem with GAE deployment. GAE still routes to Welcome rather than my app when hitting www.myapp.com. And because I skipped the Welcome app in app.yaml, it gives invalid request. Tried manually to go to www.myapp.com/myapp/default/index, still invalid request. Things seem to be fine when running the app locally with both web2py and GAE launcher. I even tried to give a new version number and re-deploy, but the same happened. Contents of routes.py modified as follows: default_application = 'go2chongqing'# ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' # ordinarily set in app-specific routes.py routes_app = ((r'/(?Pappgo2chongqing|welcome|admin|app)\b.*', r'\gapp'), (r'(.*)', r'go2chongqing'), (r'/?(.*)', r'go2chongqing')) routes_in and routes_out remain unchanged. = Can anybody help on this. Thanks in advance. Spring
[web2py] Re: After modifying routes.py, GAE still routing to Welcome rather than my app
Hi Jonathan, I checked the debug logs on GAE as you suggested, and here is the detail after I hit www.mydomain.com: 2011-11-06 22:35:29.090 /favicon.ico 404 22ms 0cpu_ms 0kb W 2011-11-06 22:35:29.090 Static file referenced by handler not found: applications/go2chongqing/static/favicon.ico 2011-11-06 22:35:28.674 /welcome/default/index 404 34ms 46cpu_ms 0kb Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2 D 2011-11-06 22:35:28.667 routes_app: [182.54.127.197:http:// www.go2chongqing.com:get /welcome/default/index] [go2chongqing] - go2chongqing D 2011-11-06 22:35:28.667 select routing parameters: BASE D 2011-11-06 22:35:28.667 routes_in: [182.54.127.197:http:// www.go2chongqing.com:get /welcome/default/index] - /welcome/default/ index (not rewritten) I 2011-11-06 22:35:28.671 Saved; key: __appstats__:028600, part: 39 bytes, full: 1488 bytes, overhead: 0.000 + 0.003; link: http://www.go2chongqing.com/_ah/stats/details?time=1 = Base routes.py: default_application = 'init'# ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' # ordinarily set in app-specific routes.py routes_app = ((r'/(?Pappgo2chongqing)\b.*', r'\gapp'), (r'(.*)', r'go2chongqing'), (r'/?(.*)', r'go2chongqing')) routes_in = ((r'.*:/favicon.ico', r'/examples/static/favicon.ico'), (r'.*:/robots.txt', r'/examples/static/robots.txt'), ((r'.*http://otherdomain.com.* (?Pany.*)', r'/app/ctr \gany'))) routes_out = ((r'.*http://otherdomain.com.* /app/ctr(?Pany.*)', r'\gany'), (r'/app(?Pany.*)', r'\gany')) == routes.py under application/myapp/: default_application = 'go2chongqing'# ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' # ordinarily set in app-specific routes.py routes_app = ((r'/(?Pappgo2chongqing)\b.*', r'\gapp'), (r'(.*)', r'go2chongqing'), (r'/?(.*)', r'go2chongqing')) routes_in = ((r'/static/(?Pfile[\w./-]+)', r'/go2chongqing/static/ \gfile')) routes_in = ((r'.*:/favicon.ico', r'/go2chongqing/static/ favicon.ico'), (r'.*:/robots.txt', r'/go2chongqing/static/robots.txt'), ((r'.*http://go2chongqing.com.* (?Pany.*)', r'/app/ctr \gany'))) routes_out = ((r'.*http://go2chongqing.com.* /app/ctr(?Pany.*)', r'\gany'), (r'/app(?Pany.*)', r'\gany')) == The only welcome I can find out in both routes.py is udner __routes_doctest(). Have no idea how GEA redirects to welcome/default/ index. Spring On 11月6日, 下午11时26分, Jonathan Lundell jlund...@pobox.com wrote: On Nov 6, 2011, at 5:28 AM, Spring wrote: I'm facing a problem with GAE deployment. GAE still routes to Welcome rather than my app when hittingwww.myapp.com. And because I skipped the Welcome app in app.yaml, it gives invalid request. Tried manually to go to www.myapp.com/myapp/default/index, still invalid request. Things seem to be fine when running the app locally with both web2py and GAE launcher. I even tried to give a new version number and re-deploy, but the same happened. Contents of routes.py modified as follows: default_application = 'go2chongqing' # ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' # ordinarily set in app-specific routes.py routes_app = ((r'/(?Pappgo2chongqing|welcome|admin|app)\b.*', r'\gapp'), (r'(.*)', r'go2chongqing'), (r'/?(.*)', r'go2chongqing')) routes_in and routes_out remain unchanged. = Can anybody help on this. Thanks in advance. Do you see anything routing-related in the GAE logs? You'll need to set the log viewing level to DEBUG.- 隐藏被引用文字 - - 显示引用的文字 -
[web2py] Re: Google App Engine Launcher and Deployment
Exactly the same issue here. Do we have any news on this? Spring On Oct 15, 3:05 pm, Simon Ashley gregs...@gmail.com wrote: Just a first time play with this. (Environment: Python 25, current Web2Py nightly source {copied to the Python25 root} and fresh copy of the Google App Engine Launcher) App is working fine from a command line python25 call When run from the Launcher - Browse, is fine with a static page, but when accessing data, it throws the following: Traceback (most recent call last): File C:\Python25\gluon\restricted.py, line 194, in restricted exec ccode in environment File C:/Python25/applications/demurage/views/generic.html, line 98, in module File C:\Python25\gluon\globals.py, line 310, in toolbar for i inthread.instances] File C:\Python25\lib\_threading_local.py, line 193, in __getattribute__ return object.__getattribute__(self, name) AttributeError: 'local' object has no attribute 'instances' Table is generated in the GAE, data can be imported, but nothing accessed through the application. Any ideas?
[web2py] Re: Google App Engine Launcher and Deployment
Found it in the Nightly Built source code, but not the stable one. Problem solved. Thanks. On Nov 6, 1:44 am, Jonathan Lundell jlund...@pobox.com wrote: On Nov 5, 2011, at 10:33 AM, Spring wrote: Exactly the same issue here. Do we have any news on this? I believe this is fixed in the trunk (note that Simon reported the problem about three weeks ago; the fix was recent). To check whether you have the fix, look at gluon.globals.Response.toolbar; you should see this line: if hasattr(thread,'instances'): Spring On Oct 15, 3:05 pm, Simon Ashley gregs...@gmail.com wrote: Just a first time play with this. (Environment: Python 25, current Web2Py nightly source {copied to the Python25 root} and fresh copy of the Google App Engine Launcher) App is working fine from a command line python25 call When run from the Launcher - Browse, is fine with a static page, but when accessing data, it throws the following: Traceback (most recent call last): File C:\Python25\gluon\restricted.py, line 194, in restricted exec ccode in environment File C:/Python25/applications/demurage/views/generic.html, line 98, in module File C:\Python25\gluon\globals.py, line 310, in toolbar for i inthread.instances] File C:\Python25\lib\_threading_local.py, line 193, in __getattribute__ return object.__getattribute__(self, name) AttributeError: 'local' object has no attribute 'instances' Table is generated in the GAE, data can be imported, but nothing accessed through the application. Any ideas?
[web2py] Re: Best practice of organizing/present static pages
Hi Anthony, you understand my needs perfectly. I will try your solution. Thanks Spring On Oct 29, 1:26 pm, Anthony abasta...@gmail.com wrote: On Saturday, October 29, 2011 1:17:43 AM UTC-4, pbreit wrote: Not the best urls but could you put them in static? I assume he meant the main page content is static but the pages still need to take advantage of web2py views for navigation, etc., so they aren't true static files.