From a4c6730aa195cc82b718bb88f2ea463b0f4ac557 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 17 Feb 2006 17:48:21 +0000 Subject: [PATCH] magic-removal: Merged to [2319] git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2320 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/db-api.txt | 2 +- docs/generic_views.txt | 2 +- docs/modpython.txt | 33 +++++++++++++++++++++++++++++++++ docs/templates.txt | 13 +++++++++++-- 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/docs/db-api.txt b/docs/db-api.txt index b6f08be9a0..10beebb3d8 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -173,7 +173,7 @@ The DB API supports the following lookup types: in In a given list: ``polls.get_list(id__in=[1, 3, 4])`` returns a list of polls whose IDs are either 1, 3 or 4. startswith Case-sensitive starts-with: - ``polls.get_list(question_startswith="Would")``. (PostgreSQL + ``polls.get_list(question__startswith="Would")``. (PostgreSQL and MySQL only. SQLite doesn't support case-sensitive LIKE statements; ``startswith`` will act like ``istartswith`` for SQLite.) diff --git a/docs/generic_views.txt b/docs/generic_views.txt index f7e8921689..b9777139ca 100644 --- a/docs/generic_views.txt +++ b/docs/generic_views.txt @@ -40,7 +40,7 @@ drives the blog on djangoproject.com:: } urlpatterns = patterns('django.views.generic.date_based', - (r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?P\w+)/$', 'object_detail', dict(info_dict, slug_field='slug')), + (r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?P[-\w]+)/$', 'object_detail', dict(info_dict, slug_field='slug')), (r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/$', 'archive_day', info_dict), (r'^(?P\d{4})/(?P[a-z]{3})/$', 'archive_month', info_dict), (r'^(?P\d{4})/$', 'archive_year', info_dict), diff --git a/docs/modpython.txt b/docs/modpython.txt index baa534ae91..5800968ee5 100644 --- a/docs/modpython.txt +++ b/docs/modpython.txt @@ -198,3 +198,36 @@ that case, you'll see an "Internal Server Error" page in your browser and the full Python traceback in your Apache ``error_log`` file. The ``error_log`` traceback is spread over multiple lines. (Yes, this is ugly and rather hard to read, but it's how mod_python does things.) + +If you get a segmentation fault +=============================== + +If Apache causes a segmentation fault, there are two probable causes, neither +of which has to do with Django itself. + + 1. It may be because your Python code is importing the "pyexpat" module, + which may conflict with the version embedded in Apache. For full + information, see `Expat Causing Apache Crash`_. + 2. It may be because you're running mod_python and mod_php in the same + Apache instance, with MySQL as your database backend. In some cases, + this causes a known mod_python issue due to version conflicts in PHP and + the Python MySQL backend. There's full information in the + `mod_python FAQ entry`_. + +If you continue to have problems setting up mod_python, a good thing to do is +get a barebones mod_python site working, without the Django framework. This is +an easy way to isolate mod_python-specific problems. `Getting mod_python Working`_ +details this procedure. + +The next step should be to edit your test code and add an import of any +Django-specific code you're using -- your views, your models, your URLconf, +your RSS configuration, etc. Put these imports in your test handler function +and access your test URL in a browser. If this causes a crash, you've confirmed +it's the importing of Django code that causes the problem. Gradually reduce the +set of imports until it stops crashing, so as to find the specific module that +causes the problem. Drop down further into modules and look into their imports, +as necessary. + +.. _Expat Causing Apache Crash: http://www.dscpl.com.au/articles/modpython-006.html +.. _mod_python FAQ entry: http://modpython.org/FAQ/faqw.py?req=show&file=faq02.013.htp +.. _Getting mod_python Working: http://www.dscpl.com.au/articles/modpython-001.html diff --git a/docs/templates.txt b/docs/templates.txt index d210ec2f77..66e1943f23 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -243,7 +243,11 @@ Using the built-in reference Because Django can be used to develop any sort of site, the tags, filters and variables available are different depending on the application. To make it easy to figure out what's available in a given site, the admin interface has a -complete reference of all the template goodies available to that site. +complete reference of all the template goodies available to that site. To get +that reference, go to your Django admin interface and append ``'doc'`` onto the +admin URL. Example: ``http://127.0.0.1/admin/doc/``. In the Django development +version, you'll see a "Documentation" link in the upper right of every +admin-site page. The reference is integrated into the administration interface for your site(s) and is divided into 4 sections: tags, filters, models, and views. @@ -924,7 +928,12 @@ digits. For a string, it's a list of characters. phone2numeric ~~~~~~~~~~~~~ -Converts a phone number to its numerical equivalent. +Converts a phone number (possibly containing letters) to its numerical +equivalent. For example, ``'800-COLLECT'`` will be converted to +``'800-2655328'``. + +The input doesn't have to be a valid phone number. This will happily convert +any string. pluralize ~~~~~~~~~