virtualenv -p /usr/bin/python3.5 env && source env/bin/activate
pip install SQLAlchemy aiohttp aiopg gunicorn
To (re)create the database and populate it:
python db.py
To run the server using aiohttp's own server:
python server.py
To run the server using gunicorn:
gunicorn -b 0.0.0.0:8000 -k aiohttp.worker.GunicornWebWorker "server:app()"
(You can add the --reload
argument to reload the server on file changes.)
For Postgres Server - 9.4.8;
dsn needs to be changed to as follows in order for the above script to work..
dsn = "host=localhost port=5432 user=postgres password=postgres dbname=postgres"