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_CACHE_RESPONSE = True
Disable to stop caching endpoint responses.
- ESI_CONNECTION_POOL_KEEPALIVE_EXPIRY = 5
Time limit on idle keep-alive connections in seconds
- ESI_CONNECTION_POOL_MAX_CONNECTIONS = 100
Maximum number of allowable connections
- ESI_CONNECTION_POOL_MAX_KEEPALIVE = 20
Number of allowable keep-alive connections
- ESI_REQUESTS_CONNECT_TIMEOUT = 5
Default connection timeouts for all requests to ESI.
- ESI_REQUESTS_POOL_TIMEOUT = 5
Default pool timeouts for all requests to ESI
- ESI_REQUESTS_READ_TIMEOUT = 10
Default read timeouts for all requests to ESI. This should be a maximum of 10s as ESI cuts all requests to the monolith off @ 10s.
- ESI_REQUESTS_WRITE_TIMEOUT = 5
Default write timeouts for all requests to ESI.
- ESI_SERVER_ERROR_MAX_RETRIES = 3
Max retries on server errors.
- ESI_SERVER_ERROR_WAIT_EXPONENT = 1
- ESI_USER_CONTACT_EMAIL = 'email@example.com'
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.