[web2py] Redirect from web2py to flask only if user is logged in

2020-11-16 Thread clara
Hello, First of all , I want to thank for the helpful answers that I get every time I post a question in this group. Now, I have a question, I am not sure if what I am trying to do is feasible or not: I have apache running with 2 virtual hosts: - Virtual Host 1 runs Web2py with Google OAuth

[web2py] Redirect "website.pythonanywhere.com" to "www.newwebsite.de"

2020-02-16 Thread Alexander Hoch
Hello, I want to redict the *"website.pythonanywhere.com/.../123/=abc" *to *"www.newwebsite.de/.../123/=abc". * I tried it with https://www.nakedssl.com/ but this doesnt work as described in https://help.pythonanywhere.com/pages/NakedDomains for me. There is another suggestion in deploying a f

[web2py] Redirect with code 301

2020-02-16 Thread Alexander Hoch
Hello, I want to redict the *"website.pythonanywhere.com/.../123/=abc" *to *"www.newwebsite.de/.../123/=abc". * I tried it with https://www.nakedssl.com/ but this doesnt work as described in https://help.pythonanywhere.com/pages/NakedDomains for me. There is another suggestion in deploying a

[web2py] Redirect to different pages depending on memebership

2019-10-30 Thread Cristina Sig
Hi everyone, I have two different memberships. One is 'Admin' and the other one is 'Schools' and what I want to do is redirect to different index pages depending if I'm login as Admin or as School. This is my try: Default.py def check_membership(): if auth.has_membership(group_id='administr

[web2py] Redirect to new page from ajax request

2019-05-22 Thread Константин Комков
Hello! I use ajax request and in one case of 10 I need redirect user to another page. Can I redirect user on server or I need return link in ajax answer to js, and then redirect user? Now if I use redirect on server redirecting page was loaded in console. -- Resources: - http://web2py.com - ht

[web2py] redirect fails with only an error ticket from deep inside the framework

2017-08-07 Thread 'jim kaubisch' via web2py-users
Hi, The following failure suddenly started in a piece of code thats been running error free for months. I can think of nothing I’ve changed that would cause this to happen (famous last words, I know). I've tried for hours to find something to explain this, without any success ANY ideas would be

[web2py] redirect if registration is pending

2017-07-25 Thread Mark Billion
Dumb question and Im sure that there is an answer that Im missing, but when in doubt App requires registration to be approved and if its not, it redirects to the home screen and flashes the standard message. If I want to redirect a login where the user is pending approval to a different pa

[web2py] redirect an upload

2017-05-26 Thread Dave S
I have a function shove() with decorator @request.restful(), and as part of moving to https, I have a check for https and redirect if it isn't s-full. @request.restful() def shove(): if not request.is_https: redirect(URL(shove, args=request.args, scheme=https, host=True)) def POST

[web2py] redirect to caller function

2016-08-09 Thread marchaos
Probably a very basic question, but I wasn't able to find a solution for this. Let's assume I have a bunch of functions associated to views like: def ItemsByID(): items=db(…).select(orderby=…id) return locals() def ItemsByDate(): items=db(…).select(orderby=…date) return locals() the views

Re: [web2py] Redirect to another page

2016-06-21 Thread Richard Vézina
Please provide code... I guess you are using component and .load get propagated, but can't be sure... Richard On Tue, Jun 21, 2016 at 4:17 PM, wrote: > Hi > > I am using {{redirect(URL('GetData'))}}, the result of this view is > getting appended to results of calling view, is there a way I can

[web2py] Redirect to another page

2016-06-21 Thread ktesr123456
Hi I am using {{redirect(URL('GetData'))}}, the result of this view is getting appended to results of calling view, is there a way I can just display only results of redirected view for example if i am calling redirect from view A to view B I am seeing the results of views A and B, please help

[web2py] Redirect after profile update

2016-05-16 Thread Ron Chatterjee
Anyone aware of anything similar to auth.settings.register_onupdate? I have splitted up the auth_user to buyer and seller. I redirect one group by the following after registration auth.settings.register_onaccept = lambda form: after_registration(form) I would like to do similar after the pr

