Fixed #19315 -- Improved markup in admin FAQ.

Thanks ClaesBas.
This commit is contained in:
Aymeric Augustin 2012-11-17 23:25:52 +01:00
parent 4585e12318
commit ccb2b574e8
2 changed files with 15 additions and 10 deletions

View File

@ -10,8 +10,8 @@ things:
* Set the :setting:`SESSION_COOKIE_DOMAIN` setting in your admin config * Set the :setting:`SESSION_COOKIE_DOMAIN` setting in your admin config
file to match your domain. For example, if you're going to file to match your domain. For example, if you're going to
"http://www.example.com/admin/" in your browser, in "http://www.example.com/admin/" in your browser, in "myproject.settings" you
"myproject.settings" you should set ``SESSION_COOKIE_DOMAIN = 'www.example.com'``. should set :setting:`SESSION_COOKIE_DOMAIN` = 'www.example.com'.
* Some browsers (Firefox?) don't like to accept cookies from domains that * Some browsers (Firefox?) don't like to accept cookies from domains that
don't have dots in them. If you're running the admin site on "localhost" don't have dots in them. If you're running the admin site on "localhost"
@ -23,8 +23,9 @@ I can't log in. When I enter a valid username and password, it brings up the log
----------------------------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------
If you're sure your username and password are correct, make sure your user If you're sure your username and password are correct, make sure your user
account has ``is_active`` and ``is_staff`` set to True. The admin site only account has :attr:`~django.contrib.auth.models.User.is_active` and
allows access to users with those two fields both set to True. :attr:`~django.contrib.auth.models.User.is_staff` set to True. The admin site
only allows access to users with those two fields both set to True.
How can I prevent the cache middleware from caching the admin site? How can I prevent the cache middleware from caching the admin site?
------------------------------------------------------------------- -------------------------------------------------------------------
@ -64,9 +65,10 @@ My "list_filter" contains a ManyToManyField, but the filter doesn't display.
Django won't bother displaying the filter for a ``ManyToManyField`` if there Django won't bother displaying the filter for a ``ManyToManyField`` if there
are fewer than two related objects. are fewer than two related objects.
For example, if your ``list_filter`` includes ``sites``, and there's only one For example, if your :attr:`~django.contrib.admin.ModelAdmin.list_filter`
site in your database, it won't display a "Site" filter. In that case, includes :doc:`sites </ref/contrib/sites>`, and there's only one site in your
filtering by site would be meaningless. database, it won't display a "Site" filter. In that case, filtering by site
would be meaningless.
Some objects aren't appearing in the admin. Some objects aren't appearing in the admin.
------------------------------------------- -------------------------------------------
@ -85,9 +87,10 @@ How can I customize the functionality of the admin interface?
You've got several options. If you want to piggyback on top of an add/change You've got several options. If you want to piggyback on top of an add/change
form that Django automatically generates, you can attach arbitrary JavaScript form that Django automatically generates, you can attach arbitrary JavaScript
modules to the page via the model's ``class Admin`` ``js`` parameter. That modules to the page via the model's class Admin :ref:`js parameter
parameter is a list of URLs, as strings, pointing to JavaScript modules that <modeladmin-media-definitions>`. That parameter is a list of URLs, as strings,
will be included within the admin form via a ``<script>`` tag. pointing to JavaScript modules that will be included within the admin form via
a ``<script>`` tag.
If you want more flexibility than simply tweaking the auto-generated forms, If you want more flexibility than simply tweaking the auto-generated forms,
feel free to write custom views for the admin. The admin is powered by Django feel free to write custom views for the admin. The admin is powered by Django

View File

@ -1377,6 +1377,8 @@ instances which allow you to easily customize the response data before
rendering. For more details, see the rendering. For more details, see the
:doc:`TemplateResponse documentation </ref/template-response>`. :doc:`TemplateResponse documentation </ref/template-response>`.
.. _modeladmin-media-definitions:
``ModelAdmin`` media definitions ``ModelAdmin`` media definitions
-------------------------------- --------------------------------