Building a web application to organize EVE Tournaments, starting with solo queue
The following libraries are used:
- Flask for the webapp part
- EsiPy for the ESI API
- Flask-Login for the login / session process
- Flask-SQLAlchemy and SQLAlchemy for the database part
- Flask-Migrate for the migration commands
You will also require:
- Virtualenv to setup virtualenv
- Depending on the database you want to use, the required libraries (by default this example uses SQLite, which is embedded in Python)
Also, this example is made with Python 2.7, it might works with Python 3, but you may have to correct some lines of code
- Clone the repository on your system
git clone https://github.com/aliaras/eve-tournaments.git
- Create a virtualenv
cd flask-esipy-example
virtualenv venv
source venv/bin/activate
- Install requirements
pip install -r requirements.txt
- Setup the FLASK_APP environment variable
export FLASK_APP=app.py
Create your app in https://developers.eveonline.com
- Go to https://developers.eveonline.com
- Login and go to
manage applications
- Create a new application
- Fill all the fields
Requirements:
- For the scope, you will need the publicData scope
- The callback URL must be
http://<SOME_IP_OR_DOMAIN>:<SOME_PORT>/sso/callback
- Copy and rename the
config.dist
toconfig.py
- Edit it.
PORT = <SOME_PORT>
HOST = '<THE_HOST_YOURE_RUNNING_ON>'
# If using a reverse-proxy to direct traffic, fill in the proxy's hostname here
EXTERNAL_HOST = '<HOST_FROM_BROWSER>'
SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db' # this is your database connection informations http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls
# Fill these lines with the data you get from https://developers.eveonline.com
ESI_SECRET_KEY = '' # your secret key
ESI_CLIENT_ID = '' # your client ID
flask db upgrade
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> fab636b98bc7, create_user_table
python app.py
- Restarting with stat
- Debugger is active!
- Debugger PIN: 206-933-487
- Running on http://localhost:5015/ (Press CTRL+C to quit)
And now you can connect to http://localhost:5015/ to see it working (if you kept default configs). I recommend caddy as a reverse proxy if you need one, it's very easy.