mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[1.5.x] Fixed #19779 -- Checked contrib.sites presence in RedirectFallbackMiddleware
Thanks Aymeric Augustin for the report and directions for the patch.
Backport of 2ed90eac from master.
This commit is contained in:
@@ -13,11 +13,12 @@ Installation
|
||||
|
||||
To install the redirects app, follow these steps:
|
||||
|
||||
1. Add ``'django.contrib.redirects'`` to your :setting:`INSTALLED_APPS`
|
||||
setting.
|
||||
2. Add ``'django.contrib.redirects.middleware.RedirectFallbackMiddleware'``
|
||||
1. Ensure that the ``django.contrib.sites`` framework
|
||||
:ref:`is installed <enabling-the-sites-framework>`.
|
||||
2. Add ``'django.contrib.redirects'`` to your :setting:`INSTALLED_APPS` setting.
|
||||
3. Add ``'django.contrib.redirects.middleware.RedirectFallbackMiddleware'``
|
||||
to your :setting:`MIDDLEWARE_CLASSES` setting.
|
||||
3. Run the command :djadmin:`manage.py syncdb <syncdb>`.
|
||||
4. Run the command :djadmin:`manage.py syncdb <syncdb>`.
|
||||
|
||||
How it works
|
||||
============
|
||||
|
||||
@@ -246,6 +246,7 @@ To do this, you can use the sites framework. A simple example::
|
||||
>>> 'http://%s%s' % (Site.objects.get_current().domain, obj.get_absolute_url())
|
||||
'http://example.com/mymodel/objects/3/'
|
||||
|
||||
.. _enabling-the-sites-framework:
|
||||
|
||||
Default site and ``syncdb``
|
||||
===========================
|
||||
|
||||
Reference in New Issue
Block a user