diff options
Diffstat (limited to 'old/published/Webmonkey/Monkey_Bites/2007/01.08.07/Thu/django-php.txt')
-rw-r--r-- | old/published/Webmonkey/Monkey_Bites/2007/01.08.07/Thu/django-php.txt | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/old/published/Webmonkey/Monkey_Bites/2007/01.08.07/Thu/django-php.txt b/old/published/Webmonkey/Monkey_Bites/2007/01.08.07/Thu/django-php.txt deleted file mode 100644 index ee4c06a..0000000 --- a/old/published/Webmonkey/Monkey_Bites/2007/01.08.07/Thu/django-php.txt +++ /dev/null @@ -1 +0,0 @@ -Perhaps the two greatest things about Django are its speed and the auto-generated admin interface. Since I didn't get a chance to post a tutorial yesterday, today's will be a two-parter.
For the most part Django's speed is just there and it's lightening fast, but there are still some things you can do to improve performance. Django offers four levels of caching via what Django calls Middleware.
Middleware is just a framework of "hooks" that tie into Django's request/response processing. In terms of speed and optimization the Middleware you'd want to look at is the [CacheMiddleware][1]. The actual cache can use any number of systems from the popular [memcached][2] to Django's own cache techniques.
For more information have a look at the [official cache documentation][3].
The second half of this tutorial round-up involves the Django admin interface. Whenever you create a model in Django, Django maps your model to a database and creates all the necessary tables.
Since handling the code necessary create, read, update and delete (CRUD) functionality to get data in and out of your application is a repetitive task, Django offers an automatically generated Admin interface.
All you need to do is enable it via your settings.py file and include the appropriate urls in the urls.py for your project. For more information and some screenshots head over to the [second tutorial on the Django site][4].
But what if you're on a shared host with Apache 1.3 and FCGI? What if your existing shared host provider is isn't capable of a high load site written in Django? Well here's a thought from Jeff Croft -- you could [still use Django for the back-end][5].
Croft outlines how to go about setting up all your sites CRUD functionality via Django and then use another framework or language to handle the front end display (in this case PHP).
Combine that with Django's built in [inspectdb][6] functionality and you could even upgrade an existing project to give it a nice Django back-end.
[2]: http://danga.com/memcached/ "memchached"
[1]: http://www.djangoproject.com/documentation/middleware/#django-middleware-cache-cachemiddleware "django.middleware.cache.CacheMiddleware"
[3]: http://www.djangoproject.com/documentation/cache/ "Django Cache Docs"
[4]: http://www.djangoproject.com/documentation/tutorial2/#explore-the-free-admin-functionality "Explore the free admin functionality"
[5]: http://www2.jeffcroft.com/blog/2006/jul/14/django-admin-your-php-app/ "Django admin for your PHP app?"
[6]: http://www.djangoproject.com/documentation/django_admin/#inspectdb
\ No newline at end of file |