Hi, I'm Italo. Nice to meet you. Lovely micro-framework.
By the way, i started an app here and had this nasty template not found
problem. My app directory tree is like this:
project/
..main.py
..templates/
....base.html
..apps/
....__init__.py
....auth/
......views.py
......templates/
........login.html
In auth/views.py i have:
*# auth/views.py
from* flask *import* Module, render_template, url_for, redirect
auth = Module(__name__)
*@auth.route('/login')*
*def* login():
....return render_template("login.html")
login.html gives me a templatenotfound error : / Does anyone know what am I
doing wrong?
Thanks in advance.
--
"A arrogância é a arma dos fracos."
===========================
Italo Moreira Campelo Maia
Graduado em Ciência da Computação - UECE
Desenvolvedor WEB e Desktop (Java, Python, Lua)
Coordenador do Pug-CE
-----------------------------------------------------
http://www.italomaia.com/
http://twitter.com/italomaia/
http://eusouolobomau.blogspot.com/
-----------------------------------------------------
turtle linux 910 - http://tiny.cc/blogturtle910
===========================
Hi Italo
A few weeks ago I posted to the list looking for flask developer as I wanted
to pay to have these sort of examples coded up and added to the examples
folder, unfortunately I did not received any response.
Have you managed to figure it out? I'm happy to send my example although
it's very basic and looks like this:
[root@ahlx veritrack]# pwd
/var/www/html/veritrack
[root@ahlx veritrack]# find . | grep -v cache
.
./veritrack
./veritrack/__init__.pyc
./veritrack/static
./veritrack/views.pyc
./veritrack/views.py
./veritrack/templates
./veritrack/__init__.py
./run
./run/gunicorn.pid
./server.py
./tmp
./log
./log/gunicorn.log
[root@ahlx veritrack]#
The flask 0.6dev documentation goes into further detail however I think my
lack of Python experience makes it difficult for me to get it working.
It would be great to have some examples of the two "getting bigger" layouts:
/yourapplication
/yourapplication
/__init__.py
/views
__init__.py
admin.py
frontend.py
/static
/style.css
/templates
layout.html
index.html
login.html
...
This one makes me think Flask can take some of the bigger frameworks:h
/yourapplication
__init__.py
/apps
/frontend
__init__.py
views.py
/static
style.css
/templates
index.html
about.html
...
/admin
__init__.py
views.py
/static
style.css
/templates
list_items.html
show_item.html
My offer to purchase examples still stands if anybody has the time?
Cheers
Bruce
On Mon, Jul 19, 2010 at 7:15 AM, Italo Maia <italo.maia@gmail.com> wrote:
> Hi, I'm Italo. Nice to meet you. Lovely micro-framework.
>
> By the way, i started an app here and had this nasty template not found
> problem. My app directory tree is like this:
>
> project/
> ..main.py
> ..templates/
> ....base.html
> ..apps/
> ....__init__.py
> ....auth/
> ......views.py
> ......templates/
> ........login.html
>
> In auth/views.py i have:
>
> *# auth/views.py
> from* flask *import* Module, render_template, url_for, redirect
> auth = Module(__name__)
>
> *@auth.route('/login')*
> *def* login():
> ....return render_template("login.html")
>
>
> login.html gives me a templatenotfound error : / Does anyone know what am I
> doing wrong?
> Thanks in advance.
>
> --
> "A arrogância é a arma dos fracos."
>
> ===========================
> Italo Moreira Campelo Maia
> Graduado em Ciência da Computação - UECE
> Desenvolvedor WEB e Desktop (Java, Python, Lua)
> Coordenador do Pug-CE
> -----------------------------------------------------
> http://www.italomaia.com/
> http://twitter.com/italomaia/
> http://eusouolobomau.blogspot.com/
> -----------------------------------------------------
> turtle linux 910 - http://tiny.cc/blogturtle910
> ===========================
>
>
Hi, I'm working on a spare-time project at the moment. It's basically a Reddit clone - not very interesting in of itself, but really just an experiment in building a larger-scale application using Flask + extensions. Source code is here: http://bitbucket.org/danjac/newsmeme It's very, very much a work in progress, so please don't post tickets just yet. I'll deploy a demo on my Webfaction server when it's in decent shape. I'll also do a write up on the architecture and any problems/issues/gotchas either here on the mailing list or my blog when I'm done. So far - looking good, no major problems with Flask at all really. It's also a good testing ground for extensions, particularly ones I've written, and it's helped to fix issues upstream. On 21 July 2010 17:07, bruce bushby <bruce.bushby@googlemail.com> wrote: > Hi Italo > > A few weeks ago I posted to the list looking for flask developer as I wanted > to pay to have these sort of examples coded up and added to the examples > folder, unfortunately I did not received any response. > > Have you managed to figure it out? I'm happy to send my example although > it's very basic and looks like this: > [root@ahlx veritrack]# pwd > /var/www/html/veritrack > [root@ahlx veritrack]# find . | grep -v cache > . > ./veritrack > ./veritrack/__init__.pyc > ./veritrack/static > ./veritrack/views.pyc > ./veritrack/views.py > ./veritrack/templates > ./veritrack/__init__.py > ./run > ./run/gunicorn.pid > ./server.py > ./tmp > ./log > ./log/gunicorn.log > [root@ahlx veritrack]# > > > The flask 0.6dev documentation goes into further detail however I think my > lack of Python experience makes it difficult for me to get it working. > > It would be great to have some examples of the two "getting bigger" layouts: > > /yourapplication > /yourapplication > /__init__.py > /views > __init__.py > admin.py > frontend.py > /static > /style.css > /templates > layout.html > index.html > login.html > ... > > > This one makes me think Flask can take some of the bigger frameworks:h > > /yourapplication > __init__.py > /apps > /frontend > __init__.py > views.py > /static > style.css > /templates > index.html > about.html > ... > /admin > __init__.py > views.py > /static > style.css > /templates > list_items.html > show_item.html > > > > My offer to purchase examples still stands if anybody has the time? > > Cheers > Bruce > > > > > > > > > > On Mon, Jul 19, 2010 at 7:15 AM, Italo Maia <italo.maia@gmail.com> wrote: >> >> Hi, I'm Italo. Nice to meet you. Lovely micro-framework. >> >> By the way, i started an app here and had this nasty template not found >> problem. My app directory tree is like this: >> >> project/ >> ..main.py >> ..templates/ >> ....base.html >> ..apps/ >> ....__init__.py >> ....auth/ >> ......views.py >> ......templates/ >> ........login.html >> >> In auth/views.py i have: >> >> # auth/views.py >> from flask import Module, render_template, url_for, redirect >> auth = Module(__name__) >> >> @auth.route('/login') >> def login(): >> ....return render_template("login.html") >> >> login.html gives me a templatenotfound error : / Does anyone know what am >> I doing wrong? >> Thanks in advance. >> -- >> "A arrogância é a arma dos fracos." >> >> =========================== >> Italo Moreira Campelo Maia >> Graduado em Ciência da Computação - UECE >> Desenvolvedor WEB e Desktop (Java, Python, Lua) >> Coordenador do Pug-CE >> ----------------------------------------------------- >> http://www.italomaia.com/ >> http://twitter.com/italomaia/ >> http://eusouolobomau.blogspot.com/ >> ----------------------------------------------------- >> turtle linux 910 - http://tiny.cc/blogturtle910 >> =========================== >> > >
Hi Dan Thanks for posting this!!! It's a nice compact example of what I've been struggling with. Cheers Bruce On Wed, Jul 21, 2010 at 5:19 PM, Dan Jacob <danjac354@gmail.com> wrote: > Hi, > > I'm working on a spare-time project at the moment. It's basically a > Reddit clone - not very interesting in of itself, but really just an > experiment in building a larger-scale application using Flask + > extensions. > > Source code is here: > > http://bitbucket.org/danjac/newsmeme > > It's very, very much a work in progress, so please don't post tickets > just yet. I'll deploy a demo on my Webfaction server when it's in > decent shape. > > I'll also do a write up on the architecture and any > problems/issues/gotchas either here on the mailing list or my blog > when I'm done. > > So far - looking good, no major problems with Flask at all really. > It's also a good testing ground for extensions, particularly ones I've > written, and it's helped to fix issues upstream. > >
Hi, On 7/19/10 8:15 AM, Italo Maia wrote: > login.html gives me a templatenotfound error : / Does anyone know what > am I doing wrong? > Thanks in advance. You have to do "render_template('auth/login.html')". The module name is not automatically put in front of templates. Regards, Armin
Is there any "becoming big" open source project that i can take as example? 2010/7/19 Armin Ronacher <armin.ronacher@active-4.com> > Hi, > > On 7/19/10 8:15 AM, Italo Maia wrote: > > login.html gives me a templatenotfound error : / Does anyone know what > > am I doing wrong? > > Thanks in advance. > You have to do "render_template('auth/login.html')". The module name is > not automatically put in front of templates. > > > Regards, > Armin > -- "A arrogância é a arma dos fracos." =========================== Italo Moreira Campelo Maia Graduado em Ciência da Computação - UECE Desenvolvedor WEB e Desktop (Java, Python, Lua) Coordenador do Pug-CE ----------------------------------------------------- http://www.italomaia.com/ http://twitter.com/italomaia/ http://eusouolobomau.blogspot.com/ ----------------------------------------------------- turtle linux 910 - http://tiny.cc/blogturtle910 ===========================
could not decode message
On Mon, Jul 19, 2010 at 9:09 PM, edgar <edgarymr@gmail.com> wrote: > tell me how to unsubscription this mail list. > > thanks... > > regards > edgar > edgarymr@gmail.com To unsubscribe, please send an email to flask-unsubscribe@librelist.com See: http://librelist.com/help.html -Ron
That doesn't work either. This apps/auth/login.html doesn't work as well. 2010/7/19 Armin Ronacher <armin.ronacher@active-4.com> > Hi, > > On 7/19/10 8:15 AM, Italo Maia wrote: > > login.html gives me a templatenotfound error : / Does anyone know what > > am I doing wrong? > > Thanks in advance. > You have to do "render_template('auth/login.html')". The module name is > not automatically put in front of templates. > > > Regards, > Armin > -- "A arrogância é a arma dos fracos." =========================== Italo Moreira Campelo Maia Graduado em Ciência da Computação - UECE Desenvolvedor WEB e Desktop (Java, Python, Lua) Coordenador do Pug-CE ----------------------------------------------------- http://www.italomaia.com/ http://twitter.com/italomaia/ http://eusouolobomau.blogspot.com/ ----------------------------------------------------- turtle linux 910 - http://tiny.cc/blogturtle910 ===========================
Just tried checking jinja_env from command line. It doesn't even listen the
login.html template. Is there something special i need to do in main.py for
flask to find the templates? Right now, auth_app is loaded like this:
*from* apps.auth.views *import* auth
app = Flask("project")
app.register_module(auth)
app.run()
2010/7/19 Italo Maia <italo.maia@gmail.com>
> That doesn't work either. This apps/auth/login.html doesn't work as well.
>
> 2010/7/19 Armin Ronacher <armin.ronacher@active-4.com>
>
> Hi,
>>
>> On 7/19/10 8:15 AM, Italo Maia wrote:
>> > login.html gives me a templatenotfound error : / Does anyone know what
>> > am I doing wrong?
>> > Thanks in advance.
>> You have to do "render_template('auth/login.html')". The module name is
>> not automatically put in front of templates.
>>
>>
>> Regards,
>> Armin
>>
>
>
>
> --
> "A arrogância é a arma dos fracos."
>
> ===========================
> Italo Moreira Campelo Maia
> Graduado em Ciência da Computação - UECE
> Desenvolvedor WEB e Desktop (Java, Python, Lua)
> Coordenador do Pug-CE
> -----------------------------------------------------
> http://www.italomaia.com/
> http://twitter.com/italomaia/
> http://eusouolobomau.blogspot.com/
> -----------------------------------------------------
> turtle linux 910 - http://tiny.cc/blogturtle910
> ===========================
>
--
"A arrogância é a arma dos fracos."
===========================
Italo Moreira Campelo Maia
Graduado em Ciência da Computação - UECE
Desenvolvedor WEB e Desktop (Java, Python, Lua)
Coordenador do Pug-CE
-----------------------------------------------------
http://www.italomaia.com/
http://twitter.com/italomaia/
http://eusouolobomau.blogspot.com/
-----------------------------------------------------
turtle linux 910 - http://tiny.cc/blogturtle910
===========================
Problem was i did not set the module url_prefix. gee! Solved = ] app.register_module(auth, url_prefix="/auth") *# <= this works!* 2010/7/20 Italo Maia <italo.maia@gmail.com> > Just tried checking jinja_env from command line. It doesn't even listen the > login.html template. Is there something special i need to do in main.py for > flask to find the templates? Right now, auth_app is loaded like this: > > *from* apps.auth.views *import* auth > app = Flask("project") > app.register_module(auth) > app.run() > > > 2010/7/19 Italo Maia <italo.maia@gmail.com> > > That doesn't work either. This apps/auth/login.html doesn't work as well. >> >> 2010/7/19 Armin Ronacher <armin.ronacher@active-4.com> >> >> Hi, >>> >>> On 7/19/10 8:15 AM, Italo Maia wrote: >>> > login.html gives me a templatenotfound error : / Does anyone know what >>> > am I doing wrong? >>> > Thanks in advance. >>> You have to do "render_template('auth/login.html')". The module name is >>> not automatically put in front of templates. >>> >>> >>> Regards, >>> Armin >>> >> >> >> >> -- >> "A arrogância é a arma dos fracos." >> >> =========================== >> Italo Moreira Campelo Maia >> Graduado em Ciência da Computação - UECE >> Desenvolvedor WEB e Desktop (Java, Python, Lua) >> Coordenador do Pug-CE >> ----------------------------------------------------- >> http://www.italomaia.com/ >> http://twitter.com/italomaia/ >> http://eusouolobomau.blogspot.com/ >> ----------------------------------------------------- >> turtle linux 910 - http://tiny.cc/blogturtle910 >> =========================== >> > > > > -- > "A arrogância é a arma dos fracos." > > =========================== > Italo Moreira Campelo Maia > Graduado em Ciência da Computação - UECE > Desenvolvedor WEB e Desktop (Java, Python, Lua) > Coordenador do Pug-CE > ----------------------------------------------------- > http://www.italomaia.com/ > http://twitter.com/italomaia/ > http://eusouolobomau.blogspot.com/ > ----------------------------------------------------- > turtle linux 910 - http://tiny.cc/blogturtle910 > =========================== > -- "A arrogância é a arma dos fracos." =========================== Italo Moreira Campelo Maia Graduado em Ciência da Computação - UECE Desenvolvedor WEB e Desktop (Java, Python, Lua) Coordenador do Pug-CE ----------------------------------------------------- http://www.italomaia.com/ http://twitter.com/italomaia/ http://eusouolobomau.blogspot.com/ ----------------------------------------------------- turtle linux 910 - http://tiny.cc/blogturtle910 ===========================