Docs updated

This commit is contained in:
Peter Pfeufer 2022-02-02 15:25:45 +01:00
parent 640a21e4db
commit c74010d441
No known key found for this signature in database
GPG Key ID: 6051D2C6AD4EBC27
2 changed files with 14 additions and 5 deletions

View File

@ -30,6 +30,9 @@ It is possible to overload static and templates shipped with Django or Alliance
It is possible to add or override URLs with your auth project's URL config file. Upon install it is of the form:
```python
from django.urls import re_path
from django.urls import include
import allianceauth.urls
urlpatterns = [
@ -42,23 +45,29 @@ This means every request gets passed to the Alliance Auth URL config to be inter
If you wanted to add a URL pointing to a custom view, it can be added anywhere in the list if not already used by Alliance Auth:
```python
from django.urls import re_path
from django.urls import include, path
import allianceauth.urls
import myauth.views
urlpatterns = [
re_path(r'', include(allianceauth.urls)),
re_path(r'myview/$', myauth.views.myview, name='myview'),
path('myview/', myauth.views.myview, name='myview'),
]
```
Additionally you can override URLs used by Alliance Auth here:
```python
from django.urls import re_path
from django.urls import include, path
import allianceauth.urls
import myauth.views
urlpatterns = [
re_path(r'account/login/$', myauth.views.login, name='auth_login_user'),
path('account/login/', myauth.views.login, name='auth_login_user'),
re_path(r'', include(allianceauth.urls)),
]
```

View File

@ -34,11 +34,11 @@ An app called `plugin` provides a single view:
The app's `urls.py` would look like so:
from django.conf.urls import url
from django.urls import path
import plugin.views
urlpatterns = [
re_path(r^'index$', plugins.views.index, name='index'),
path('index/', plugins.views.index, name='index'),
]
Subsequently it would implement the UrlHook in a dedicated `auth_hooks.py` file like so: