Alliance Auth EVE University Core
EVE University Core Services for Alliance Auth
Features
- EVE University template/theme adapted from Bootswatch Slate v3.4.1
- Extends Alliance Auth's authenticate backend to fake email registration
- Extends Django Template Engine to allow this app to override any templates
Future Plans
- Add support for more core EVE Uni services such as Wiki, Mumble, etc.
How to Use It
This application can be installed via EVE Uni's PyPi repo, built and installed, or installed from the sour ce.
It is designed solely to provide the Alliance Auth/Django overrides, extensions, or services needed by EVE University.
Example production installation
pip install aa-euni-core
python myauth/manage.py collectstatic
Add these lines somewhere in your local.py:
Cloning From Repo
When cloning from the repo we will assume you are using a dev environment (e.g. aa-dev) and you will be installing this app under one top folder.
Something like this:
aa-dev
|- venv/
|- myauth/
|- aa-euni-core
|- (other AA projects ...)
Then just cd into the top folder (e.g. aa-dev) and clone the repo. Finally, enable pre-commit to enable automatic code style checking.
git clone https://github.com/EVE-University/aa-euni-core.git
cd aa-euni-core
pre-commit install
Writing Unit Tests
Write your unit tests in aa-eveuni-core/eunicore/tests/ and make sure that you use a "test_"
prefix for files with your unit tests.
Installing Into Your Dev AA
Once you have cloned or copied all files into place you are ready to install it to your dev AA instance.
Make sure you are in your venv. Then install it with pip in editable mode:
pip install -e aa-euni-core
First add the following to your Django project's local.py:
INSTALLED_APPS += ["eunicore"]
AUTHENTICATION_BACKENDS = [
"eunicore.auth.backends.EUniBackend",
"django.contrib.auth.backends.ModelBackend",
]
TEMPLATES[0]["BACKEND"] = "eunicore.template.backends.EUniDjangoTemplates"
Next collect statics:
python manage.py collectstatic
Then run a check to see if everything is set up correctly.
python manage.py check
In case they are errors make sure to fix them before proceeding.
Finally, restart your AA server and that's it.
Installing Into Production AA
To install your plugin into a production AA run this command within the virtual Python environment of your AA installation:
pip install git+https://github.com/EVE-University/aa-euni-core.git
Note you may need a personal access token
Alternatively you can create a package file from the repo and manually upload it to your production AA:
make build
You'll find the package under ./dist/aa_euni_core.tar.gz after this.
Install your package directly from the package file:
pip install aa_euni_core.tar.gz
Add the following to your production's local.py:
INSTALLED_APPS += ["eunicore"]
AUTHENTICATION_BACKENDS = [
"eunicore.auth.backends.EUniBackend",
"django.contrib.auth.backends.ModelBackend",
]
TEMPLATES[0]["BACKEND"] = "eunicore.template.backends.EUniDjangoTemplates"
Components
This app breaks up most of its functionality into descrete components.
Auth Backend
Extends allianceauth.authentication.backends.StateBackend create_user() method which is called
by authenticate() when a user isn't registered. The overriden create_user() method activates the
created user account and defines a [user_id]@eveuniversity.org as the email.
Template Backend
Extends django.template.backends.django.DjangoTemplates to add the eunicore/templates to the
template loader's dirs if it isn't already present.
Templates
The eunicore/templates directory can be used to override any template file used by the
Alliance Auth application.
AA v4.x Theme
Add eunicore.theme.slate to INSTALLED_APPS.
Add the following to local.py as well if you only the Slate theme available.
# Sets default theme to Slate.
DEFAULT_THEME = "eunicore.theme.slate.auth_hooks.SlateThemeHook"
# Legacy AAv3 user.profile.night_mode=1. This is the default set by the EUni Auth Backend.
DEFAULT_THEME_DARK = "eunicore.theme.slate.auth_hooks.SlateThemeHook"
# Remove the default BS5 themes
INSTALLED_APPS.remove("allianceauth.theme.darkly")
INSTALLED_APPS.remove("allianceauth.theme.flatly")
INSTALLED_APPS.remove("allianceauth.theme.materia")
Metadata
Release files for aa-euni-core 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aa_euni_core-0.1.1.tar.gz | 323.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aa_euni_core-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 650.6 kB
Release files / aa_euni_core-0.1.1.tar.gz
| Download URL | aa_euni_core-0.1.1.tar.gz |
|---|---|
| Size | 323.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9df78f2219591f4903aee1218a8358466bf427072c29c7a72d2d522be7f59233
|
|
BLAKE2b-256 checksum How to use checksums |
7bd4ccfd78356b3148703d7a84dd12babf81c2c5ecf5b6057a1376761e30bf28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / aa_euni_core-0.1.1-py3-none-any.whl
| Download URL | aa_euni_core-0.1.1-py3-none-any.whl |
|---|---|
| Size | 326.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2104b2eebb9f4203f5fe22ea537d4e3cea38c9f2875d628b73b03fecaab485a4
|
|
BLAKE2b-256 checksum How to use checksums |
5bd80d17bf7938e3d921f47dc36b011aa3deb8a092732a26e2bd666fa54dc37e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|