[web2py] Re: web2py redirect to a incorrect page

2015-10-31 Thread Massimo Di Pierro
Thank you Anthony On Saturday, 31 October 2015 09:31:41 UTC-5, Anthony wrote: > > FYI, I answered this on SO , > and I have already fixed the book on Github. > > Anthony > > On Saturday, October 31, 2015 at 10:07:22 AM UTC-4, Massimo Di Pierro > wrote:

[web2py] Re: web2py redirect to a incorrect page

2015-10-31 Thread Anthony
FYI, I answered this on SO , and I have already fixed the book on Github. Anthony On Saturday, October 31, 2015 at 10:07:22 AM UTC-4, Massimo Di Pierro wrote: > > It is a bug in the book. > > > > > should be > > > > > On Friday, 30 October 2015 23:04

[web2py] Re: web2py redirect to a incorrect page

2015-10-31 Thread Massimo Di Pierro
It is a bug in the book. should be On Friday, 30 October 2015 23:04:30 UTC-5, Yibing Liu wrote: > > I am learning web2py. I found a redirect error between 2 very simple > actions. This application which I simple modify from the web2py manual is > just used to help me to understand the con

[web2py] web2py redirect to a incorrect page

2015-10-30 Thread Yibing Liu
I am learning web2py. I found a redirect error between 2 very simple actions. This application which I simple modify from the web2py manual is just used to help me to understand the controlflow,request.args and request.vars of web2py. Here is the code in my default controller. def index():

[web2py] Redirect url with jqmobile

2015-10-29 Thread John Habermann
Hi I have a web2py application that I have recently upgraded to version 2.12.3 and have been working on converting it to use the jqmobile plugin. I have run into an issue with form submission due to the url not changing when you submit a form so rather than load the page specified by the red

[web2py] Redirect to a URL with POST Method

2015-07-04 Thread Sepehr Mohamadi
Hi Everybody, I want to redirect navigation to an outside URL with a POST Method. I should send payment info to a payment gateway through a POST Method. Then payment gateway again callback to web2py with results. I searched everywhere in the Internet, Web2py Book and this forum, but could not

[web2py] Re: [Web2py] redirect doesn't work with 'tab' as var name

