{"id":9429,"library":"aa-structures","title":"AA Structures","description":"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.","status":"active","version":"3.3.1","language":"en","source_language":"en","source_url":"https://github.com/pvyParts/aa-structures","tags":["allianceauth","eve online","django app","structures","gaming"],"install":[{"cmd":"pip install aa-structures","lang":"bash","label":"Install the package"}],"dependencies":[{"reason":"Core platform dependency for the app to function. Requires Alliance Auth v3.0.0 or higher.","package":"allianceauth","optional":false}],"imports":[{"note":"Class name for Eve Online structures. The module path changed in v3.0.0 from `structure_tracker` to `aa_structures` during the Alliance Auth 3.x rewrite.","wrong":"from structure_tracker.models import Structure","symbol":"Structure","correct":"from aa_structures.models import Structure"},{"note":"Example of accessing an app-specific setting directly within Python code. Most settings are configured via Django settings (e.g., in `local.py`).","symbol":"AA_STRUCTURES_ENABLE_STRUCTURE_OWNERSHIP","correct":"from aa_structures.app_settings import AA_STRUCTURES_ENABLE_STRUCTURE_OWNERSHIP"}],"quickstart":{"code":"# Assuming an existing Alliance Auth v3.x installation\n\n# 1. Install the package\n# pip install aa-structures\n\n# 2. Add 'aa_structures' to INSTALLED_APPS in your Alliance Auth local.py\n# local.py\n# INSTALLED_APPS = [\n#     ...,\n#     'aa_structures'\n# ]\n\n# 3. Apply database migrations\n# python manage.py migrate aa_structures\n\n# 4. Collect static files (if not already done)\n# python manage.py collectstatic --noinput\n\n# 5. Restart Gunicorn/Celery if running in production\n# systemctl restart gunicorn\n# systemctl restart celery","lang":"python","description":"To quickly integrate AA Structures into an existing Alliance Auth v3.x installation, follow these steps. This setup adds the app to your Django project, applies necessary database schema changes, and prepares static assets for the web server."},"warnings":[{"fix":"Update your 'INSTALLED_APPS' from 'structure_tracker' to 'aa_structures' in `local.py`. If you were importing models or other components directly, update paths from 'structure_tracker.<module>' to 'aa_structures.<module>'. Ensure your Alliance Auth installation is also updated to v3.0.0 or higher.","message":"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.","severity":"breaking","affected_versions":"<3.0.0 -> >=3.0.0"},{"fix":"Before installing `aa-structures`, ensure your Alliance Auth installation is updated to v3.0.0 or later. Consult the Alliance Auth upgrade guide for major version upgrades.","message":"`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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"After adding `aa_structures` to `INSTALLED_APPS` and running `pip install aa-structures`, always execute `python manage.py migrate aa_structures` to apply database schema changes.","message":"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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"In the Alliance Auth admin panel, navigate to 'Groups & Permissions', create or edit a group, and assign relevant `aa_structures` permissions (e.g., 'Can see structures', 'Can manage timers'). Ensure users are assigned to a group with these permissions.","message":"Users may not see the AA Structures app links or data within Alliance Auth even after successful installation if proper permissions are not configured.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Ensure you are in the correct virtual environment and run `pip install aa-structures`.","cause":"The `aa-structures` package is not installed in the active Python environment, or the environment is incorrect.","error":"ModuleNotFoundError: No module named 'aa_structures'"},{"fix":"Run database migrations for the app: `python manage.py migrate aa_structures`.","cause":"Database migrations for the `aa_structures` app have not been applied, meaning the necessary tables do not exist in the database.","error":"django.db.utils.ProgrammingError: relation \"aa_structures_structure\" does not exist"},{"fix":"Check 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`.","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`.","error":"AttributeError: 'Settings' object has no attribute 'AA_STRUCTURES_ENABLE_STRUCTURE_OWNERSHIP'"},{"fix":"When 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.","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.","error":"You are trying to add a non-nullable field 'field_name' to ... without a default; ensure you have made a corresponding data migration."}]}