- Clone this repository.
- Create a virtualenv
virtualenv --python=python3.6 venv
- Install the requirements (
pip install -r requirements/common.txt
) - Run the database migrations (
python manage.py db upgrade
) - If you do not already have a redis instance running on your machine,Open a second terminal window and start a local Redis server (if you are on Linux or Mac, execute
python manage.py run_redis
to install and launch a private copy). - Open a third terminal window. Set two environment variables
MAIL_USERNAME
andMAIL_PASSWORD
to a valid EMAIL account credentials (these will be used to send emails through your SMTP server). - Then start a Celery worker:
python manage.py celery_worker
and Celery Beat:python manage.py celery_beat
. - Start Flasky on your first terminal window:
python manage.py runserver
. - Make calls to
http://localhost:5000/
for the api!
Note: Remember to set proper configuration variables in config.py
- Install apache2-dev and python3.6-dev
sudo aptitude install apache2-dev python3.6-dev
- Remove libapache2-mod-wsgi and libapache2-mod-wsgi-py3
sudo apt-get remove libapache2-mod-wsgi libapache2-mod-wsgi-py3
- Create a virtual environment or if you already have one, activate it.
- Install mod_wsgi
pip install mod_wsgi
- Install mod_wsgi module using
venv/bin/mod_wsgi-express install-module
and copy the output. - Create an apache2 module
wsgi_express.{conf,load}
with the contents copied in 5 above in/etc/apache2/mods-available
. - Enable the module
sudo a2enmod wsgi_express
- Restart apache2
- Go get a cup of coffee.
- Clone this repository
- Install the requirements globally (
pip install -r requirements/common.txt
) - Run the database migrations (
python manage.py db upgrade
) - Run the deployment script (
python manage.py deploy
) - Start redis if not running with (
python manage.py run_redis
) - Copy the supervisor configuration for celery worker and beat to supervisor
sudo cp -avr ./deploy_confs/celeryd.conf /etc/supervisor/conf.d
and change the absolute paths to match those on the system. - Start
celeryd.conf
with the following commands
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start celery-workers
confirm that the supervisor process is running by checking the celery beat and celery worker log files. - Using either the
apache2_mod_wsgi.conf
orapache2_proxy.conf
, setup your apache2 configuration, editing where required. Use theapplication.wsgi
for your mod_wsgi configuration. - Restart apache2 with
sudo apache2 reload
- Open the configured server name in a browser to check if everything is operational.
Note: Edit your celeryd.conf
,application.wsgi
and apache2_mod_wsgi.conf
with respect to your system.