model- representation that needs to be modeled into the db (data model
e.g models.py)
template- your user-facing code so it differentiates how your data is
presented (e.g templates/*)
view- maps your uri specific code to callback functions (e.g in
views.py) which should be resolvable by the URLResolver (to be defined
in URLConf)
MTV - this is what Django calls MVC (in that order)
DB - Django's "python manage.py syncdb" pulls the class definition from
the Model (e.g. models.py) and then inserts them into the DB. This ORM
design is really powerful as we get db<->application_code mapping
essentially for free. A DB can be another tier here that exists seperately.
Web server - Apache, FastCGI, any WSGI-compliant server etc.. (Django
provides lightweight devel server too)
On the topic of Application server, Djangobook.com puts it really nicely -
"At its core, the philosophy of shared nothing is really just the
application of loose coupling to the entire software stack. This
architecture arose in direct response to what was at the time the
prevailing architecture: a monolithic Web application server that
encapsulates the language, database, and Web server — even parts of the
operating system — into a single process (e.g., Java)."[1]
Others could possibly add more to your query (because I've yet to learn
Django properly myself) but from what I've understood Django does not
need a app server!
Cheers,
Ishwor
It sounds like you're trying to stop outside direct connections to the
database server. Which can be accomplished in a 2 or more tier configuration.
By having the database server (to clarify, database server refers to the
software, ie. MySQL, postgres, etc...) configured to listen for incoming
request from a white list of ip's (webservers, dba's, etc...). It is that
simple, in addition to configuring the rest of the server correctly. Though
it is probably better to have the actual database server only on the lan and
never directly on the internet.
In a 3 tier system, you want the first tier to be the web server proxy/load
balancer, where you have apache configured with mod_evasive, mod_security
and mod_proxy. mod_proxy sends/recieves (as a reverse proxy) the request
to/from your 'app server', which holds your django+project+httpd server
configuration, the middle tier. The middle tier is only configured like the
database with a white list of ips and should not reside on the internet, only
in a lan that the proxy handles connections for. The third tier of course is
the database configured with it's whitelist.
Here is an article on configuring the first tier server:
http://linuxadministration.wordpress.com/2007/09/06/advance-apache-security-mod_proxymod_securitymod_evasive/
You should also make the first tier server your media server for website in
addition to the security proxy. Serving your css/js/image files as per the
django docs (see MEDIA_URL && MEDIA_ROOT in the django settings, in addition
to serving static files and handling file uploads).
The idea of it having to be a 3 tier system is really not that important. The
two tier system can work the same way, and be just as secure with the correct
server configurations.
Mike
--
Magically turning people's old scalar contexts into list contexts is a
recipe for several kinds of disaster.
-- Larry Wall in <1997092916...@wall.org>
I reckon you'd have to use some sort of RPC that translates the call
to/from the remote model but I am not sure if Django provides such
primitive.
Cheers,
Ishwor