librelist archives

« back to archive

Preliminary doc on embedding Flask+uWSGI in the same binary

Preliminary doc on embedding Flask+uWSGI in the same binary

From:
Roberto De Ioris
Date:
2011-07-18 @ 17:28
Hi, everyone

The current development branch of  uWSGi supports embedding files in the 
server binary.

You can use this technic to create single-file apps, or to modify the 
server default behaviors (and for sure users will find other ways to abuse
this functionality)

I have made a little tutorial on creating a single binary for Flask:

http://projects.unbit.it/uwsgi/wiki/EmbedFlask

Obviously it is all a work-in-progress, so do not expect perfection :)

--
Roberto De Ioris
http://unbit.it

Re: [flask] Preliminary doc on embedding Flask+uWSGI in the same binary

From:
Rafael Martins
Date:
2011-07-18 @ 20:06
On Mon, Jul 18, 2011 at 2:28 PM, Roberto De Ioris <roberto@unbit.it> wrote:
> Hi, everyone
>
> The current development branch of  uWSGi supports embedding files in the
server binary.
>
> You can use this technic to create single-file apps, or to modify the 
server default behaviors (and for sure users will find other ways to abuse
this functionality)
>
> I have made a little tutorial on creating a single binary for Flask:
>
> http://projects.unbit.it/uwsgi/wiki/EmbedFlask
>
> Obviously it is all a work-in-progress, so do not expect perfection :)

The main issue I can see is the Template Loader marking all the
templates as always outdated.

Otherwise, looks like a good start point :)

Regards

-- 
Rafael Goncalves Martins
http://rafaelmartins.eng.br/

Re: [flask] Preliminary doc on embedding Flask+uWSGI in the same binary

From:
Roberto De Ioris
Date:
2011-07-18 @ 20:08
> On Mon, Jul 18, 2011 at 2:28 PM, Roberto De Ioris <roberto@unbit.it>
> wrote:
>> Hi, everyone
>>
>> The current development branch of  uWSGi supports embedding files in
>> the server binary.
>>
>> You can use this technic to create single-file apps, or to modify the
>> server default behaviors (and for sure users will find other ways to
>> abuse this functionality)
>>
>> I have made a little tutorial on creating a single binary for Flask:
>>
>> http://projects.unbit.it/uwsgi/wiki/EmbedFlask
>>
>> Obviously it is all a work-in-progress, so do not expect perfection :)
>
> The main issue I can see is the Template Loader marking all the
> templates as always outdated.


Hmm, not quite sure about this:

"""The last item in the tuple is the uptodate function. If auto reloading
is enabled it’s always called to check if the template changed. No
arguments are passed so the function must store the old state somewhere
(for example in a closure). If it returns False the template will be
reloaded."""


i suppose returning True, will mean "up to date".

Am i wrong ?


-- 
Roberto De Ioris
http://unbit.it