actually it's not possible, but as a hint, can't you enforce https at the webserver level ? Or, you could "protect" standard controllers putting request.requires_https() in those, so scheduler could access your tasks in models without "hitting" that wall.
On Thursday, June 21, 2012 9:57:58 PM UTC+2, Yarin wrote: > > Massimo- I don't understand your answer- My question was about how to run > scheduler WITH request.requires_https() turned on. Are you saying this is > not possible? > > My main app needs https protection. My scheduler makes use of the > db/models/methods of the main app, so what is your recommendation? Do I > need to separate the scheduler into a separate app and make cross-app calls? > > On Thu, Jun 21, 2012 at 2:36 PM, Massimo Di Pierro < > [email protected]> wrote: > >> You have this line in >> >> request.requires_https() >> >> In >> >> myapp/models/db.**py", line 10, in <module> >> >> it prevents the scheduler form importing the modules. >> >> >> On Thursday, 21 June 2012 11:15:32 UTC-5, Yarin wrote: >>> >>> I can't get the scheduler to run when I turn on request.requires_https(). >>> >>> $ /opt/web-apps/web2py/web2py.py -K myapp >>> >>> >>> Result: >>> >>> starting scheduler for "myapp"... >>>> Currently running 1 scheduler processes >>>> Processes started >>>> Process Process-1: >>>> Traceback (most recent call last): >>>> File "/usr/lib64/python2.6/**multiprocessing/process.py", line 232, >>>> in _bootstrap >>>> self.run() >>>> File "/usr/lib64/python2.6/**multiprocessing/process.py", line 88, >>>> in run >>>> self._target(*self._args, **self._kwargs) >>>> File "/opt/web-apps/web2py/gluon/**shell.py", line 189, in run >>>> _env = env(a, c=c, import_models=import_models) >>>> File "/opt/web-apps/web2py/gluon/**shell.py", line 131, in env >>>> run_models_in(environment) >>>> File "/opt/web-apps/web2py/gluon/**compileapp.py", line 513, in >>>> run_models_in >>>> restricted(code, environment, layer=model) >>>> File "/opt/web-apps/web2py/gluon/**restricted.py", line 205, in >>>> restricted >>>> exec ccode in environment >>>> File "applications/myapp/models/db.**py", line 10, in <module> >>>> request.requires_https() >>>> File "/opt/web-apps/web2py/gluon/**globals.py", line 119, in >>>> requires_https >>>> redirect(URL(scheme='https', args=self.args, vars=self.vars)) >>>> File "/opt/web-apps/web2py/gluon/**http.py", line 128, in redirect >>>> Location=location) >>>> HTTP: 303 SEE OTHER >>> >>> >>> LAMP/mod_wsgi environment. Anyone deal with this already? >>> >>> >>> -- >> > > --

