kopia lustrzana https://github.com/wagtail/wagtail
Spelling fixes for howto section
rodzic
16294c2fd2
commit
642f37c1e5
|
@ -3,7 +3,7 @@ Custom branding
|
|||
|
||||
In your projects with Wagtail, you may wish to replace elements such as the Wagtail logo within the admin interface with your own branding. This can be done through Django's template inheritance mechanism, along with the `django-overextends <https://github.com/stephenmcd/django-overextends>`_ package.
|
||||
|
||||
Install django-overextends with ``pip install django-overextends`` (or add ``django-overextends`` to your project's requirements file), and add ``'overextends'`` to your project's ``INSTALLED_APPS``. You now need to create a ``templates/wagtailadmin/`` folder within one of your apps - this may be an existing one, or a new one created for this purpose, for example, ``dashboard``. This app must be registered in ``INSTALLED_APPS`` before ``wagtail.wagtailadmin``::
|
||||
Install ``django-overextends`` with ``pip install django-overextends`` (or add ``django-overextends`` to your project's requirements file), and add ``'overextends'`` to your project's ``INSTALLED_APPS``. You now need to create a ``templates/wagtailadmin/`` folder within one of your apps - this may be an existing one, or a new one created for this purpose, for example, ``dashboard``. This app must be registered in ``INSTALLED_APPS`` before ``wagtail.wagtailadmin``::
|
||||
|
||||
INSTALLED_APPS = (
|
||||
# ...
|
||||
|
@ -19,8 +19,8 @@ Install django-overextends with ``pip install django-overextends`` (or add ``dja
|
|||
|
||||
The template blocks that are available to be overridden are as follows:
|
||||
|
||||
branding_logo
|
||||
-------------
|
||||
``branding_logo``
|
||||
-----------------
|
||||
|
||||
To replace the default logo, create a template file ``dashboard/templates/wagtailadmin/base.html`` that overrides the block ``branding_logo``::
|
||||
|
||||
|
@ -30,8 +30,8 @@ To replace the default logo, create a template file ``dashboard/templates/wagtai
|
|||
<img src="{{ STATIC_URL }}images/custom-logo.svg" alt="Custom Project" width="80" />
|
||||
{% endblock %}
|
||||
|
||||
branding_login
|
||||
--------------
|
||||
``branding_login``
|
||||
------------------
|
||||
|
||||
To replace the login message, create a template file ``dashboard/templates/wagtailadmin/login.html`` that overrides the block ``branding_login``::
|
||||
|
||||
|
@ -39,8 +39,8 @@ To replace the login message, create a template file ``dashboard/templates/wagta
|
|||
|
||||
{% block branding_login %}Sign in to Frank's Site{% endblock %}
|
||||
|
||||
branding_welcome
|
||||
----------------
|
||||
``branding_welcome``
|
||||
--------------------
|
||||
|
||||
To replace the welcome message on the dashboard, create a template file ``dashboard/templates/wagtailadmin/home.html`` that overrides the block ``branding_welcome``::
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ The root page
|
|||
|
||||
The root page (``/``) should detect the browsers language and forward them to the correct language homepage (``/en/``, ``/fr/``). This page should sit at the site root (where the homepage would normally be).
|
||||
|
||||
We must set Djangos ``LANGUAGES`` setting so we don't redirect non English/French users to pages that don't exist.
|
||||
We must set Django's ``LANGUAGES`` setting so we don't redirect non English/French users to pages that don't exist.
|
||||
|
||||
|
||||
.. code-block:: python
|
||||
|
@ -52,11 +52,11 @@ We must set Djangos ``LANGUAGES`` setting so we don't redirect non English/Frenc
|
|||
Linking pages together
|
||||
======================
|
||||
|
||||
It may be useful to link different versions of the same page together to allow the user to easily switch between languages. But we don't want to increse the burdon on the editor too much so ideally, editors should only need to link one of the pages to the other versions and the links between the other versions should be created implicitly.
|
||||
It may be useful to link different versions of the same page together to allow the user to easily switch between languages. But we don't want to increase the burden on the editor too much so ideally, editors should only need to link one of the pages to the other versions and the links between the other versions should be created implicitly.
|
||||
|
||||
As this behaviour needs to be added to all page types that would be translated, its best to put this behaviour in a mixin.
|
||||
|
||||
Heres an example of how this could be implemented (with English as the main language and French/Spanish as alternative languages):
|
||||
Here's an example of how this could be implemented (with English as the main language and French/Spanish as alternative languages):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ We have tried to minimise external dependencies for a working installation of Wa
|
|||
Cache
|
||||
-----
|
||||
|
||||
We recommend `Redis <http://redis.io/>`_ as a fast, persistent cache. Install Redis through your package manager (on Debian or Ubuntu: ``sudo apt-get install redis-server``), add ``django-redis`` to your requirements.txt, and enable it as a cache backend::
|
||||
We recommend `Redis <http://redis.io/>`_ as a fast, persistent cache. Install Redis through your package manager (on Debian or Ubuntu: ``sudo apt-get install redis-server``), add ``django-redis`` to your ``requirements.txt``, and enable it as a cache backend::
|
||||
|
||||
CACHES = {
|
||||
'default': {
|
||||
|
@ -25,7 +25,7 @@ We recommend `Redis <http://redis.io/>`_ as a fast, persistent cache. Install Re
|
|||
}
|
||||
}
|
||||
|
||||
Without a persistent cache, Wagtail will recreate all compressable assets at each server start, e.g. when any files change under ``./manage.py runserver``.
|
||||
Without a persistent cache, Wagtail will recreate all compressible assets at each server start, e.g. when any files change under ``./manage.py runserver``.
|
||||
|
||||
|
||||
Search
|
||||
|
|
|
@ -18,7 +18,7 @@ To install Wagtail completely from scratch, create a new Django project and an a
|
|||
views.py
|
||||
manage.py
|
||||
|
||||
From your app directory, you can safely remove ``admin.py`` and ``views.py``, since Wagtail will provide this functionality for your models. Configuring Django to load Wagtail involves adding modules and variables to ``settings.py`` and urlconfs to ``urls.py``. For a more complete view of what's defined in these files, see `Django Settings <https://docs.djangoproject.com/en/dev/topics/settings/>`__ and `Django URL Dispatcher <https://docs.djangoproject.com/en/dev/topics/http/urls/>`_.
|
||||
From your app directory, you can safely remove ``admin.py`` and ``views.py``, since Wagtail will provide this functionality for your models. Configuring Django to load Wagtail involves adding modules and variables to ``settings.py`` and URL configuration to ``urls.py``. For a more complete view of what's defined in these files, see `Django Settings <https://docs.djangoproject.com/en/dev/topics/settings/>`__ and `Django URL Dispatcher <https://docs.djangoproject.com/en/dev/topics/http/urls/>`_.
|
||||
|
||||
What follows is a settings reference which skips many boilerplate Django settings. If you just want to get your Wagtail install up quickly without fussing with settings at the moment, see :ref:`complete_example_config`.
|
||||
|
||||
|
@ -50,8 +50,8 @@ Wagtail requires several common Django middleware modules to work and cover basi
|
|||
Wagtail provides a simple interface for adding arbitrary redirects to your site and this module makes it happen.
|
||||
|
||||
|
||||
Apps (settings.py)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
Apps (``settings.py``)
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
@ -190,7 +190,7 @@ Providing an API key for the Embedly service will use that as a embed backend, w
|
|||
|
||||
.. _Embedly: http://embed.ly/
|
||||
|
||||
To use Embedly, you must also install their python module:
|
||||
To use Embedly, you must also install their Python module:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
@ -269,7 +269,7 @@ URL Patterns
|
|||
url(r'^search/', include(wagtailsearch_urls)),
|
||||
url(r'^documents/', include(wagtaildocs_urls)),
|
||||
|
||||
# Optional urlconf for including your own vanilla Django urls/views
|
||||
# Optional URL for including your own vanilla Django urls/views
|
||||
url(r'', include('myapp.urls')),
|
||||
|
||||
# For anything not caught by a more specific rule above, hand over to
|
||||
|
@ -281,10 +281,10 @@ This block of code for your project's ``urls.py`` does a few things:
|
|||
|
||||
* Load the vanilla Django admin interface to ``/django-admin/``
|
||||
* Load the Wagtail admin and its various apps
|
||||
* Dispatch any vanilla Django apps you're using other than Wagtail which require their own urlconfs (this is optional, since Wagtail might be all you need)
|
||||
* Dispatch any vanilla Django apps you're using other than Wagtail which require their own URL configuration (this is optional, since Wagtail might be all you need)
|
||||
* Lets Wagtail handle any further URL dispatching.
|
||||
|
||||
That's not everything you might want to include in your project's urlconf, but it's what's necessary for Wagtail to flourish.
|
||||
That's not everything you might want to include in your project's URL configuration, but it's what's necessary for Wagtail to flourish.
|
||||
|
||||
|
||||
.. _complete_example_config:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
analytics
|
||||
backend
|
||||
backends
|
||||
callable
|
||||
|
@ -6,17 +7,24 @@ Cloudflare
|
|||
contrib
|
||||
Django
|
||||
Elasticsearch
|
||||
embeddable
|
||||
Embedly
|
||||
frontend
|
||||
Gondor
|
||||
Gunicorn
|
||||
Heroku
|
||||
hostname
|
||||
jQuery
|
||||
login
|
||||
metadata
|
||||
middleware
|
||||
minifier
|
||||
mixin
|
||||
Nginx
|
||||
oEmbed
|
||||
PostgreSQL
|
||||
pre
|
||||
preprocessors
|
||||
QuerySet
|
||||
Redis
|
||||
resize
|
||||
|
|
Ładowanie…
Reference in New Issue