Django is not a page-based template system like PHP. it's a
long-running application that answers web requests.
the difference means a much bigger separation between code and
presentation than in PHP, and implies a totally different deployment
architecture.
if you do the tutorials first, it will make all clear.
--
Javier
> I have LAMPP on Ubuntu and I use it fine with PHP. Now I have to add
> Django so that I can do PHP and Django projects together. I will have
> more than one Django project. I have read of mod_wsgi but I cannot
> understand.
what exactly is the problem?
I found these explanations helpful:
http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
http://blog.dscpl.com.au/2008/12/using-modwsgi-when-developing-django.html
good luck
> In PHP I just put my project as subdirectory of /var/www/
> and then access them via http://localhost/
> How do I do with Django?
> Thanks a lot!
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
I do not think it is a long running application
--
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/
'long' as compared to PHP processes, which are initialized and
destroyed for each HTTP request. Django, in contrast, stays up to
handle many requests.
--
Javier
I do not think it does - django is not a webserver or server like zope
for example. So what does 'stays up' mean?
use virtual hosts - one virtual host per project - and keep your
projects somewhere in the file system, each in it's own place (anywhere
except under /var/www/)
it is. depending on how you deploy, it's a FastCGI server, or a WSGI server.
in any case, the process is started once, lots of initializations are
done, and it starts receiving user's requests (after some translations
from the frontend web server). If you modify non-local resources in
memory, they are available for the next request.
Of course, most schemas start more than one process or thread, and you
never know which one will service the next request, so you can't rely
on that being available. Still, it's the base of the 'memory' cache
backend: simply a global Python variable that holds data from previous
requests.
Another complication is that usually there's a request counter, and
after it goes to zero, the thread/process is killed and another one is
started. That's usually done to limit any memory leak or similar
degradation, but it's done after several (sometimes hundreds of)
requests, not for each and every one like on PHP.
Why is that important? because all the models and urls and similar
scaffolding are done once and used afterwards. If you do funny things
there and/or don't take in account the lazy nature of Querysets, you
might see some strange things happening.
At the same time, it means Django is free of the "the most classes you
initialize, the slower your app is" effect in PHP.
--
Javier
django documentation, in the deployment section shows how