mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-19 07:15:04 +01:00
more automated upgrades
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
This section contains important information on how to develop Alliance Auth itself.
|
||||
|
||||
```{toctree}
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
documentation
|
||||
code-style
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
This section describes how to extend **Alliance Auth** with custom apps and services.
|
||||
|
||||
```{toctree}
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
integrating-services
|
||||
menu-hooks
|
||||
url-hooks
|
||||
logging
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -46,10 +46,9 @@ In order to integrate with Alliance Auth service modules must provide a `service
|
||||
|
||||
This would register the ExampleService class which would need to be a subclass of `services.hooks.ServiceHook`.
|
||||
|
||||
```{eval-rst}
|
||||
.. important::
|
||||
:::{important}
|
||||
The hook **MUST** be registered in ``yourservice.auth_hooks`` along with any other hooks you are registering for Alliance Auth.
|
||||
```
|
||||
:::
|
||||
|
||||
A subclassed `ServiceHook` might look like this:
|
||||
|
||||
|
||||
@@ -40,13 +40,11 @@ A list of views or namespaces the link should be highlighted on. See [django-nav
|
||||
|
||||
This is a great feature to signal the user, that he has some open issues to take care of within an app. For example Auth uses this feature to show the specific number of open group request to the current user.
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
Here is how to stay consistent with the Auth design philosophy for using this feature:
|
||||
1. Use it to display open items that the current user can close by himself only. Do not use it for items, that the user has no control over.
|
||||
2. If there are currently no open items, do not show a badge at all.
|
||||
```
|
||||
|
||||
:::
|
||||
To use it set count the `render()` function of your subclass in accordance to the current user. Here is an example:
|
||||
|
||||
```Python
|
||||
|
||||
@@ -6,10 +6,9 @@ The main benefit of this setup is that it runs all services and code in the nati
|
||||
|
||||
In addition all tools described in this guide are open source or free software.
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
This guide is meant for development purposes only and not for installing AA in a production environment. For production installation please see chapter **Installation**.
|
||||
```
|
||||
:::
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -72,10 +71,8 @@ sudo apt-get install gettext
|
||||
|
||||
Next we need to install Python and related development tools.
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
To check your system's Python 3 version you can enter: ``python3 --version``
|
||||
```
|
||||
:::{hint}
|
||||
:::
|
||||
|
||||
:::{note}
|
||||
Should your Ubuntu come with a newer version of Python we recommend to still setup your dev environment with the oldest Python 3 version currently supported by AA (e.g Python 3.8 at this time of writing) to ensure your apps are compatible with all current AA installations
|
||||
@@ -179,10 +176,9 @@ Following this approach you can also setup additional AA projects, e.g. aa-dev-2
|
||||
|
||||
Create the root folder `aa-dev`.
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
The folders `venv` and `myauth` will be created automatically in later steps. Please do not create them manually as this would lead to errors.
|
||||
```
|
||||
:::
|
||||
|
||||
### Setup virtual Python environment for aa-dev
|
||||
|
||||
@@ -240,10 +236,9 @@ For the Eve Online related setup you need to create a SSO app on the developer s
|
||||
|
||||
Open your local Django settings with VSC. The file is under `myauth/myauth/settings/local.py`
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
There are two Django settings files: ``base.py`` and ``local.py``. The base settings file is controlled by the AA project and may change at any time. It is therefore recommended to only change the local settings file.
|
||||
```
|
||||
:::
|
||||
|
||||
```python
|
||||
DEBUG = True
|
||||
@@ -312,10 +307,9 @@ python manage.py runserver
|
||||
|
||||
Once running you can access your auth site on the browser under `http://localhost:8000`. Or the admin site under `http://localhost:8000/admin`
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
You can start your AA server directly from a terminal window in VSC or with a VSC debug config (see chapter about debugging for details).
|
||||
```
|
||||
:::
|
||||
|
||||
:::{note}
|
||||
**Debug vs. Non-Debug mode**
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
Here you find guides on how to setup your development environment for AA.
|
||||
|
||||
```{toctree}
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
aa-dev-setup-wsl-vsc-v2
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
**Alliance Auth** is designed to be extended easily. Learn how to develop your own apps and services for AA or to develop for AA core in the development chapter.
|
||||
|
||||
```{toctree}
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
custom/index
|
||||
aa_core/index
|
||||
dev_setup/index
|
||||
tech_docu/index
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
To reduce redundancy and help speed up development we encourage developers to utilize the following packages when developing apps for Alliance Auth.
|
||||
|
||||
```{toctree}
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
discord_client
|
||||
@@ -13,4 +13,4 @@ eveonline
|
||||
notifications
|
||||
testutils
|
||||
utils
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -105,14 +105,13 @@ In this example we fist add 10 example tasks that need to run one after the othe
|
||||
|
||||
The list of task signatures is then converted to a chain and started asynchronously.
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
In our example we use ``si()``, which is a shortcut for "immutable signatures" and prevents us from having to deal with result sharing between tasks.
|
||||
|
||||
For more information on signature and work flows see the official documentation on `Canvas <https://docs.celeryproject.org/en/latest/userguide/canvas.html>`_.
|
||||
|
||||
In this context please note that Alliance Auth currently only supports chaining, because all other variants require a so called results back, which Alliance Auth does not have.
|
||||
```
|
||||
:::
|
||||
|
||||
## How can I define periodic tasks for my app?
|
||||
|
||||
@@ -149,18 +148,14 @@ In Alliance Auth we have defined task priorities from 0 - 9 as follows:
|
||||
====== ========= ===========
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. warning::
|
||||
:::{warning}
|
||||
Please make sure to use task priorities with care and especially do not use higher priorities without a good reason. All apps including Alliance Auth share the same task queues, so using higher task priorities excessively can potentially prevent more important tasks (of other apps) from completing on time.
|
||||
|
||||
You also want to make sure to run use lower priorities if you have a large amount of tasks or long running tasks, which are not super urgent. (e.g. the regular update of all Eve characters from ESI runs with priority 7)
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::
|
||||
:::{hint}
|
||||
If no priority is specified all tasks will be started with the default priority, which is 5.
|
||||
```
|
||||
|
||||
:::
|
||||
To run a task with a different priority you need to specify it when starting it.
|
||||
|
||||
Example for starting a task with priority 3:
|
||||
@@ -169,10 +164,9 @@ Example for starting a task with priority 3:
|
||||
example.apply_async(priority=3)
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
For defining a priority to tasks you can not use the convenient shortcut ``delay()``, but instead need to start a task with ``apply_async()``, which also requires you to pass parameters to your task function differently. Please check out the `official docs <https://docs.celeryproject.org/en/stable/reference/celery.app.task.html#celery.app.task.Task.apply_async>`_ for details.
|
||||
```
|
||||
:::
|
||||
|
||||
## What special features should I be aware of?
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
In this section you find topics useful for app developers.
|
||||
|
||||
```{toctree}
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
api/index
|
||||
celery
|
||||
core_models
|
||||
templatetags
|
||||
```
|
||||
:::
|
||||
|
||||
Reference in New Issue
Block a user