Hi Guys,
I have two moduel name admin.py and frontend.py ,and each module has the
function named index() and route are @admin.route('/') and
@frontend.route('/')
and register them as below:
*app.register_module(admin,url_prefix='/admin')
app.register_module(frontend)
*but when i access the url http://localhost:5000/ or
http://localhost:5000/admin/, it always to frontend index function, please
help, many thanks.*
*
--
Best Regards
-Simon
===========================
msn:simonli@live.com <msn%3Asimonli@live.com>
skype:simonli999
Yes, you can Why ? On 07/16/2010 11:50 AM, Simon Li wrote: > Hi Guys, > > I have two moduel name admin.py and frontend.py ,and each module has the > function named index() and route are @admin.route('/') and > @frontend.route('/') > > and register them as below: > /app.register_module(admin,url_prefix='/admin') > app.register_module(frontend) > > /but when i access the url http://localhost:5000/ or > http://localhost:5000/admin/, it always to frontend index function, > please help, many thanks./ > / > -- > Best Regards > -Simon > =========================== > msn:simonli@live.com <mailto:msn%3Asimonli@live.com> > skype:simonli999
What happens when you do: app.register_module(frontend, url_prefix="") On 16 July 2010 11:04, Stephane Wirtel <stephane@wirtel.be> wrote: > Yes, you can > > Why ? > On 07/16/2010 11:50 AM, Simon Li wrote: >> Hi Guys, >> >> I have two moduel name admin.py and frontend.py ,and each module has the >> function named index() and route are @admin.route('/') and >> @frontend.route('/') >> >> and register them as below: >> /app.register_module(admin,url_prefix='/admin') >> app.register_module(frontend) >> >> /but when i access the url http://localhost:5000/ or >> http://localhost:5000/admin/, it always to frontend index function, >> please help, many thanks./ >> / >> -- >> Best Regards >> -Simon >> =========================== >> msn:simonli@live.com <mailto:msn%3Asimonli@live.com> >> skype:simonli999 > >
Hi, in http://flask.pocoo.org/docs/patterns/packages/ Modules and Resources section how to register these two views? On Fri, Jul 16, 2010 at 6:08 PM, Dan Jacob <danjac354@gmail.com> wrote: > What happens when you do: > > app.register_module(frontend, url_prefix="") > > > On 16 July 2010 11:04, Stephane Wirtel <stephane@wirtel.be> wrote: > > Yes, you can > > > > Why ? > > On 07/16/2010 11:50 AM, Simon Li wrote: > >> Hi Guys, > >> > >> I have two moduel name admin.py and frontend.py ,and each module has the > >> function named index() and route are @admin.route('/') and > >> @frontend.route('/') > >> > >> and register them as below: > >> /app.register_module(admin,url_prefix='/admin') > >> app.register_module(frontend) > >> > >> /but when i access the url http://localhost:5000/ or > >> http://localhost:5000/admin/, it always to frontend index function, > >> please help, many thanks./ > >> / > >> -- > >> Best Regards > >> -Simon > >> =========================== > >> msn:simonli@live.com <msn%3Asimonli@live.com> <mailto: > msn%3Asimonli@live.com <msn%253Asimonli@live.com>> > >> skype:simonli999 > > > > > -- Best Regards -Simon =========================== msn:simonli@live.com <msn%3Asimonli@live.com> skype:simonli999
The modules and resources section also confuses me. It is not obvious how to use this pattern. -- Thadeus On Fri, Jul 16, 2010 at 11:01 AM, Simon Li <simonli.lb@gmail.com> wrote: > Hi, > > in http://flask.pocoo.org/docs/patterns/packages/ > > Modules and Resources section > > how to register these two views? > > > On Fri, Jul 16, 2010 at 6:08 PM, Dan Jacob <danjac354@gmail.com> wrote: >> >> What happens when you do: >> >> app.register_module(frontend, url_prefix="") >> >> >> On 16 July 2010 11:04, Stephane Wirtel <stephane@wirtel.be> wrote: >> > Yes, you can >> > >> > Why ? >> > On 07/16/2010 11:50 AM, Simon Li wrote: >> >> Hi Guys, >> >> >> >> I have two moduel name admin.py and frontend.py ,and each module has >> >> the >> >> function named index() and route are @admin.route('/') and >> >> @frontend.route('/') >> >> >> >> and register them as below: >> >> /app.register_module(admin,url_prefix='/admin') >> >> app.register_module(frontend) >> >> >> >> /but when i access the url http://localhost:5000/ or >> >> http://localhost:5000/admin/, it always to frontend index function, >> >> please help, many thanks./ >> >> / >> >> -- >> >> Best Regards >> >> -Simon >> >> =========================== >> >> msn:simonli@live.com <mailto:msn%3Asimonli@live.com> >> >> skype:simonli999 >> > >> > > > > > -- > Best Regards > -Simon > =========================== > msn:simonli@live.com > skype:simonli999 >