Recipie/tutorial for Django and no apache?

19 views
Skip to first unread message

MrMuffin

unread,
Aug 7, 2005, 1:59:27 PM8/7/05
to Django users
Hi,

I'd like to get started using Django without installing Apache. I'd
even know how close I can come to a production-ready environment
without using Apache ( preferrably only python + mysql ).

Thanks and keep up the great work. Django looks awsome!

Tw

Joe Topjian

unread,
Aug 7, 2005, 2:12:34 PM8/7/05
to django...@googlegroups.com
I'd like to get started using Django without installing Apache. I'd
even know how close I can come to a production-ready environment
without using Apache ( preferrably only python + mysql ).

You can use django's built-in webserver like so:

django-admin.py runserver --settings="myproject.settings.admin"

However, I wouldn't recommend using it for production.  

More information on the server can be found in Tutorial 2:

Hope that helps

---
Joe Topjian

MrMuffin

unread,
Aug 7, 2005, 2:30:00 PM8/7/05
to Django users
I am aware of the testing-only pure-python web-server. What excactly
are the short-cummings of the test-server? Is it slow, unstable, not
thread-safe?

I'd like to develop web-based applications that's easy to
install/deploy, ie. create self-contained packages using cx_freeze or
py2exe. That's hard when you depend on apache and mysql/postgresql.
I've created such packages earlier using sqlite, sqlobject, cherrypy
and cheetahtemplates, creating packages using cx_freeze. No
installation, no dependencies, just download, unzip/untar and run.

You might argue that django is aimed at larger projects where
installing apache, postgresql, mod_python and all the other stuff ok,
but the I think easy deployment/installation is vital for quick
adoption/acceptance by users and would like to know how this can be
accomplished using Django.

Thanks in advance,
Thomas

Jacob Kaplan-Moss

unread,
Aug 7, 2005, 3:15:43 PM8/7/05
to django...@googlegroups.com
On Aug 7, 2005, at 1:30 PM, MrMuffin wrote:

> I am aware of the testing-only pure-python web-server. What excactly
> are the short-cummings of the test-server? Is it slow, unstable, not
> thread-safe?
>

Yes, yes, and maybe -- the built-in server is based on python's built-
in BaseHTTPServer, which is certainly slow (it only handles a single
request at once), and probably unstable (I don't know of any
production servers that run BaseHTTPserver).


> I'd like to develop web-based applications that's easy to
> install/deploy, ie. create self-contained packages using cx_freeze or
> py2exe. That's hard when you depend on apache and mysql/postgresql.
> I've created such packages earlier using sqlite, sqlobject, cherrypy
> and cheetahtemplates, creating packages using cx_freeze. No
> installation, no dependencies, just download, unzip/untar and run.
>
> You might argue that django is aimed at larger projects where
> installing apache, postgresql, mod_python and all the other stuff ok,
> but the I think easy deployment/installation is vital for quick
> adoption/acceptance by users and would like to know how this can be
> accomplished using Django.
>

Nothing's preventing you from doing this -- just use the built-in
server, sqlite, and have a ball. The reason we say this setup isn't
intended for production is that we don't want to deal with "Django is
slow and unstable!" complaints when the speed/stability issues are
those of the dependancies.

In fact, I'm very intrigued by what you'd like to do with Django;
perhaps once you've messed with it some you could write up your
impressions of using Django in this fashion?

Thanks,

Jacob

MrMuffin

unread,
Aug 7, 2005, 4:06:41 PM8/7/05
to Django users
Hmmm ... I've posted a related post to comp.lang.python about the lack
of a production grade web-server, especially a WSGI-server, in the
standard distro of python. For a while I didn't think pure python
web-servers wasn't capable of handling real-life loads, but twisted
claims to have a server that does and I believe several others as well.
I think one of the nice things about python and it's community is the
level of different web-related frameworks available each having a
different design etc. At the same time it's one of the biggest
weaknesses because there exists very few really well-documented, stable
and fast frameworks. On top of that you get the "threaded vs
single-thread/select vs fork"-discussion etc. You allways get " use
apache" when asking about a proper production environment. If we could
put some effort and resources into making an easy to use, stable and
efficient WSGI-based server available in the standard distro that would
make a world of difference instead of keep re-inventing the wheel for
every different framework.

I'm convienced that easy access to applications are essential to
adoption and as soon as I say "first you install apache, then mysql .."
people loose interest and download a similar project available in the
"download-unpack-run"-fashion. That's why I've used sqlite for my
earlier projects because there are no installation, just freeze your
app using cx_freeze or py2exe with the pysqlite-module, copy the
sqlite-dll or sqlite-so into the same folder, zip it up and you're good
to go. I soon discovered that pysqlite had some serious problems in a
threaded environment though so it looks as if I have to start depending
on mysql or postgresql until the threading issues can be resolved in
pysqlite/sqlite. Still, installing a database is one thing, and
installing mysql is quite easy, but apache and mod_python, editing a
bunch of conf-files etc are a totally different thing.

The only serious short-cumming of python is a good GUI editor like
Borland Delphi I ( which I use daily in my dayjob ) or Visual Studio,
capable of making GUI-based apps in a RAD way. I'm aware of
Boa-Constructor, wxPython, wxGlade etc, but they are nowhere near as
easy to use as the other mentioned commercial programs ( allthough Boa
is close, or at least closest ). Therefore I think a lot of people use
Web-server instead for gui-programming. And apps like that, rather
simple often one-user, database-centric apps, must be easy to
install/deploy. The extra bonus of using web as gui is the fact that
you can run it on a internet server and access it remotly as well.

I'm very impressed with what I've seen of Django so far ( it has
everything I need in the standard package, my earlier Cherrypy-based
templates used SQLObject, CheetahTemplate and several other modules to
achieve the same thing ) and will follow the development of Django
closely. My biggest problem is the Apache/mod_python-dependency.

Anyway, if you're stilling reading thanks for your patience.

Regards,
Thomas

David S.

unread,
Aug 19, 2005, 10:09:17 AM8/19/05
to Django users
I have been persuing the same sort of path, i.e. SQLite, wxPython,
cx_freeze for the same reasons. But I am pretty excited about Django
and how quickly I can get functionality that has been so tedious to
build myself. And, I am happy to go for the web app even for clients
with 1 in-house user for which the BaseHTTPServer should be just fine.

Anyway, I am happy to contribute to making this toolset for
simple-to-deploy apps work well. I hope my notes will be a useful
recipe one of these days.

Reply all
Reply to author
Forward
0 new messages