librelist archives

« back to archive

Flask on Jython

Flask on Jython

From:
Col Wilson
Date:
2011-01-20 @ 12:14
I don't really know what I mean by this, so let's call it an open topic, but
I can see a certain appeal in producing a war file. e.g. Amazons "Elastic
Beanstalk"

Re: [flask] Flask on Jython

From:
Steven Kryskalla
Date:
2011-01-20 @ 22:50
On Thu, Jan 20, 2011 at 7:14 AM, Col Wilson <colwilson@bcs.org> wrote:
> I don't really know what I mean by this, so let's call it an open topic, but
> I can see a certain appeal in producing a war file. e.g. Amazons "Elastic
> Beanstalk"
>

I remember trying this a few months ago, and it seemed to work. Sorry,
my memory is bad. Here is what I can tell from my shell history:

you can use snakefight (http://pypi.python.org/pypi/snakefight), plus
some commands like this:
jython setup.py bdist_war --paste-config production.ini
jython setup.py bdist_war --web-xml web.xml

I seem to remember the bdist_war thing only works on pylons apps. But,
you can edit the resulting web.xml to make it work with any other WSGI
app (e.g. flask).

The resulting war file is quite big (30-50M), since it includes the
entire python distribution and all site-packages. You can trim this
quite a bit (under 30M).

wget 
"http://downloads.sourceforge.net/project/jython/jython/2.5.1/jython_installer-2.5.1.jar?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fjython%2Ffiles%2Fjython&ts=1283534883&use_mirror=iweb"
java -jar jython_installer-2.5.1.jar --console
cd jython-2.5.1/
wget http://python-distribute.org/distribute_setup.py
./jython distribute_setup.py·
bin/easy_install virtualenv
bin/virtualenv app
cd app
bin/easy_install snakefight
bin/easy_install pylons
bin/paster create -t pylons hello
../bin/jython setup.py bdist_war --paste-config production.ini
../bin/jython setup.py bdist_war --web-xml web.xml

-Steve

Re: [flask] Flask on Jython

From:
Col Wilson
Date:
2011-01-20 @ 23:11
Wow! Thanks. There's a lot there, so I'll have a go soon.

On Thu, Jan 20, 2011 at 10:50 PM, Steven Kryskalla <skryskalla@gmail.com>wrote:

> On Thu, Jan 20, 2011 at 7:14 AM, Col Wilson <colwilson@bcs.org> wrote:
> > I don't really know what I mean by this, so let's call it an open topic,
> but
> > I can see a certain appeal in producing a war file. e.g. Amazons "Elastic
> > Beanstalk"
> >
>
> I remember trying this a few months ago, and it seemed to work. Sorry,
> my memory is bad. Here is what I can tell from my shell history:
>
> you can use snakefight (http://pypi.python.org/pypi/snakefight), plus
> some commands like this:
> jython setup.py bdist_war --paste-config production.ini
> jython setup.py bdist_war --web-xml web.xml
>
> I seem to remember the bdist_war thing only works on pylons apps. But,
> you can edit the resulting web.xml to make it work with any other WSGI
> app (e.g. flask).
>
> The resulting war file is quite big (30-50M), since it includes the
> entire python distribution and all site-packages. You can trim this
> quite a bit (under 30M).
>
> wget "
> 
http://downloads.sourceforge.net/project/jython/jython/2.5.1/jython_installer-2.5.1.jar?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fjython%2Ffiles%2Fjython&ts=1283534883&use_mirror=iweb
> "
> java -jar jython_installer-2.5.1.jar --console
> cd jython-2.5.1/
> wget http://python-distribute.org/distribute_setup.py
> ./jython distribute_setup.py·
> bin/easy_install virtualenv
> bin/virtualenv app
> cd app
> bin/easy_install snakefight
> bin/easy_install pylons
> bin/paster create -t pylons hello
> ../bin/jython setup.py bdist_war --paste-config production.ini
> ../bin/jython setup.py bdist_war --web-xml web.xml
>
> -Steve
>

Re: [flask] Flask on Jython

From:
Kazu Linden
Date:
2011-01-20 @ 22:32
What you're trying to say, is that it would be really cool to deploy Flask
webapps using Amazon's "Elastic Beanstalk" by running your app using Jython,
which in turn could run on Beanstalk.

On Thu, Jan 20, 2011 at 4:14 AM, Col Wilson <colwilson@bcs.org> wrote:

> I don't really know what I mean by this, so let's call it an open topic,
> but I can see a certain appeal in producing a war file. e.g. Amazons
> "Elastic Beanstalk"
>