Operations Guide
The operations guide describes how to install, configure and maintain django-esi.
Installation
To install django-esi into your Django project please follow the these steps:
Step 1: Install the latest version directly from PyPI
pip install django-esi
Step 2: Add esi
to your INSTALLED_APPS
setting
INSTALLED_APPS += [
# other apps
'esi',
# other apps
]
Step 3: Include the esi urlconf in your project’s urls
url(r'^sso/', include('esi.urls', namespace='esi')),
Step 4: Register an application with the EVE Developers site
If your application requires scopes, select Authenticated API Access and register all possible scopes your app can request. Otherwise Authentication Only will suffice.
Set the Callback URL to https://example.com/sso/callback
Step 4: Add SSO client settings to your project settings
ESI_SSO_CLIENT_ID = "my client id"
ESI_SSO_CLIENT_SECRET = "my client secret"
ESI_SSO_CALLBACK_URL = "https://example.com/sso/callback"
Step 5: Run migrations to create models
python manage.py migrate
Upgrade
To update an existing installation please first make sure that you are in your virtual environment and in the main project folder (the one that has manage.py
). Then run the following commands one by one:
pip install -U django-esi
python manage.py migrate
python manage.py collectstatic
Finally restart your Django application, e.g. by restarting your supervisors.
Settings
Django-esi can be configured through settings by adding them to your Django settings file. Here is the list of the most commonly used settings:
Required settings
Required settings need to be set in order for django-esi to function.
- ESI_SSO_CALLBACK_URL = 'http://localhost:8000'
Callback for your Eve Online SSO app. REQUIRED.
- ESI_SSO_CLIENT_ID = 'test-dummy'
Client ID of your Eve Online SSO app. REQUIRED.
- ESI_SSO_CLIENT_SECRET = 'test-dummy'
Client Secret of your Eve Online SSO app. REQUIRED.
Hint
These settings can be left blank if DEBUG is set to True.
Optional settings
Optional settings will use the documented default if they are not set.
- ESI_ALWAYS_CREATE_TOKEN = False
Enable to force new token creation every callback.
- ESI_API_DATASOURCE = 'tranquility'
Change these to switch to Singularity.
- ESI_API_VERSION = 'latest'
Change this to access different revisions of the ESI API by default
- ESI_CACHE_RESPONSE = True
Disable to stop caching endpoint responses.
- ESI_CONNECTION_ERROR_MAX_RETRIES = 3
Max retries on failed connections.
- ESI_CONNECTION_POOL_MAXSIZE = 10
Max size of the connection pool.
Increase this setting if you hav more parallel threads connected to ESI at the same time.
- ESI_INFO_LOGGING_ENABLED = False
Enable/disable verbose info logging.
- ESI_LOG_LEVEL_LIBRARIES = 'INFO'
Set log level for libraries like bravado and urlib3.
- ESI_REQUESTS_CONNECT_TIMEOUT = 5
Default connection timeouts for all requests to ESI.
Can temporarily overwritten with by passing
timeout
withresult()
- ESI_REQUESTS_READ_TIMEOUT = 30
Default read timeouts for all requests to ESI.
Can temporarily overwritten with by passing
timeout
withresult()
- ESI_SERVER_ERROR_BACKOFF_FACTOR = 0.2
Backoff factor for retries on server error.
- ESI_SERVER_ERROR_MAX_RETRIES = 3
Max retries on server errors.
- ESI_USER_CONTACT_EMAIL = None
Contact email address of server owner.
This will be included in the User-Agent header of every request.
See also
For a list of all settings please see esi.app_settings
.