{"id":9671,"library":"django-eveonline-sde","title":"Django EVE Online SDE","description":"Django-eveonline-sde provides Django models for the EVE Online Static Data Export (SDE), allowing developers to easily integrate SDE data into their Django projects. It includes management commands to download and import the SDE. The current version is `0.0.1b9`, and it's under active development as a beta project by the Brave Collective, with updates released on an irregular basis as features are added or refined.","status":"active","version":"0.0.1b9","language":"en","source_language":"en","source_url":"https://github.com/bravecollective/django-eveonline-sde","tags":["Django","EVE Online","SDE","database","gaming","MMORPG"],"install":[{"cmd":"pip install django-eveonline-sde","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"This is a Django app and requires Django to run.","package":"Django","optional":false},{"reason":"Used internally for downloading the SDE files.","package":"requests","optional":false},{"reason":"Optional for asynchronous SDE import/update tasks.","package":"celery","optional":true},{"reason":"Optional for scheduling SDE updates with Celery.","package":"django-celery-beat","optional":true}],"imports":[{"symbol":"InvType","correct":"from eveonline_sde.models import InvType"},{"symbol":"TypeCategory","correct":"from eveonline_sde.models import TypeCategory"},{"note":"All SDE models are found within the `eveonline_sde.models` module.","symbol":"SolarSystem","correct":"from eveonline_sde.models import SolarSystem"}],"quickstart":{"code":"# settings.py\nINSTALLED_APPS = [\n    # ...\n    'eveonline_sde',\n    # ...\n]\n\n# Run migrations\n# python manage.py migrate eveonline_sde\n\n# Download and import SDE data\n# python manage.py download_sde\n# python manage.py import_sde\n\n# Example usage in a Django shell or view\nfrom eveonline_sde.models import InvType\n\ntry:\n    tristanium = InvType.objects.get(name='Tristanium')\n    print(f\"Tristanium Type ID: {tristanium.type_id}\")\nexcept InvType.DoesNotExist:\n    print(\"Tristanium not found. Did you import the SDE?\")\n\n","lang":"python","description":"To get started, add `eveonline_sde` to `INSTALLED_APPS`, run database migrations, and then use the provided management commands `download_sde` and `import_sde` to populate your database. Afterwards, you can query the SDE models like any other Django model."},"warnings":[{"fix":"Always review release notes for new versions. Be prepared to run `makemigrations` and `migrate` for `eveonline_sde` and potentially `download_sde` and `import_sde` again after upgrading.","message":"As a beta package, database schema changes might occur between minor versions. This could require new migrations or even a full SDE re-import.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Ensure you have adequate disk space and allocate sufficient time for the `download_sde` and `import_sde` commands to complete, especially on initial setup or major SDE updates. Consider running these operations in a robust environment (e.g., within a screen or tmux session).","message":"The EVE Online SDE is very large. Downloading and importing it into your database can take a significant amount of time and consume substantial disk space (several GB).","severity":"gotcha","affected_versions":"All"},{"fix":"Implement a scheduled task (e.g., using Celery Beat or a cron job) to periodically run `python manage.py download_sde && python manage.py import_sde` to keep your SDE data up-to-date. Note: Running `import_sde` will update existing records and insert new ones; it won't delete old data if SDE structure changes dramatically.","message":"SDE data updates are not automatic. You must manually run `download_sde` and `import_sde` management commands to get the latest SDE version.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Ensure you have run `pip install django-eveonline-sde` and added `'eveonline_sde'` to your `INSTALLED_APPS` list in `settings.py`.","cause":"The `django-eveonline-sde` package is either not installed or not added to your Django project's `INSTALLED_APPS`.","error":"ModuleNotFoundError: No module named 'eveonline_sde'"},{"fix":"Run `python manage.py migrate eveonline_sde` to create the database tables. If tables exist but are empty, run `python manage.py download_sde` followed by `python manage.py import_sde` to populate them.","cause":"The database migrations for `eveonline_sde` have not been applied, or the SDE data has not been imported yet.","error":"django.db.utils.ProgrammingError: relation \"eveonline_sde_invtype\" does not exist"},{"fix":"Ensure the user running `python manage.py import_sde` has full read/write permissions to your SQLite database file and its parent directory. If the issue persists, try stopping any other processes that might be accessing the database before running the import.","cause":"SQLite has locked the database file, or the Django process does not have write permissions to the database file or its directory, especially during SDE import.","error":"OperationalError: unable to open database file (when using SQLite)"}]}