AA Structures
AA Structures (aa-structures) is an Alliance Auth app designed to manage Eve Online structures. It provides tools for tracking, managing ownership, and handling timers for structures within an Alliance Auth installation. Currently at version 3.3.1, it receives updates for compatibility with Alliance Auth and new features, generally aligning with Alliance Auth's release cycle.
Common errors
-
ModuleNotFoundError: No module named 'aa_structures'
cause The `aa-structures` package is not installed in the active Python environment, or the environment is incorrect.fixEnsure you are in the correct virtual environment and run `pip install aa-structures`. -
django.db.utils.ProgrammingError: relation "aa_structures_structure" does not exist
cause Database migrations for the `aa_structures` app have not been applied, meaning the necessary tables do not exist in the database.fixRun database migrations for the app: `python manage.py migrate aa_structures`. -
AttributeError: 'Settings' object has no attribute 'AA_STRUCTURES_ENABLE_STRUCTURE_OWNERSHIP'
cause An app-specific setting is being accessed but is either misspelled or has not been defined in your Alliance Auth `local.py`, or `aa_structures` is not in `INSTALLED_APPS`.fixCheck your Alliance Auth `local.py` file for the correct setting name and ensure it is properly defined. Also, confirm `aa_structures` is listed in your `INSTALLED_APPS`. -
You are trying to add a non-nullable field 'field_name' to ... without a default; ensure you have made a corresponding data migration.
cause The app has been updated, introducing new non-nullable fields to its models, and a data migration is required but missing to populate existing rows.fixWhen upgrading, if you encounter this, running `python manage.py makemigrations aa_structures` and then `python manage.py migrate aa_structures` might prompt you to provide a one-off default or create a data migration. Always back up your database before running migrations during upgrades.
Warnings
- breaking Major version 3.0.0 of `aa-structures` introduced breaking changes by renaming the app's internal module path from `structure_tracker` to `aa_structures` to align with Alliance Auth 3.x.
- gotcha `aa-structures` requires Alliance Auth v3.0.0 or higher. Installing it on an older Alliance Auth version (e.g., v2.x) will lead to compatibility issues, errors, or a non-functional app.
- gotcha Failure to run database migrations after installing or upgrading `aa-structures` will result in database errors (e.g., 'table does not exist' or 'relation "..." does not exist') when the app tries to access its models.
- gotcha Users may not see the AA Structures app links or data within Alliance Auth even after successful installation if proper permissions are not configured.
Install
-
pip install aa-structures
Imports
- Structure
from structure_tracker.models import Structure
from aa_structures.models import Structure
- AA_STRUCTURES_ENABLE_STRUCTURE_OWNERSHIP
from aa_structures.app_settings import AA_STRUCTURES_ENABLE_STRUCTURE_OWNERSHIP
Quickstart
# Assuming an existing Alliance Auth v3.x installation # 1. Install the package # pip install aa-structures # 2. Add 'aa_structures' to INSTALLED_APPS in your Alliance Auth local.py # local.py # INSTALLED_APPS = [ # ..., # 'aa_structures' # ] # 3. Apply database migrations # python manage.py migrate aa_structures # 4. Collect static files (if not already done) # python manage.py collectstatic --noinput # 5. Restart Gunicorn/Celery if running in production # systemctl restart gunicorn # systemctl restart celery