[web2py] Re: why does adding form=auth() change the url?

2010-08-12 Thread thedangler
my bad i guess its routing me to the default/user/login page. anyways.
How does the default controller index function know to load the
default/index.html file?

Is it set up such that if you have a controller you have a a folder
named the same to hold all the views for the controller?

Thanks


On Aug 12, 8:19 pm, mdipierro  wrote:
> In admin there is a button [upgrade now] click on it and that should
> do it. BEFORE you do, backup the web2py folder... just in case. ;-)
>
> On Aug 12, 7:18 pm, thedangler  wrote:
>
>
>
> > im on a mac is it easy to upgrade? with out whipping out all my code
>
> > On Aug 12, 8:15 pm, mdipierro  wrote:
>
> > > You have an old web2py version. Upgrade or use
>
> > > auth.settings.login_url =URL(request.application,'default','index',
> > > args='login')
> > > auth.settings.logged_url = URL(request.application,'default','index',
> > > args='profile')
>
> > > On Aug 12, 7:06 pm, thedangler  wrote:
>
> > > > A I see
>
> > > > ok so I tried putting
>
> > > > auth.settings.login_url =URL('index', args='login')
> > > > auth.settings.logged_url = URL('index', args='profile')
>
> > > > in my model
>
> > > > but i end up with the error
>
> > > > SyntaxError: not enough information to build the url
>
> > > > On Aug 12, 7:59 pm, mdipierro  wrote:
>
> > > > > because I like that there is a trace of conversation. Here there is a
> > > > > trace.
>
> > > > > I would put that in the model after you define auth.
>
> > > > > On Aug 12, 6:56 pm, thedangler  wrote:
>
> > > > > > does this
>
> > > > > > auth.settings.login_url =URL('index', args='login')
> > > > > > auth.settings.logged_url = URL('index', args='profile')
>
> > > > > > go in the default controller in the index or in the view?
>
> > > > > > also why are you not in IRC freenode in web2py  conversations would
> > > > > > happen alot faster :)
>
> > > > > > thanks for the help
>
> > > > > > On Aug 12, 7:42 pm, mdipierro  wrote:
>
> > > > > > > no problem. Your problem is here:
>
> > > > > > > {{=T( request.args(0).replace('_',' ').capitalize() )}}
>
> > > > > > > since when you callhttp://.../index, request.args(0) is None and 
> > > > > > > you
> > > > > > > cannot call .replace. Moreover "request.args(0).replace('_','
> > > > > > > ').capitalize()" is not a constant a string but a string that 
> > > > > > > depends
> > > > > > > on user input and it should not be translated using T or you 
> > > > > > > introduce
> > > > > > > a vulnerability.
>
> > > > > > > Now I see what you want to do. You are using the index() action 
> > > > > > > as a
> > > > > > > replacement for the user() action.
>
> > > > > > > You can put form=auth() back but you also have to do:
>
> > > > > > > auth.settings.login_url =URL('index', args='login')
> > > > > > > auth.settings.logged_url = URL('index', args='profile')
>
> > > > > > > and replace the line above with
>
> > > > > > > {{=(request.args(0) or 'login').replace('_',' 
> > > > > > > ').capitalize()}} > > > > > > h2>
>
> > > > > > > On Aug 12, 6:36 pm, thedangler  wrote:
>
> > > > > > > > sorry about the formatting.. it looks like crap
>
> > > > > > > > On Aug 12, 7:36 pm, thedangler  wrote:
>
> > > > > > > > > default controller
> > > > > > > > > def index():
> > > > > > > > >     """
> > > > > > > > >     example action using the internationalization operator T 
> > > > > > > > > and
> > > > > > > > > flash
> > > > > > > > >     rendered by views/default/index.html or views/generic.html
> > > > > > > > >     """
> &g

[web2py] Re: why does adding form=auth() change the url?

2010-08-12 Thread thedangler
Thanks

I ended up jsut backing up my app downloading the new one and placing
it back in.

the page loaded fine but its still under the URL domain.com/myapp/
default/index/login instead of nothing. domain.com/


and where does the login submit to? i know the form action is blank so
it should submit to itself but how do I know if it worked and where do
I handle the redirect?

Thanks




On Aug 12, 8:19 pm, mdipierro  wrote:
> In admin there is a button [upgrade now] click on it and that should
> do it. BEFORE you do, backup the web2py folder... just in case. ;-)
>
> On Aug 12, 7:18 pm, thedangler  wrote:
>
>
>
> > im on a mac is it easy to upgrade? with out whipping out all my code
>
> > On Aug 12, 8:15 pm, mdipierro  wrote:
>
> > > You have an old web2py version. Upgrade or use
>
> > > auth.settings.login_url =URL(request.application,'default','index',
> > > args='login')
> > > auth.settings.logged_url = URL(request.application,'default','index',
> > > args='profile')
>
> > > On Aug 12, 7:06 pm, thedangler  wrote:
>
> > > > A I see
>
> > > > ok so I tried putting
>
> > > > auth.settings.login_url =URL('index', args='login')
> > > > auth.settings.logged_url = URL('index', args='profile')
>
> > > > in my model
>
> > > > but i end up with the error
>
> > > > SyntaxError: not enough information to build the url
>
> > > > On Aug 12, 7:59 pm, mdipierro  wrote:
>
> > > > > because I like that there is a trace of conversation. Here there is a
> > > > > trace.
>
> > > > > I would put that in the model after you define auth.
>
> > > > > On Aug 12, 6:56 pm, thedangler  wrote:
>
> > > > > > does this
>
> > > > > > auth.settings.login_url =URL('index', args='login')
> > > > > > auth.settings.logged_url = URL('index', args='profile')
>
> > > > > > go in the default controller in the index or in the view?
>
> > > > > > also why are you not in IRC freenode in web2py  conversations would
> > > > > > happen alot faster :)
>
> > > > > > thanks for the help
>
> > > > > > On Aug 12, 7:42 pm, mdipierro  wrote:
>
> > > > > > > no problem. Your problem is here:
>
> > > > > > > {{=T( request.args(0).replace('_',' ').capitalize() )}}
>
> > > > > > > since when you callhttp://.../index, request.args(0) is None and 
> > > > > > > you
> > > > > > > cannot call .replace. Moreover "request.args(0).replace('_','
> > > > > > > ').capitalize()" is not a constant a string but a string that 
> > > > > > > depends
> > > > > > > on user input and it should not be translated using T or you 
> > > > > > > introduce
> > > > > > > a vulnerability.
>
> > > > > > > Now I see what you want to do. You are using the index() action 
> > > > > > > as a
> > > > > > > replacement for the user() action.
>
> > > > > > > You can put form=auth() back but you also have to do:
>
> > > > > > > auth.settings.login_url =URL('index', args='login')
> > > > > > > auth.settings.logged_url = URL('index', args='profile')
>
> > > > > > > and replace the line above with
>
> > > > > > > {{=(request.args(0) or 'login').replace('_',' 
> > > > > > > ').capitalize()}} > > > > > > h2>
>
> > > > > > > On Aug 12, 6:36 pm, thedangler  wrote:
>
> > > > > > > > sorry about the formatting.. it looks like crap
>
> > > > > > > > On Aug 12, 7:36 pm, thedangler  wrote:
>
> > > > > > > > > default controller
> > > > > > > > > def index():
> > > > > > > > >     """
> > > > > > > > >     example action using the internationalization operator T 
> > > > > > > > > and
> > > > > > > > > flash
> > > > > > > > >     rendered by views/default/index.html or views/generic.html
> &

[web2py] Re: why does adding form=auth() change the url?

2010-08-12 Thread thedangler
im on a mac is it easy to upgrade? with out whipping out all my code

On Aug 12, 8:15 pm, mdipierro  wrote:
> You have an old web2py version. Upgrade or use
>
> auth.settings.login_url =URL(request.application,'default','index',
> args='login')
> auth.settings.logged_url = URL(request.application,'default','index',
> args='profile')
>
> On Aug 12, 7:06 pm, thedangler  wrote:
>
>
>
> > A I see
>
> > ok so I tried putting
>
> > auth.settings.login_url =URL('index', args='login')
> > auth.settings.logged_url = URL('index', args='profile')
>
> > in my model
>
> > but i end up with the error
>
> > SyntaxError: not enough information to build the url
>
> > On Aug 12, 7:59 pm, mdipierro  wrote:
>
> > > because I like that there is a trace of conversation. Here there is a
> > > trace.
>
> > > I would put that in the model after you define auth.
>
> > > On Aug 12, 6:56 pm, thedangler  wrote:
>
> > > > does this
>
> > > > auth.settings.login_url =URL('index', args='login')
> > > > auth.settings.logged_url = URL('index', args='profile')
>
> > > > go in the default controller in the index or in the view?
>
> > > > also why are you not in IRC freenode in web2py  conversations would
> > > > happen alot faster :)
>
> > > > thanks for the help
>
> > > > On Aug 12, 7:42 pm, mdipierro  wrote:
>
> > > > > no problem. Your problem is here:
>
> > > > > {{=T( request.args(0).replace('_',' ').capitalize() )}}
>
> > > > > since when you callhttp://.../index, request.args(0) is None and you
> > > > > cannot call .replace. Moreover "request.args(0).replace('_','
> > > > > ').capitalize()" is not a constant a string but a string that depends
> > > > > on user input and it should not be translated using T or you introduce
> > > > > a vulnerability.
>
> > > > > Now I see what you want to do. You are using the index() action as a
> > > > > replacement for the user() action.
>
> > > > > You can put form=auth() back but you also have to do:
>
> > > > > auth.settings.login_url =URL('index', args='login')
> > > > > auth.settings.logged_url = URL('index', args='profile')
>
> > > > > and replace the line above with
>
> > > > > {{=(request.args(0) or 'login').replace('_',' ').capitalize()}} > > > > h2>
>
> > > > > On Aug 12, 6:36 pm, thedangler  wrote:
>
> > > > > > sorry about the formatting.. it looks like crap
>
> > > > > > On Aug 12, 7:36 pm, thedangler  wrote:
>
> > > > > > > default controller
> > > > > > > def index():
> > > > > > >     """
> > > > > > >     example action using the internationalization operator T and
> > > > > > > flash
> > > > > > >     rendered by views/default/index.html or views/generic.html
> > > > > > >     """
> > > > > > >     response.flash = T('Welcome to web2py')
> > > > > > >     return dict(message=T('Welcome to MyApp'),form=auth.login())
> > > > > > > default/index.html
> > > > > > > {{extend 'layout.html'}}
> > > > > > > 
> > > > > > > {{if 'message' in globals():}}{{=H2(message)}}{{else:}}
> > > > > > > {{=BEAUTIFY(response._vars)}}{{pass}}
> > > > > > >   
> > > > > > >       test text for site
> > > > > > >       
> > > > > > >   
> > > > > > >   
> > > > > > > {{=T( request.args(0).replace('_',' ').capitalize() )}}
> > > > > > > {{=form}}
> > > > > > > {{if request.args(0)=='login':}}
> > > > > > > {{if not 'register' in auth.settings.actions_disabled:}}
> > > > > > > register
> > > > > > > {{pass}}
> > > > > > > {{if not 'request_reset_password' in
> > > > > > > auth.settings.actions

[web2py] Re: why does adding form=auth() change the url?

2010-08-12 Thread thedangler
A I see

ok so I tried putting

auth.settings.login_url =URL('index', args='login')
auth.settings.logged_url = URL('index', args='profile')

in my model

but i end up with the error

SyntaxError: not enough information to build the url


On Aug 12, 7:59 pm, mdipierro  wrote:
> because I like that there is a trace of conversation. Here there is a
> trace.
>
> I would put that in the model after you define auth.
>
> On Aug 12, 6:56 pm, thedangler  wrote:
>
>
>
> > does this
>
> > auth.settings.login_url =URL('index', args='login')
> > auth.settings.logged_url = URL('index', args='profile')
>
> > go in the default controller in the index or in the view?
>
> > also why are you not in IRC freenode in web2py  conversations would
> > happen alot faster :)
>
> > thanks for the help
>
> > On Aug 12, 7:42 pm, mdipierro  wrote:
>
> > > no problem. Your problem is here:
>
> > > {{=T( request.args(0).replace('_',' ').capitalize() )}}
>
> > > since when you callhttp://.../index, request.args(0) is None and you
> > > cannot call .replace. Moreover "request.args(0).replace('_','
> > > ').capitalize()" is not a constant a string but a string that depends
> > > on user input and it should not be translated using T or you introduce
> > > a vulnerability.
>
> > > Now I see what you want to do. You are using the index() action as a
> > > replacement for the user() action.
>
> > > You can put form=auth() back but you also have to do:
>
> > > auth.settings.login_url =URL('index', args='login')
> > > auth.settings.logged_url = URL('index', args='profile')
>
> > > and replace the line above with
>
> > > {{=(request.args(0) or 'login').replace('_',' ').capitalize()}} > > h2>
>
> > > On Aug 12, 6:36 pm, thedangler  wrote:
>
> > > > sorry about the formatting.. it looks like crap
>
> > > > On Aug 12, 7:36 pm, thedangler  wrote:
>
> > > > > default controller
> > > > > def index():
> > > > >     """
> > > > >     example action using the internationalization operator T and
> > > > > flash
> > > > >     rendered by views/default/index.html or views/generic.html
> > > > >     """
> > > > >     response.flash = T('Welcome to web2py')
> > > > >     return dict(message=T('Welcome to MyApp'),form=auth.login())
> > > > > default/index.html
> > > > > {{extend 'layout.html'}}
> > > > > 
> > > > > {{if 'message' in globals():}}{{=H2(message)}}{{else:}}
> > > > > {{=BEAUTIFY(response._vars)}}{{pass}}
> > > > >   
> > > > >       test text for site
> > > > >       
> > > > >   
> > > > >   
> > > > > {{=T( request.args(0).replace('_',' ').capitalize() )}}
> > > > > {{=form}}
> > > > > {{if request.args(0)=='login':}}
> > > > > {{if not 'register' in auth.settings.actions_disabled:}}
> > > > > register
> > > > > {{pass}}
> > > > > {{if not 'request_reset_password' in
> > > > > auth.settings.actions_disabled:}}
> > > > > lost
> > > > > password
> > > > > {{pass}}
> > > > > {{pass}}
> > > > >   
> > > > > 
> > > > > Traceback (most recent call last):
> > > > >   File "gluon/restricted.py", line 178, in restricted
> > > > >   File "path/to/app/applications/myapp/views/default/index.html",
> > > > > line
> > > > > 52, in 
> > > > > AttributeError: 'NoneType' object has no attribute 'replace'
>
> > > > > On Aug 12, 7:08 pm, mdipierro  wrote:
>
> > > > > > Please post your complete function, the view and the complete
> > > > > > traceback. Some setting must be wrong.
>
> > > > > > On Aug 12, 5:37 pm, thedangler  wrote:
>
> > > > > > > Im so lost. I tried changing form=auth() to form=auth.login() but 
> > > > > > > i
> > > > > > > just get error AttributeError: 'NoneType' object has no attribute
> > > > > > > 'replace'
>
> > > > > > > Sorry this my first time using web2py
>
> > > > > > > Matt
>
> > > > > > > On Aug 12, 6:20 pm, mdipierro  wrote:
>
> > > > > > > > form=auth() generates forms depending on the context. If it 
> > > > > > > > determines
> > > > > > > > that the current user is not logged in it redirects you to what 
> > > > > > > > it
> > > > > > > > thinks is the login url. Do you wish to include a login form? 
> > > > > > > > If you
> > > > > > > > you need form=auth.login()
>
> > > > > > > > On Aug 12, 5:05 pm, thedangler  wrote:
>
> > > > > > > > > in my index controller I have return dict(message=T('Welcome 
> > > > > > > > > to
> > > > > > > > > Bewoost'),form=auth());
>
> > > > > > > > > And because I added form=auth() to the dict my index url 
> > > > > > > > > changes from
> > > > > > > > > domain.com/appname  to domain.com/appname/default/user/login
>
> > > > > > > > > How and why does it do that.
>
> > > > > > > > > How can I make it not do that.
>
> > > > > > > > > I tried doing
>
> > > > > > > > > auth.settings.login_url = URL('user', args='login')  but i 
> > > > > > > > > just get an
> > > > > > > > > error  plus i dont even know where to put it.
>
> > > > > > > > > thanks


[web2py] Re: why does adding form=auth() change the url?

2010-08-12 Thread thedangler
does this

auth.settings.login_url =URL('index', args='login')
auth.settings.logged_url = URL('index', args='profile')

go in the default controller in the index or in the view?


also why are you not in IRC freenode in web2py  conversations would
happen alot faster :)

thanks for the help

On Aug 12, 7:42 pm, mdipierro  wrote:
> no problem. Your problem is here:
>
> {{=T( request.args(0).replace('_',' ').capitalize() )}}
>
> since when you callhttp://.../index, request.args(0) is None and you
> cannot call .replace. Moreover "request.args(0).replace('_','
> ').capitalize()" is not a constant a string but a string that depends
> on user input and it should not be translated using T or you introduce
> a vulnerability.
>
> Now I see what you want to do. You are using the index() action as a
> replacement for the user() action.
>
> You can put form=auth() back but you also have to do:
>
> auth.settings.login_url =URL('index', args='login')
> auth.settings.logged_url = URL('index', args='profile')
>
> and replace the line above with
>
> {{=(request.args(0) or 'login').replace('_',' ').capitalize()}} h2>
>
> On Aug 12, 6:36 pm, thedangler  wrote:
>
>
>
> > sorry about the formatting.. it looks like crap
>
> > On Aug 12, 7:36 pm, thedangler  wrote:
>
> > > default controller
> > > def index():
> > >     """
> > >     example action using the internationalization operator T and
> > > flash
> > >     rendered by views/default/index.html or views/generic.html
> > >     """
> > >     response.flash = T('Welcome to web2py')
> > >     return dict(message=T('Welcome to MyApp'),form=auth.login())
> > > default/index.html
> > > {{extend 'layout.html'}}
> > > 
> > > {{if 'message' in globals():}}{{=H2(message)}}{{else:}}
> > > {{=BEAUTIFY(response._vars)}}{{pass}}
> > >   
> > >       test text for site
> > >       
> > >   
> > >   
> > > {{=T( request.args(0).replace('_',' ').capitalize() )}}
> > > {{=form}}
> > > {{if request.args(0)=='login':}}
> > > {{if not 'register' in auth.settings.actions_disabled:}}
> > > register
> > > {{pass}}
> > > {{if not 'request_reset_password' in
> > > auth.settings.actions_disabled:}}
> > > lost
> > > password
> > > {{pass}}
> > > {{pass}}
> > >   
> > > 
> > > Traceback (most recent call last):
> > >   File "gluon/restricted.py", line 178, in restricted
> > >   File "path/to/app/applications/myapp/views/default/index.html",
> > > line
> > > 52, in 
> > > AttributeError: 'NoneType' object has no attribute 'replace'
>
> > > On Aug 12, 7:08 pm, mdipierro  wrote:
>
> > > > Please post your complete function, the view and the complete
> > > > traceback. Some setting must be wrong.
>
> > > > On Aug 12, 5:37 pm, thedangler  wrote:
>
> > > > > Im so lost. I tried changing form=auth() to form=auth.login() but i
> > > > > just get error AttributeError: 'NoneType' object has no attribute
> > > > > 'replace'
>
> > > > > Sorry this my first time using web2py
>
> > > > > Matt
>
> > > > > On Aug 12, 6:20 pm, mdipierro  wrote:
>
> > > > > > form=auth() generates forms depending on the context. If it 
> > > > > > determines
> > > > > > that the current user is not logged in it redirects you to what it
> > > > > > thinks is the login url. Do you wish to include a login form? If you
> > > > > > you need form=auth.login()
>
> > > > > > On Aug 12, 5:05 pm, thedangler  wrote:
>
> > > > > > > in my index controller I have return dict(message=T('Welcome to
> > > > > > > Bewoost'),form=auth());
>
> > > > > > > And because I added form=auth() to the dict my index url changes 
> > > > > > > from
> > > > > > > domain.com/appname  to domain.com/appname/default/user/login
>
> > > > > > > How and why does it do that.
>
> > > > > > > How can I make it not do that.
>
> > > > > > > I tried doing
>
> > > > > > > auth.settings.login_url = URL('user', args='login')  but i just 
> > > > > > > get an
> > > > > > > error  plus i dont even know where to put it.
>
> > > > > > > thanks


[web2py] Re: why does adding form=auth() change the url?

2010-08-12 Thread thedangler
sorry about the formatting.. it looks like crap

On Aug 12, 7:36 pm, thedangler  wrote:
> default controller
> def index():
>     """
>     example action using the internationalization operator T and
> flash
>     rendered by views/default/index.html or views/generic.html
>     """
>     response.flash = T('Welcome to web2py')
>     return dict(message=T('Welcome to MyApp'),form=auth.login())
> default/index.html
> {{extend 'layout.html'}}
> 
> {{if 'message' in globals():}}{{=H2(message)}}{{else:}}
> {{=BEAUTIFY(response._vars)}}{{pass}}
>   
>       test text for site
>       
>   
>   
> {{=T( request.args(0).replace('_',' ').capitalize() )}}
> {{=form}}
> {{if request.args(0)=='login':}}
> {{if not 'register' in auth.settings.actions_disabled:}}
> register
> {{pass}}
> {{if not 'request_reset_password' in
> auth.settings.actions_disabled:}}
> lost
> password
> {{pass}}
> {{pass}}
>   
> 
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 178, in restricted
>   File "path/to/app/applications/myapp/views/default/index.html",
> line
> 52, in 
> AttributeError: 'NoneType' object has no attribute 'replace'
>
> On Aug 12, 7:08 pm, mdipierro  wrote:
>
>
>
> > Please post your complete function, the view and the complete
> > traceback. Some setting must be wrong.
>
> > On Aug 12, 5:37 pm, thedangler  wrote:
>
> > > Im so lost. I tried changing form=auth() to form=auth.login() but i
> > > just get error AttributeError: 'NoneType' object has no attribute
> > > 'replace'
>
> > > Sorry this my first time using web2py
>
> > > Matt
>
> > > On Aug 12, 6:20 pm, mdipierro  wrote:
>
> > > > form=auth() generates forms depending on the context. If it determines
> > > > that the current user is not logged in it redirects you to what it
> > > > thinks is the login url. Do you wish to include a login form? If you
> > > > you need form=auth.login()
>
> > > > On Aug 12, 5:05 pm, thedangler  wrote:
>
> > > > > in my index controller I have return dict(message=T('Welcome to
> > > > > Bewoost'),form=auth());
>
> > > > > And because I added form=auth() to the dict my index url changes from
> > > > > domain.com/appname  to domain.com/appname/default/user/login
>
> > > > > How and why does it do that.
>
> > > > > How can I make it not do that.
>
> > > > > I tried doing
>
> > > > > auth.settings.login_url = URL('user', args='login')  but i just get an
> > > > > error  plus i dont even know where to put it.
>
> > > > > thanks


[web2py] Re: why does adding form=auth() change the url?

2010-08-12 Thread thedangler
default controller
def index():
"""
example action using the internationalization operator T and
flash
rendered by views/default/index.html or views/generic.html
"""
response.flash = T('Welcome to web2py')
return dict(message=T('Welcome to MyApp'),form=auth.login())
default/index.html
{{extend 'layout.html'}}

{{if 'message' in globals():}}{{=H2(message)}}{{else:}}
{{=BEAUTIFY(response._vars)}}{{pass}}
  
  test text for site
  
  
  
{{=T( request.args(0).replace('_',' ').capitalize() )}}
{{=form}}
{{if request.args(0)=='login':}}
{{if not 'register' in auth.settings.actions_disabled:}}
register
{{pass}}
{{if not 'request_reset_password' in
auth.settings.actions_disabled:}}
lost
password
{{pass}}
{{pass}}
  

Traceback (most recent call last):
  File "gluon/restricted.py", line 178, in restricted
  File "path/to/app/applications/myapp/views/default/index.html",
line
52, in 
AttributeError: 'NoneType' object has no attribute 'replace'

On Aug 12, 7:08 pm, mdipierro  wrote:
> Please post your complete function, the view and the complete
> traceback. Some setting must be wrong.
>
> On Aug 12, 5:37 pm, thedangler  wrote:
>
>
>
> > Im so lost. I tried changing form=auth() to form=auth.login() but i
> > just get error AttributeError: 'NoneType' object has no attribute
> > 'replace'
>
> > Sorry this my first time using web2py
>
> > Matt
>
> > On Aug 12, 6:20 pm, mdipierro  wrote:
>
> > > form=auth() generates forms depending on the context. If it determines
> > > that the current user is not logged in it redirects you to what it
> > > thinks is the login url. Do you wish to include a login form? If you
> > > you need form=auth.login()
>
> > > On Aug 12, 5:05 pm, thedangler  wrote:
>
> > > > in my index controller I have return dict(message=T('Welcome to
> > > > Bewoost'),form=auth());
>
> > > > And because I added form=auth() to the dict my index url changes from
> > > > domain.com/appname  to domain.com/appname/default/user/login
>
> > > > How and why does it do that.
>
> > > > How can I make it not do that.
>
> > > > I tried doing
>
> > > > auth.settings.login_url = URL('user', args='login')  but i just get an
> > > > error  plus i dont even know where to put it.
>
> > > > thanks


[web2py] Re: why does adding form=auth() change the url?

2010-08-12 Thread thedangler
default controller

def index():
"""
example action using the internationalization operator T and flash
rendered by views/default/index.html or views/generic.html
"""
response.flash = T('Welcome to web2py')
return dict(message=T('Welcome to MyApp'),form=auth.login())


default/index.html

{{extend 'layout.html'}}

{{if 'message' in globals():}}{{=H2(message)}}{{else:}}
{{=BEAUTIFY(response._vars)}}{{pass}}
  
  The fastest way to be updated only for things you are interested
in.
  
  
  
{{=T( request.args(0).replace('_',' ').capitalize() )}}
{{if request.args(0)=='login':}}
{{if not 'register' in auth.settings.actions_disabled:}}
register
{{pass}}
{{if not 'request_reset_password' in auth.settings.actions_disabled:}}
lost
password
{{pass}}
{{pass}}
  



Traceback (most recent call last):
  File "gluon/restricted.py", line 178, in restricted
  File "path/to/app/applications/myapp/views/default/index.html", line
52, in 
AttributeError: 'NoneType' object has no attribute 'replace'



On Aug 12, 7:08 pm, mdipierro  wrote:
> Please post your complete function, the view and the complete
> traceback. Some setting must be wrong.
>
> On Aug 12, 5:37 pm, thedangler  wrote:
>
>
>
> > Im so lost. I tried changing form=auth() to form=auth.login() but i
> > just get error AttributeError: 'NoneType' object has no attribute
> > 'replace'
>
> > Sorry this my first time using web2py
>
> > Matt
>
> > On Aug 12, 6:20 pm, mdipierro  wrote:
>
> > > form=auth() generates forms depending on the context. If it determines
> > > that the current user is not logged in it redirects you to what it
> > > thinks is the login url. Do you wish to include a login form? If you
> > > you need form=auth.login()
>
> > > On Aug 12, 5:05 pm, thedangler  wrote:
>
> > > > in my index controller I have return dict(message=T('Welcome to
> > > > Bewoost'),form=auth());
>
> > > > And because I added form=auth() to the dict my index url changes from
> > > > domain.com/appname  to domain.com/appname/default/user/login
>
> > > > How and why does it do that.
>
> > > > How can I make it not do that.
>
> > > > I tried doing
>
> > > > auth.settings.login_url = URL('user', args='login')  but i just get an
> > > > error  plus i dont even know where to put it.
>
> > > > thanks


[web2py] Re: why does adding form=auth() change the url?

2010-08-12 Thread thedangler
Im so lost. I tried changing form=auth() to form=auth.login() but i
just get error AttributeError: 'NoneType' object has no attribute
'replace'

Sorry this my first time using web2py

Matt

On Aug 12, 6:20 pm, mdipierro  wrote:
> form=auth() generates forms depending on the context. If it determines
> that the current user is not logged in it redirects you to what it
> thinks is the login url. Do you wish to include a login form? If you
> you need form=auth.login()
>
> On Aug 12, 5:05 pm, thedangler  wrote:
>
>
>
> > in my index controller I have return dict(message=T('Welcome to
> > Bewoost'),form=auth());
>
> > And because I added form=auth() to the dict my index url changes from
> > domain.com/appname  to domain.com/appname/default/user/login
>
> > How and why does it do that.
>
> > How can I make it not do that.
>
> > I tried doing
>
> > auth.settings.login_url = URL('user', args='login')  but i just get an
> > error  plus i dont even know where to put it.
>
> > thanks


[web2py] why does adding form=auth() change the url?

2010-08-12 Thread thedangler
in my index controller I have return dict(message=T('Welcome to
Bewoost'),form=auth());

And because I added form=auth() to the dict my index url changes from
domain.com/appname  to domain.com/appname/default/user/login

How and why does it do that.

How can I make it not do that.

I tried doing

auth.settings.login_url = URL('user', args='login')  but i just get an
error  plus i dont even know where to put it.


thanks


[web2py] Re: login on index page

2010-08-12 Thread thedangler
But I dont understand how it overrides the curent page and still draws
the right page. I resorted to thinking it was magic.

where do place auth.settings.login_url = URL('index',args='login')

does it go in my default controller before iload the form=auth() ?



On Aug 11, 9:32 pm, "mr.freeze"  wrote:
> Have you tried this?:
> auth.settings.login_url = URL('index',args='login')
>
> On Aug 11, 8:17 pm, thedangler  wrote:
>
>
>
> > Hello, im trying to have the login on my index page, I got the login
> > form showing up on the index page but the url is not desirable.
> > I want it to be domain.com/myapp but when I put the login form on the
> > index page it automatically changes to domain.com/myapp/default/user/
> > login
>
> > Why is it changing to that link even though the form is being printed
> > out on the index.html page


[web2py] login on index page

2010-08-11 Thread thedangler
Hello, im trying to have the login on my index page, I got the login
form showing up on the index page but the url is not desirable.
I want it to be domain.com/myapp but when I put the login form on the
index page it automatically changes to domain.com/myapp/default/user/
login

Why is it changing to that link even though the form is being printed
out on the index.html page


[web2py] Looking for specific video Demo

2010-07-19 Thread thedangler
Hello, I found a video once that showed how to do REST and returning a
view as html or json or xml just by putting @json or @xml over the
method.

Also I was looking for the video where it shows you have to change the
html by using a free html template taken from some template site.


If anyone knows what videos these are can you please link me?

Thank you


[web2py] large sites/application.

2010-05-13 Thread thedangler
I'm confused when to make apps. I'll be making a pretty decent size
website and it has over 30 tables. The site will have different
functionalities and for the most part i have only seen code for apps
that do two or one thing.

So do i make multiple apps. If so how do i know when to make a new
one. If not is there a proper way to build large applications.

Thank you.