2015-03-25 Thread weheh
What does your controller do with the tab var? On Tuesday, March 24, 2015 at 8:14:54 PM UTC-7, Phillip Parente wrote: > > In controller, redirect is not working with 'tab' as var name: > > redirect(URL('mycontroller', 'index', vars={'tab':'DF03'})) is not working > > > redirect(URL('mycontroller',

[web2py] Re: [Web2py] redirect doesn't work with 'tab' as var name

2015-03-24 Thread Massimo Di Pierro
Definitively not a bug in web2py. Add a print request.env.path_info in your app to see what is really going on. On Tuesday, 24 March 2015 22:14:54 UTC-5, Phillip Parente wrote: > > In controller, redirect is not working with 'tab' as var name: > > redirect(URL('mycontroller', 'index', vars={'tab'

[web2py] [Web2py] redirect doesn't work with 'tab' as var name

2015-03-24 Thread Phillip Parente
In controller, redirect is not working with 'tab' as var name: redirect(URL('mycontroller', 'index', vars={'tab':'DF03'})) is not working redirect(URL('mycontroller', 'index', vars={'tab2':'DF03'})) works fine Is that a bug? Phillip -- Resources: - http://web2py.com - http://web2py.com/boo

[web2py] redirect with var name 'tab' doesn't work

2015-03-24 Thread Phillip Parente
Hello Guys, redirect with var name 'tab' doesn't work: redirect(URL('mycontroller', 'index', vars={'tab':'DF03'})) Is that a bug? redirect(URL('mycontroller', 'index', vars={'tab_with_another_string':'DF03'})) works fine! Thanks, -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] Redirect Error

2015-02-11 Thread Dave S
On Wednesday, February 11, 2015 at 8:48:17 AM UTC-8, Richard wrote: > > Seeing the whole controller and view may help... You can also try just > your redirection that fail in a new controller function to see if it works > or not... Just a simple redirect not the in your controller but if it cou

Re: [web2py] Redirect Error

2015-02-11 Thread Richard Vézina
Seeing the whole controller and view may help... You can also try just your redirection that fail in a new controller function to see if it works or not... Just a simple redirect not the in your controller but if it could be using the same url parameter... For instance pass the id instead of gettin

[web2py] Redirect Error

2015-02-10 Thread Maggs
Hey all, I recently set up a new dev environment with a new version of web2py (2.9.11). In production I am currently running version 1.99.7. When I imported my 1.99.7 apps into version 2.9.11 I had to clean up a few issues, but this one I'm unable to figure out. I have a simple page that update

[web2py] Redirect http to https via routes.py

2014-12-06 Thread Vinicius Assef
Is there a way to redirect http to https using routes.py? I'm running web2py with the following command: $ python web2py.py --nogui -a adminpassword -c ~/openssl/server.crt -k ~/openssl/server.key -i 0.0.0.0 -p 8000 This way, web2py doesn't accept http connections. It returns a "Bad Request" erro

[web2py] Redirect page after submit load form

2014-09-30 Thread Fabiano Almeida
Hello, I am using the LOAD to load a SQLFORM.factory another function as test. Works correctly, except that does the redirect that has the function call. My code: def index(): user = db(db.auth_user.id == auth.user.id).select().first() if not user.job: form = LOAD('ponto', 'function1.loa

[web2py] Redirect afer login problem

2014-08-07 Thread NOSSOLUTIONS
Hi All, I' have made a simple application with web2py using the default layout, but i've a problem with redirect after login. I want to redirect the user to /default/home after login, but i've some problem. I've tried all the solution proposed on this group with no luck. db.py # -*- coding: utf-8

Re: [web2py] redirect(URL('second',vars=dict(name=name)))..could somebody explain this in details thank

2014-07-07 Thread Jonathan Lundell
On 6 Jul 2014, at 7:04 PM, Bazida wrote: > Hi, I was doing some tutorial from the web2py book, i ran into this following > code > > def first(): > form = SQLFORM.factory(Field('visitor_name', requires=IS_NOT_EMPTY())) > if form.process().accepted: > name = form.vars.visitor_name

[web2py] redirect(URL('second',vars=dict(name=name)))..could somebody explain this in details thank

2014-07-07 Thread Bazida
Hi, I was doing some tutorial from the web2py book, i ran into this following code def first(): form = SQLFORM.factory(Field('visitor_name', requires=IS_NOT_EMPTY())) if form.process().accepted: name = form.vars.visitor_name redirect(URL('second',vars=dict(name=name))) # i

[web2py] Redirect to grid page

2014-05-27 Thread Tom Russell
I have a simple form where I have a submit button that runs some code. After the code runs and the data is inserted into my table I do a simple redirect like so: redirect(URL('voltrin_data')) That just goes to a page I have set up with a grid. I notice if I am editing a record and press submit

[web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-12 Thread thiago_pnobre
It worked! Thank you! -- 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-u

Re: [web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-12 Thread Thiago Nobre
It's just that simple? I didn't imagine that was the reason of the strange login behavior. When I get home, I'll test it and tell you if it worked. 2014-02-12 22:26 GMT-02:00 Anthony : > If you change the Auth controller from 'default', you must specify that: > > auth = Auth(db, controller='aute

Re: [web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-12 Thread Anthony
If you change the Auth controller from 'default', you must specify that: auth = Auth(db, controller='autenticacao') Anthony On Monday, February 10, 2014 5:27:40 PM UTC-5, Thiago Nobre wrote: > > Yeah, it's exactly what's going on and I don't know why. I attached the > db.py file and the control

[web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-12 Thread thiago_pnobre
n was > not valid, when I don't use @auth.requires_login()? > > How to prevent web2py redirect if login is not valid? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/is

Re: [web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-10 Thread Thiago Nobre
Yeah, it's exactly what going on and I don't know why. I attached the db.py file and the controllers used on the problem, as you requested. 2014-02-10 19:58 GMT-02:00 Anthony : > Can you be more clear about what is happening? Are you saying if someone > goes to the login page and enters incorrec

Re: [web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-10 Thread Anthony
Can you be more clear about what is happening? Are you saying if someone goes to the login page and enters incorrect credentials, they are being redirected to the index page? Auth shouldn't be doing that by default. Can you show your code? On Monday, February 10, 2014 2:33:11 PM UTC-5, Thiago N

Re: [web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-10 Thread Thiago Nobre
I already know auth.is_logged_in(), but unfortunately when the user enter like visitor, he's not logged in, he just entered at the site without a login. I need something like a login_onreject, because the visitor actually don't sign up. =/ 2014-02-10 17:22 GMT-02:00 Tim Richardson : > in your

[web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-10 Thread thiago_pnobre
; not valid, when I don't use @auth.requires_login()? > > How to prevent web2py redirect if login is not valid? > -- 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) ---

[web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-10 Thread thiago_pnobre
Ok, no problem. Obs.: perfil <=> profile, autenticacao <=> authentication On db.py I have this login settings: ## login settings auth.settings.login_url = URL('autenticacao', 'index') auth.settings.logout_next = URL('autenticacao', 'index') auth.settings.logged_url = URL('default', 'perfil')

[web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-10 Thread Tim Richardson
in your controller, you can access the global variable auth. You can ask auth.is_logged_in() is True if the user is logged in, for example. auth.user returns a Row telling you who is logged in. http://web2py.com/books/default/chapter/29/09/access-control#Authorization -- Resources: - http://

[web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-10 Thread Anthony
page even if login was > not valid, when I don't use @auth.requires_login()? > > How to prevent web2py redirect if login is not valid? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://cod

[web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-10 Thread thiago_pnobre
Anyone? -- 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. T

[web2py] How to prevent web2py redirect if login is not valid?

2014-02-09 Thread thiago_pnobre
case, why the web2py redirects to the home page even if login was not valid, when I don't use @auth.requires_login()? How to prevent web2py redirect if login is not valid? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (S

[web2py] redirect after user approval

2013-12-09 Thread Michel Hayek
I'm fairly new to web2py and i'm using the register & login forms from Web2PY. I was able to enable approval and send email for the admin. but i need to do 2 things 1. Upon user successful register i need to insert into another table (Users) 2. After the Admin approve the User (appadm

[web2py] redirect on error page by routes.py

2013-12-04 Thread sonu kumar
Hi All, I would like to redirect to error.html page upon internal error in my application. here is my code I am using it but not working..Please suggest me where I am doing wrong. routers = dict( # base router BASE=dict( default_application='myapp', ), ) routes_onerror =

[web2py] redirect depending on controller name

2013-11-02 Thread Alex
since I found out that naming my controllers 'list' (to display all existing rows of a specific table) is not a good idea (because it overwrites the internal list type), I'd now like to rename all 'list' controllers to 'view'. To make the transitions for the users as smooth as possible all urls

[web2py] Redirect ignored inside oncreate function

2013-10-19 Thread Vladimir Bratov
Hi I am using smartgrid: def index(): grid = SQLFORM.smartgrid(db.spall, create=True, editable=False, csv=False, search_widget=False, oncreate=created) return dict(grid=grid) When a new record is created created() function is called: def created(form): #my code redirect('blah-

[web2py] Redirect to my own 404 page through a custom error handler?

2013-09-19 Thread Apple Mason
s would not preserve the error code. I found a nice example that points routes_onerror to a custom error handler, which will then preserve the error code: http://www.web2pyslices.com/slice/show/1529/custom-error-routing In that code slice, it just returns a string like "Not found"

Re: [web2py] redirect root folder site another subfolder (thal not is any app)

2013-09-04 Thread damufo
Hi: this solution, work for me: file: routes.py add: routes_in = ( ('./', '303->http://www.domain.org/folder'), ('.', '303->http://www.domain.org/folder'), ) En 04/09/2013 12:46, dam...@gmail.com escribiu: SO debian, apache2 with wsgy and mod_rewrite load Is posible redirect to subfolder

[web2py] redirect root folder site another subfolder (thal not is any app)

2013-09-04 Thread damufo
SO debian, apache2 with wsgy and mod_rewrite load Is posible redirect to subfolder when app is not specified on url? example: http://www.mysite.com/ -> http://www.mysite.com/wordpress/index.php in case http://www.mysite.com/welcome/ (normal work, no redirect anything) I test on /etc/apache2/

Re: [web2py] Redirect in sqlform fails

2013-07-17 Thread Koen Vanhees
Thanks for your reply. 1. I read about form processing. I thought the .process().accepted call would only be caught when "Submit" been pressed? 2. This is not an insert form, but a view form with update functionalities. It displays the record with the given ID (which is passed through the ID

Re: [web2py] Redirect in sqlform fails

2013-07-17 Thread Vinicius Assef
On Wed, Jul 17, 2013 at 6:02 AM, Koen Vanhees wrote: > > That redirection works even before the page loads. > What am I doing wrong? 2 things: 1) the else redirect to "third" because your form wans't processed yet. Check manual and make some experiments to understand form processing flow. 2) Ab

[web2py] Redirect in sqlform fails

2013-07-17 Thread Koen Vanhees
All, this is the code in my controller: def viewdata(): #id = request.vars.id record = db1.data(request.vars.id) form = SQLFORM(db1.data, record=record, submit_button="OK") if form.process().accepted: redirect(URL('second')) return dict(form=form) However, instead

[web2py] redirect after registration issue

2013-06-06 Thread lesssugar
After user registers, I would liketo register them to a different URL, let's say default/index. Auto-login in db.py is set to False. In my default.py controller I have sth this: register_form = auth.register(next=URL('default', 'index')) register_form.update(_class='formstyle', _name='s_reg

[web2py] Redirect to another controller function with arguments from a callback function?

2013-05-23 Thread bracquet
In my views, I have: {{=A('click for more information', _href=URL("myCallback", args=[1]))}} When the anchor button is clicked, my callback will do some lookup and processing in the db, and then will redirect to a new page populated with the new information: def search_results(): resultSe

[web2py] Re: Nasty redirect in Ajax call. 'web2py-redirect-location' header breaks website.

2013-05-08 Thread Aris Green
Thanks a lot, that seem to work. I had to do that in several places. It looks like you have client_side = auth.settings.client_side in trunk. Is there any knowledge of when the next release is? -- --- You received this message because you are subscribed to the Google Groups "web2py-users"

[web2py] Re: Nasty redirect in Ajax call. 'web2py-redirect-location' header breaks website.

2013-05-07 Thread Massimo Di Pierro
In trunk you now do, in db.py auth.settings.client_side = False On Tuesday, 7 May 2013 01:03:38 UTC-5, Aris Green wrote: > > So, do you plan to change this? Should I for now I could use > auth.login_bare(...) and avoid the redirect with client_side=True? > > Aris > -- --- You received this

[web2py] Re: Nasty redirect in Ajax call. 'web2py-redirect-location' header breaks website.

2013-05-06 Thread Aris Green
So, do you plan to change this? Should I for now I could use auth.login_bare(...) and avoid the redirect with client_side=True? Aris -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving email

[web2py] Re: Nasty redirect in Ajax call. 'web2py-redirect-location' header breaks website.

2013-05-06 Thread Massimo Di Pierro
I agree. auth.settings.client_side=True is in trunk. On Monday, 6 May 2013 17:59:49 UTC-5, Anthony wrote: > > I wonder if this is a backward compatibility issue. It looks like Auth > always sets client_side=True, so any Auth call done via Ajax will do a full > page redirect on the client side. D

[web2py] Re: Nasty redirect in Ajax call. 'web2py-redirect-location' header breaks website.

2013-05-06 Thread Anthony
I wonder if this is a backward compatibility issue. It looks like Auth always sets client_side=True, so any Auth call done via Ajax will do a full page redirect on the client side. Does that always make sense? Should we at least make it configurable? Anthony On Monday, May 6, 2013 6:46:00 PM U

[web2py] Re: Nasty redirect in Ajax call. 'web2py-redirect-location' header breaks website.

2013-05-06 Thread Aris Green
Thanks for getting back to me so quickly. I figured a few things out. I am using a component for users to join an email list. I have them create their users name and modify them with components loaded in the view (ajax=False, ajax_trap=True). When you add an email address and password into

[web2py] Re: Nasty redirect in Ajax call. 'web2py-redirect-location' header breaks website.

2013-05-06 Thread Massimo Di Pierro
o load up another component in the parent div after > a post back. Something nasty happens. An HTTP header > 'web2py-redirect-location' is set and that causes a Javascript library > loaded on the page to set the window.location to that URL. I think that > this is a newer

[web2py] Re: Nasty redirect in Ajax call. 'web2py-redirect-location' header breaks website.

2013-05-06 Thread Leonel Câmara
a form via ajax and setting the response.view to > another component URL to load up another component in the parent div after > a post back. Something nasty happens. An HTTP header > 'web2py-redirect-location' is set and that causes a Javascript library > loaded on the p

[web2py] Nasty redirect in Ajax call. 'web2py-redirect-location' header breaks website.

2013-05-05 Thread Aris Green
Hello, I am submitting a form via ajax and setting the response.view to another component URL to load up another component in the parent div after a post back. Something nasty happens. An HTTP header 'web2py-redirect-location' is set and that causes a Javascript library loaded on the p

[web2py] Redirect from inside a component

2013-01-31 Thread Loïc
Hello All, I have a question about my application organized as follows: *A "main" page : render_page *A component "load_newsletter". This component displays a form with an "email" field and a "submit button" What I want to do : When the user fill the form in my component load_newsletter, I want

[web2py] redirect loop when using routes_app_raw

2012-12-03 Thread Vasile Ermicioi
hi, 2 weeks ago I commented on it http://code.google.com/p/web2py/issues/detail?id=1105 just downloaded web2py trunk and it is still not fixed when it will be fixed? (there are 6 weeks since it was reported) --

Re: [web2py] redirect with method POST

2012-09-07 Thread Jonathan Lundell
On 7 Sep 2012, at 3:56 AM, Pradeeshnarayan wrote: > In my web2py application after a form submit, I want to redirect to another > page with some POST variables. I couldn't find any option to set then method. > > My main idea is to avoid those values from users. > > I would greatly appreciate a

Re: [web2py] redirect with method POST

2012-09-07 Thread Marin Pranjić
You cannot send POST vars. You can send GET vars. You can store vars in session and then access them from another page (if they are in the same app). You can return a page with form and then submit that form with javascript (document.form.submit()) Marin On Fri, Sep 7, 2012 at 12:56 PM, Pradeeshn

[web2py] redirect with method POST

2012-09-07 Thread Pradeeshnarayan
In my web2py application after a form submit, I want to redirect to another page with some POST variables. I couldn't find any option to set then method. My main idea is to avoid those values from users. I would greatly appreciate any suggestions. --

[web2py] Redirect to https (V 2.0.6)

2012-09-03 Thread Andrew W
In your web2py directory type in "touch NEWINSTALL" and then restart web2py. It recreates the file you need. It should be there, unless it was deleted. --

[web2py] Redirect to https (V 2.0.6)

2012-09-03 Thread Gerd
Hi! Another issues/whishes: - In the welcome app, is it possible to redirect to https rather then http when clicking on the button named "Administrative interface" - When creating a new app via the admin interface "New simple application", i receive following error: unable to create application

Re: [web2py] redirect results in invalid request.

2012-08-14 Thread Annet
Hi Marin. Thanks for your reply, problem solved. Annet. --

Re: [web2py] redirect results in invalid request.

2012-08-14 Thread Marin Pranjić
edit: URL('addressbook', 'router', args=request.args(0)) On Tue, Aug 14, 2012 at 10:34 AM, Marin Pranjić wrote: > > > On Tue, Aug 14, 2012 at 10:14 AM, Annet wrote: >> >> In a controller I start the index function with the following code: >> >> if not len(request.args): >> redirect(URL('

Re: [web2py] redirect results in invalid request.

2012-08-14 Thread Marin Pranjić
On Tue, Aug 14, 2012 at 10:14 AM, Annet wrote: > > In a controller I start the index function with the following code: > > if not len(request.args): > redirect(URL('addressbook','router')) > elif not session[request.args(0)]: > redirect(URL('addressbook','router',request.args(0

[web2py] redirect results in invalid request.

2012-08-14 Thread Annet
As part of a router function I have the following code: id=request.args(0) account=db(db.NodeAccount.nodeID==id).select(db.NodeAccount.ALL).first() if account: if account.statusID!=1: # in that case the account is blocked or under maintenance redirect(URL('card',args=id)) elif acc

Re: [web2py] Redirect to requested function

2012-08-09 Thread Annet
Hi Jonathan, Thanks for your reply. If you can identify your front-end functions, why not just rewrite > request.{controller,function} here? > > if request.args(0) != session.id: > request.controller = 'addressbook' > request.function = 'router' > Because the router determines, what

Re: [web2py] Redirect to requested function

2012-08-08 Thread Jonathan Lundell
On 8 Aug 2012, at 3:10 AM, Annet wrote: > My application is completely nodeID driven, so all front end function run the > following test: > > if not len(request.args) or request.args(0)!=session.id: > redirect(URL('addressbook','router',args=request.args(0))) If you can identify your f

[web2py] Redirect to requested function

2012-08-08 Thread Annet
My application is completely nodeID driven, so all front end function run the following test: if not len(request.args) or request.args(0)!=session.id: redirect(URL('addressbook','router',args=request.args(0))) This is the router function: def router(): if not len(request.args):

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
Brilliant that has made life so much easier. Thanks again Bruce On Thursday, 5 July 2012 21:46:48 UTC+1, Bruce Wade wrote: > > return dict(results_1=first_results, results_2=second_results, > results_n=n_results) # You can have as many return values in the dictionary > that you want. (Maybe ther

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread Bruce Wade
return dict(results_1=first_results, results_2=second_results, results_n=n_results) # You can have as many return values in the dictionary that you want. (Maybe there is a limit but I have no idea what it is) The dictionary names/keys can be whatever you want to call them. Then in your results.htm

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
Bruce, One more thing, if I want to output the 2 sets of json data, how do I do it? return dict(results=bingresult...) I want to link the 3 results now On Thursday, 5 July 2012 21:35:44 UTC+1, Bruce Wade wrote: > > No problem, I have ran into that problem when I was first learning :D > > On Thu,

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread Bruce Wade
No problem, I have ran into that problem when I was first learning :D On Thu, Jul 5, 2012 at 1:34 PM, adohertyd wrote: > Yeah it works now. Thanks very much Bruce much appreciated. Still have > quite a bit to learn about all of this stuff. > > > On Thursday, 5 July 2012 21:32:10 UTC+1, Bruce Wad

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
Yeah it works now. Thanks very much Bruce much appreciated. Still have quite a bit to learn about all of this stuff. On Thursday, 5 July 2012 21:32:10 UTC+1, Bruce Wade wrote: > > It shouldn't look at your javascript console, if you are using ajax to > call this. > > On Thu, Jul 5, 2012 at 1:30

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread Bruce Wade
It shouldn't look at your javascript console, if you are using ajax to call this. On Thu, Jul 5, 2012 at 1:30 PM, adohertyd wrote: > Thanks Bruce will try that. Why does 'return blekkoresults' work though? > > > On Thursday, 5 July 2012 21:24:53 UTC+1, Bruce Wade wrote: > >> Ok exactly it is com

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
Thanks Bruce will try that. Why does 'return blekkoresults' work though? On Thursday, 5 July 2012 21:24:53 UTC+1, Bruce Wade wrote: > > Ok exactly it is complaining that {{=results}} does not exist. > > Reneed to return dict(results=something) from your results action in your > controller > > On

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread Bruce Wade
Ok exactly it is complaining that {{=results}} does not exist. Reneed to return dict(results=something) from your results action in your controller On Thu, Jul 5, 2012 at 1:23 PM, adohertyd wrote: > This is my results.html, all of it :) > > {{extend 'layout.html'}} > > {{=results}} > > On Thurs

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
This is my results.html, all of it :) {{extend 'layout.html'}} {{=results}} On Thursday, 5 July 2012 21:20:59 UTC+1, Bruce Wade wrote: > > I am assuming by your error inside results.html you have a variable > defined as results however you are passing a tuple blekkoresults,bingresults > we wou

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread Bruce Wade
I am assuming by your error inside results.html you have a variable defined as results however you are passing a tuple blekkoresults, bingresults we would need to see results.html On Thu, Jul 5, 2012 at 1:16 PM, adohertyd wrote: > No tried that and got 'unsupported format character 'A' at index

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
No tried that and got 'unsupported format character 'A' at index 7' On Thursday, 5 July 2012 21:08:20 UTC+1, Richard wrote: > > Maybe you should encode your bing url. > > Richard > > On Thu, Jul 5, 2012 at 4:05 PM, adohertyd wrote: > >> I am trying to get a json response from 2 URL's and showing i

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread Richard Vézina
Maybe you should encode your bing url. Richard On Thu, Jul 5, 2012 at 4:05 PM, adohertyd wrote: > I am trying to get a json response from 2 URL's and showing in on a > results page. I'm getting an error saying that the page I'm redirecting to > in order to show the json data is not defined but

[web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
I am trying to get a json response from 2 URL's and showing in on a results page. I'm getting an error saying that the page I'm redirecting to in order to show the json data is not defined but this only happens with one of the url's being contacted. I'm probably not being very clear with this so

[web2py] Redirect and try except ?

2012-05-16 Thread IVINH
Hi all, Why not write code like this? (It can not redirect) In my default control: def index(): try: redirect(URL(f='user',args=['login'])) except: raise HTTP(400)

[web2py] redirect('http://www.web2py.com')

2012-04-30 Thread Hassan Alnatour
Dear ALL , I am trying to use redirect like this : def members(): if request.vars.fb == "1": redirect('http://www.web2py.com') users = db().select(db.users.ALL,orderby=~db.users.Placeorder) return dict(users=users) but it keep taking me to my website index page or giv

Re: [web2py] redirect fails in module

2012-03-08 Thread Richard Vézina
You may check if those import are working properly : from html import FORM, H2, P, BR, INPUT, URL from http import HTTP, redirect Could it be possible that it should be import like this : from gluon.html import FORM?? Richard On Thu, Mar 8, 2012 at 11:09 AM, Richard Vézina wrote: > I think

Re: [web2py] redirect fails in module

2012-03-08 Thread Richard Vézina
I think you will need to read a bit about current, current.response, current.request, etc. Richard On Thu, Mar 8, 2012 at 11:04 AM, Cliff wrote: > What am I doing wrong? > > This code works fine in a controller. When moved to a module it fails > with a 303 error. > Here is the code: > > ### C

[web2py] redirect fails in module

2012-03-08 Thread Cliff
What am I doing wrong? This code works fine in a controller. When moved to a module it fails with a 303 error. Here is the code: ### Controller: def trash(): import trash_it return trash_it.trashit(request, session,response, db) ## module trash_it.py from html import FORM, H2, P, BR, IN

Re: [web2py] redirect doesn't redirect.

2012-02-13 Thread Ricardo Pedroso
On Mon, Feb 13, 2012 at 10:58 AM, Annet wrote: >    elif request.args(0)==1: This one above is always False. Should be at least: elif request.args(0)=="1": request.args returns each arg as string. Ricardo

[web2py] redirect doesn't redirect.

2012-02-13 Thread Annet
I am working on a network app, in which I use the same controllers and views for all hubs. To keep them separated all hubs have an id and every hub function start with test_hub_vars: def test_hub_vars(): if not len(request.args): redirect(URL('default','error')) elif request.args(0

[web2py] Redirect Auth based on Membership

2012-01-23 Thread Andrew Evans
I want to redirect the admin user if they login as admin vs logging in as a regular user if auth.requires_membership('admin'): auth.settings.login_next = URL('control_panel', 'index') auth.settings.logout_next = URL('control_panel', 'index') that is in my model atm but does not seem to

  1   2   >