[web2py] Re: Why all traffic forwarded to https and how to stop this ?
Here is the solution: Simply copy paste this: - WSGIProcessGroup web2py WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py WSGIPassAuthorization On AllowOverride None Require all denied Require all granted AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \ /home/www-data/web2py/applications/$1/static/$2 Options -Indexes ExpiresActive On ExpiresDefault "access plus 1 hour" Require all granted CustomLog /var/log/apache2/access.log common ErrorLog /var/log/apache2/error.log --- Restart Apache. It works. It is the same thing except first three line of SSL/443 section of the conf file. Deployment script on http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh should be changed, to avoid difficulty for new users. Thanks :) On Monday, November 24, 2014 1:28:59 AM UTC+6, sabbir wrote: > > Hi, > > Deployed using deployment script found here > http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh > <http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh> > > *Found the problem. *The script created configuration is doing it: > > - > > > * RewriteEngine On* > * RewriteCond %{HTTPS} !=on* > * RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]* > > CustomLog /var/log/apache2/access.log common > ErrorLog /var/log/apache2/error.log > > > - > > > Could not figure out yet what to do with these two line > > *RewriteCond %{HTTPS} !=on* > *RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]* > > Any thing I do seems create a loop :( > > > > > > On Wednesday, November 19, 2014 12:52:32 PM UTC+6, joe black :) wrote: >> >> >> Hi, >> >> Just deployed a new web2py using deployment script on Ubuntu.* Problem >> is all the traffic is forwarded to https. giving certificate error to >> users.* It was not like this before. How to stop this automeatic forward >> to https? >> >> Also where is the routes.py . Is it depreciated ? Then how to achieve >> domain to app mapping ? >> >> Thanks, >> sabbir >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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/d/optout.
[web2py] Re: Why all traffic forwarded to https and how to stop this ?
Hi, Deployed using deployment script found here http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh *Found the problem. *The script created configuration is doing it: - * RewriteEngine On* * RewriteCond %{HTTPS} !=on* * RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]* CustomLog /var/log/apache2/access.log common ErrorLog /var/log/apache2/error.log - Could not figure out yet what to do with these two line *RewriteCond %{HTTPS} !=on* *RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]* Any thing I do seems create a loop :( On Wednesday, November 19, 2014 12:52:32 PM UTC+6, joe black :) wrote: > > > Hi, > > Just deployed a new web2py using deployment script on Ubuntu.* Problem is > all the traffic is forwarded to https. giving certificate error to users.* > It was not like this before. How to stop this automeatic forward to https? > > Also where is the routes.py . Is it depreciated ? Then how to achieve > domain to app mapping ? > > Thanks, > sabbir > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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/d/optout.
[web2py] All request forwarded to https - How to stop this
OS - Ubantu 12.4 Deployed using deployment script on the book While browsing apps all the request are forwarding to *https :( * How can i stop this. ideally users who browse with http should be able to browse as it is. Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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/d/optout.
[web2py] Re: urllib2.urlopen(url) – creating exception in GAE, if the url points to an app of the same web2py deployment
For any one novice with Web2py like me :) here are some time saver: 1. In app-engine - urllib2.urlopen(url) can only allow access to outside url. anything within the app will give exception 2. I guess same thing might be applied to service (e.g. XMLRPC), have not tested though. 3. You can not import model, controller form another application. You can Import Module *** 4. In app-engine you can not have model with the same name in different application Best way to communicate with other app is by importing module from that app. Really like this approach, though it needed some time to find out. Tested this on App-engine local server. Here is how to import module: http://www.web2py.com/book/default/chapter/04 pls go to the section "Accessing the API from Python modules" :) On Jan 30, 3:02 pm, sabbir wrote: > Hi All, > > I have two app in the same gae deployment. Inter app communication I > planned to do through httpget as always, for its simplicity. While > implementing this I have noticed that I can fetch any url except of my > own deployments. > > --- Code sample > > url = 'http://localhost:8080/welcome/default/index'# this raise error > url = 'http://google.com'# this is fine > > result= urllib2.urlopen(url) > # this raise a exception here if URL points to the any app in the > web2py deployment > > result= result.read() > return result > > here is the exception detail > Traceback (most recent call last): > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 4113, in _HandleRequest > self._Dispatch(dispatcher, self.rfile, outfile, env_dict) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 4022, in _Dispatch > base_env_dict=env_dict) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 596, in Dispatch > base_env_dict=base_env_dict) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 3095, in Dispatch > self._module_dict) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 2999, in ExecuteCGI > reset_modules = exec_script(handler_path, cgi_path, hook) > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \dev_appserver.py", line 2864, in ExecuteOrImportScript > script_module.main() > File "D:\web2py_src\web2py\gaehandler.py", line 110, in main > run_wsgi_app(wsgiapp) > File "C:\Program Files\Google\google_appengine\google\appengine\ext > \webapp\util.py", line 98, in run_wsgi_app > run_bare_wsgi_app(add_wsgi_middleware(application)) > File "C:\Program Files\Google\google_appengine\google\appengine\ext > \webapp\util.py", line 119, in run_bare_wsgi_app > sys.stdout.write(data) > TypeError: must be string or read-only character buffer, not type > > > > I am planning to solve this Inter app communication using raw python > code and GQL as I also cant access model of another app. Is there any > best practice in this case? > > Thanks and regards, > sabbir
[web2py] urllib2.urlopen(url) – creating exception in GAE, if the url points to an app of the same web2py deployment
Hi All, I have two app in the same gae deployment. Inter app communication I planned to do through httpget as always, for its simplicity. While implementing this I have noticed that I can fetch any url except of my own deployments. --- Code sample url = 'http://localhost:8080/welcome/default/index' # this raise error url = 'http://google.com' # this is fine result= urllib2.urlopen(url) # this raise a exception here if URL points to the any app in the web2py deployment result= result.read() return result here is the exception detail Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\tools \dev_appserver.py", line 4113, in _HandleRequest self._Dispatch(dispatcher, self.rfile, outfile, env_dict) File "C:\Program Files\Google\google_appengine\google\appengine\tools \dev_appserver.py", line 4022, in _Dispatch base_env_dict=env_dict) File "C:\Program Files\Google\google_appengine\google\appengine\tools \dev_appserver.py", line 596, in Dispatch base_env_dict=base_env_dict) File "C:\Program Files\Google\google_appengine\google\appengine\tools \dev_appserver.py", line 3095, in Dispatch self._module_dict) File "C:\Program Files\Google\google_appengine\google\appengine\tools \dev_appserver.py", line 2999, in ExecuteCGI reset_modules = exec_script(handler_path, cgi_path, hook) File "C:\Program Files\Google\google_appengine\google\appengine\tools \dev_appserver.py", line 2864, in ExecuteOrImportScript script_module.main() File "D:\web2py_src\web2py\gaehandler.py", line 110, in main run_wsgi_app(wsgiapp) File "C:\Program Files\Google\google_appengine\google\appengine\ext \webapp\util.py", line 98, in run_wsgi_app run_bare_wsgi_app(add_wsgi_middleware(application)) File "C:\Program Files\Google\google_appengine\google\appengine\ext \webapp\util.py", line 119, in run_bare_wsgi_app sys.stdout.write(data) TypeError: must be string or read-only character buffer, not type I am planning to solve this Inter app communication using raw python code and GQL as I also cant access model of another app. Is there any best practice in this case? Thanks and regards, sabbir
[web2py] Re: Alternative for GROUP BY in app-engine
Hi, Thanks for the reply. Yes for this specific project, I have managed to generate some monthly computed data at the entry time, so that I can show reports like accounts ledger, receive-payment in month range. Still this is in adequate, but okay for now. For another project that I am trying to migrate on app-engine, I am thinking of pushing data to google fusion table for reporting purpose, so end users (mostly excel wizard, but non programmer) can have self service on adhoc analysis. If there were some reference to the cost of processing data by reading a record set (say of 100k record) it could have helped decide some aspects. regards, sabbir On Jan 9, 2:30 am, howesc wrote: > some thoughts: > > - i have cron jobs that run roll-up reports on a scheduled basis on GAE. > they select all rows, bucket them, and store the data in an easy to query > table. this should be replaced by the recently released Map-Reduce API for > app engine. > - i am beginning to experiment with Google Cloud Sql for storing stats > data. this will allow my admins to run arbitrary stats reports at the > expense of data duplication. cloud SQL itself is in (private?) beta still > and pricing has not been announced. > > cfh
[web2py] Re: Alternative for GROUP BY in app-engine
It seems reading data sequentially is the only option and is costly. My entities are already de-normalized to some extent and I cant keep counter to a separate table as reports can have conditions like date range and other parameters. Now the big question is the cost of sequential search in term of resource uses in app-engine. I am not talking about terabyte of data, lets say about 2 million record in a single entity. Any advice from practical experience to similar scenario is appreciated. I am willing to leave app-engine if it seems too dirty and costly to manage. Thanks Sabbir On Jan 7, 7:07 pm, sabbir wrote: > Hi All, > > Wondering how to best implement GROUP BY in google app-engine, on > large data set. > > Example Entity: > > >>Transaction (sl, accountsCode, accountsName, amount, status) > > Then what is the best approach to do something like this in app- > engine: > > >> select accountsCode, sum(amount) > > What I can do with brute force is - > - Select All > - Then read each record > - populate a List with sum / count > > But this seems so inefficient, and will require too much extra code. > > Thanks, > sabbir
[web2py] Alternative for GROUP BY in app-engine
Hi All, Wondering how to best implement GROUP BY in google app-engine, on large data set. Example Entity: >>Transaction (sl, accountsCode, accountsName, amount, status) Then what is the best approach to do something like this in app- engine: >> select accountsCode, sum(amount) What I can do with brute force is - - Select All - Then read each record - populate a List with sum / count But this seems so inefficient, and will require too much extra code. Thanks, sabbir
[web2py] Re: How can we support standard url in web2py ?
Thanks a lot Jonathan. I have tested this in app engine also. It is working fine. regards, sabbir On Jul 20, 11:49 am, Jonathan Lundell wrote: > On Jul 19, 2011, at 1:05 AM, sabbir wrote: > > > > > A Clickatell call back url can be like this: > > >http://www.mysite.com/callback.php?api_id=xxx&apiMsgId=xxx&cliMsgId=x... > > > where I provide the base url: > >http://www.mysite.com/callback.php > > > and clickatell will add this part: > > ? > > api_id=xxx&apiMsgId=xxx&cliMsgId=xxx&status=xxx×tamp=xxx&to=xxx&from=xxx&charge=xxx > > > is there anyway to support this. > > > Thanks and regards, > > Sure. All that will show up in request.vars.
[web2py] How can we support standard url in web2py ?
Hi all, A Clickatell call back url can be like this: http://www.mysite.com/callback.php?api_id=xxx&apiMsgId=xxx&cliMsgId=xxx&status=xxx×tamp=xxx&to=xxx&from=xxx&charge=xxx where I provide the base url: http://www.mysite.com/callback.php and clickatell will add this part: ? api_id=xxx&apiMsgId=xxx&cliMsgId=xxx&status=xxx×tamp=xxx&to=xxx&from=xxx&charge=xxx is there anyway to support this. Thanks and regards, Sabbir