kopia lustrzana https://github.com/wagtail/wagtail
Docs - update Django urls to shorthand method
rodzic
c5f238f98d
commit
d5bd828b8e
|
@ -27,7 +27,7 @@ There are two options for managing translations across different languages in th
|
|||
|
||||
This document only covers the internationalisation of content managed by Wagtail.
|
||||
For information on how to translate static content in template files, JavaScript
|
||||
code, etc, refer to the [Django internationalisation docs](https://docs.djangoproject.com/en/stable/topics/i18n/translation/).
|
||||
code, etc, refer to the [Django internationalisation docs](django:topics/i18n/translation).
|
||||
Or, if you are building a headless site, refer to the docs of the frontend framework you are using.
|
||||
|
||||
### Wagtail's approach to multi-lingual content
|
||||
|
|
|
@ -94,4 +94,4 @@ This optimisation is already handled for you for images in the admin site.
|
|||
|
||||
## Django
|
||||
|
||||
Wagtail is built on Django. Many of the [performance tips](https://docs.djangoproject.com/en/stable/topics/performance/) set out by Django are also applicable to Wagtail.
|
||||
Wagtail is built on Django. Many of the [performance tips](django:topics/performance) set out by Django are also applicable to Wagtail.
|
||||
|
|
|
@ -118,7 +118,7 @@ django-admin makemigrations --settings=wagtail.test.settings
|
|||
### Testing against PostgreSQL
|
||||
|
||||
```{note}
|
||||
In order to run these tests, you must install the required modules for PostgreSQL as described in Django's [Databases documentation](https://docs.djangoproject.com/en/stable/ref/databases/).
|
||||
In order to run these tests, you must install the required modules for PostgreSQL as described in Django's [Databases documentation](django:ref/databases).
|
||||
```
|
||||
|
||||
By default, Wagtail tests against SQLite. You can switch to using PostgreSQL by
|
||||
|
@ -133,7 +133,7 @@ If you need to use a different user, password, host, or port, use the `PGUSER`,
|
|||
### Testing against a different database
|
||||
|
||||
```{note}
|
||||
In order to run these tests, you must install the required client libraries and modules for the given database as described in Django's [Databases documentation](https://docs.djangoproject.com/en/stable/ref/databases/) or the 3rd-party database backend's documentation.
|
||||
In order to run these tests, you must install the required client libraries and modules for the given database as described in Django's [Databases documentation](django:ref/databases) or the 3rd-party database backend's documentation.
|
||||
```
|
||||
|
||||
If you need to test against a different database, set the `DATABASE_ENGINE`
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Wagtail’s user interface is built with:
|
||||
|
||||
- **HTML** using [Django templates](https://docs.djangoproject.com/en/stable/ref/templates/language/)
|
||||
- **HTML** using [Django templates](django:ref/templates/language)
|
||||
- **CSS** using [Sass](https://sass-lang.com/) and [Tailwind](https://tailwindcss.com/)
|
||||
- **JavaScript** with [TypeScript](https://www.typescriptlang.org/)
|
||||
- **SVG** for our icons, minified with [SVGO](https://jakearchibald.github.io/svgomg/)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Using forms in admin views
|
||||
|
||||
[Django's forms framework](https://docs.djangoproject.com/en/stable/topics/forms/) can be used within Wagtail admin views just like in any other Django app. However, Wagtail also provides various admin-specific form widgets, such as date/time pickers and choosers for pages, documents, images, and snippets. By constructing forms using `wagtail.admin.forms.models.WagtailAdminModelForm` as the base class instead of `django.forms.models.ModelForm`, the most appropriate widget will be selected for each model field. For example, given the model and form definition:
|
||||
[Django's forms framework](django:topics/forms) can be used within Wagtail admin views just like in any other Django app. However, Wagtail also provides various admin-specific form widgets, such as date/time pickers and choosers for pages, documents, images, and snippets. By constructing forms using `wagtail.admin.forms.models.WagtailAdminModelForm` as the base class instead of `django.forms.models.ModelForm`, the most appropriate widget will be selected for each model field. For example, given the model and form definition:
|
||||
|
||||
```python
|
||||
from django.db import models
|
||||
|
|
|
@ -103,7 +103,7 @@ urlpatterns = [
|
|||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
```
|
||||
|
||||
Note that this only works in development mode (`DEBUG = True`); in production, you will need to configure your web server to serve files from `MEDIA_ROOT`. For further details, see the Django documentation: [Serving files uploaded by a user during development](https://docs.djangoproject.com/en/stable/howto/static-files/#serving-files-uploaded-by-a-user-during-development) and [Deploying static files](https://docs.djangoproject.com/en/stable/howto/static-files/deployment/).
|
||||
Note that this only works in development mode (`DEBUG = True`); in production, you will need to configure your web server to serve files from `MEDIA_ROOT`. For further details, see the Django documentation: [Serving files uploaded by a user during development](https://docs.djangoproject.com/en/stable/howto/static-files/#serving-files-uploaded-by-a-user-during-development) and [Deploying static files](django:howto/static-files/deployment).
|
||||
|
||||
With this configuration in place, you are ready to run `python manage.py migrate` to create the database tables used by Wagtail.
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ Edit `home/templates/home/home_page.html` to contain the following:
|
|||
|
||||
### Wagtail template tags
|
||||
|
||||
In addition to Django's [template tags and filters](https://docs.djangoproject.com/en/stable/ref/templates/builtins/),
|
||||
In addition to Django's [template tags and filters](django:ref/templates/builtins),
|
||||
Wagtail provides a number of its own [template tags & filters](template_tags_and_filters)
|
||||
which can be loaded by including `{% load wagtailcore_tags %}` at the top of
|
||||
your template file.
|
||||
|
|
|
@ -197,7 +197,7 @@ Template paths have also been renamed accordingly - templates previously within
|
|||
|
||||
Where possible, third-party packages that implement their own field panel types should be updated to allow using a plain `FieldPanel` instead, in line with Wagtail dropping its own special-purpose field panel types such as `StreamFieldPanel` and `ImageChooserPanel`. The steps for doing this will depend on the package's functionality, but in general:
|
||||
|
||||
* If the panel sets a custom template, your code should instead define [a `Widget` class](https://docs.djangoproject.com/en/stable/ref/forms/widgets/) that produces your desired HTML rendering.
|
||||
* If the panel sets a custom template, your code should instead define [a `Widget` class](django:ref/forms/widgets) that produces your desired HTML rendering.
|
||||
* If the panel provides a `widget_overrides` method, your code should instead call [`register_form_field_override`](/extending/forms) so that the desired widget is always selected for the relevant model field type.
|
||||
* If the panel provides a `get_comparison_class` method, your code should instead call `wagtail.admin.compare.register_comparison_class` to register the comparison class against the relevant model field type.
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Each page type (a.k.a. content type) in Wagtail is represented by a Django model. All page models must inherit from the {class}`wagtail.models.Page` class.
|
||||
|
||||
As all page types are Django models, you can use any field type that Django provides. See [Model field reference](https://docs.djangoproject.com/en/stable/ref/models/fields/) for a complete list of field types you can use. Wagtail also provides `wagtail.fields.RichTextField` which provides a WYSIWYG editor for editing rich-text content.
|
||||
As all page types are Django models, you can use any field type that Django provides. See [Model field reference](django:ref/models/fields) for a complete list of field types you can use. Wagtail also provides `wagtail.fields.RichTextField` which provides a WYSIWYG editor for editing rich-text content.
|
||||
|
||||
```{note}
|
||||
If you're not yet familiar with Django models, have a quick look at the following links to get you started:
|
||||
|
|
Ładowanie…
Reference in New Issue