Running, as standalone, a Python script developed to run under mod_python?

22 views
Skip to first unread message

Omer Zak

unread,
May 1, 2013, 3:21:13 AM5/1/13
to PyWeb-IL
אני מנסה להריץ קוד ישן יחסית, שמצאתי, לצורך בדיקות.
הקוד נבנה במקור כדי לרוץ תחת mod_python של Apache.
מכיוון שאינני רוצה להתקין שרת Apache רק בשביל להריץ קוד זה, אני מעוניין
לדעת אם יש דרך או שיטה להריץ את הקוד במצב standalone (כמו ש-Django למשל
יודע להריץ קוד בלי צורך להפעיל שרת ווב).

חיפוש ב-Google לא הניב תוצאות רלבנטיות.

האם יש למישהו ידע או סקריפט שאפשר לחברו לקוד שנבנה לרוץ תחת mod_python
כך שהעסק ירוץ ב-standalone וייתן שרות מפורט 80 (או פורט אחר שייקבע
כפרמטר)?

--- עומר


--
Your liberty to swing your fist ends just where my nose begins.
Your freedom of expression ends where my freedom of expression begins.
Your freedom of religion ends where my rights for equality and
accessibility begin.
My own blog is at http://www.zak.co.il/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html

שי

unread,
May 2, 2013, 1:17:57 AM5/2/13
to pywe...@googlegroups.com
Why not just install Apache it's just one apt-get /yum command and 4 configuration lines

Omer Zak

unread,
May 2, 2013, 3:41:38 AM5/2/13
to pywe...@googlegroups.com
On Wed, 2013-05-01 at 22:17 -0700, שי wrote:
> Why not just install Apache it's just one apt-get /yum command and 4 configuration lines

1. Apache would be an overkill for this use case.
2. The script was designed to work with Apache's mod_python which is now
deprecated.

--- Omer


--
$ python
>>> type(type(type))
<type 'type'> My own blog is at http://www.zak.co.il/tddpirate/

Yuval Adam

unread,
May 2, 2013, 3:53:19 AM5/2/13
to pywe...@googlegroups.com
You're asking for solution for a problem with legacy code and then stating that the obvious (and easiest) solution is an overkill.
Not sure where you're heading with this.

If you feel like it, migrate your code to a proper WSGI container, and then you'll have lots of other options.
Else, just deploy it on any Apache instance you can find.
--
You received this message because you are subscribed to the Google Groups "PyWeb-IL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyweb-il+u...@googlegroups.com.
To post to this group, send email to pywe...@googlegroups.com.

Amit Aronovitch

unread,
May 2, 2013, 3:19:54 PM5/2/13
to pywe...@googlegroups.com

On Thursday, May 2, 2013 at 10:41 AM, Omer Zak wrote:

On Wed, 2013-05-01 at 22:17 -0700, שי wrote:
Why not just install Apache it's just one apt-get /yum command and 4 configuration lines

1. Apache would be an overkill for this use case.
2. The script was designed to work with Apache's mod_python which is now
deprecated.

--- Omer


On Thu, May 2, 2013 at 10:53 AM, Yuval Adam <yuv...@gmail.com> wrote:

> You're asking for solution for a problem with legacy code and then stating that the obvious (and easiest) solution is an overkill.
> Not sure where you're heading with this.
>
> If you feel like it, migrate your code to a proper WSGI container, and then you'll have lots of other options.
> Else, just deploy it on any Apache instance you can find.


Or, maybe heading 
http://sourceforge.net/projects/mptomwsgi/  there?

Never heard of that one before - just googled it up (if an idea seems to suggest itself - maybe someone had already done it).
Interesing: anyone tried this? similar alternative?

AA

Omer Zak

unread,
May 2, 2013, 3:39:48 PM5/2/13
to pywe...@googlegroups.com
I am indeed after something similar. Except that I'd like to run the
script in almost-standalone mode.
In other words, together with at most one more script, which will open a
socket and listen to HTTP requests there. Much like the standalone mode
of running a Django application.

--- Omer


--
Your liberty to swing your fist ends just where my nose begins.
Your freedom of expression ends where my freedom of expression begins.
Your freedom of religion ends where my rights for equality and
accessibility begin.

Amit Aronovitch

unread,
May 2, 2013, 5:17:53 PM5/2/13
to pywe...@googlegroups.com
I'm not a web-guy, but it seems that nowadays most frameworks come with their own WSGI supporting web server, and apps with a standalone "serve" mode typically use one of these (e.g. ipython uses Tornado).
Werkzeug has a "serving" module, which will probably fill the missing functionality with less overkilling (Hatta wiki uses this).

I wonder what is the minimal available package that provides a WSGI compatible http server?
Personally, I'm intersted in a minimal server with some authentication support (built in, plugin, or makes-it-easy-to-add-yourself) that could be used to serve Mercurial repos to local intranet via hgweb (as opposed to hg serve) - any recommendations?

 AA


Reply all
Reply to author
Forward
0 new messages