Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 1.9 KB

setup-without-docker.md

File metadata and controls

91 lines (64 loc) · 1.9 KB

Setup

Use this guide if you do NOT want to use Docker in your project.

Getting Started

Create and activate a virtual environment (venv), and then install the requirements.

$ cd myproject
$ python3 -m venv venv
$ . venv/bin/activate
$ pip install -r requirements.txt

Set Environment Variables

Update project/server/config.py, and then run:

$ export APP_NAME="Skills Extractor"
$ export APP_SETTINGS="project.server.config.ProductionConfig"
$ export FLASK_DEBUG=0

By default the app is set to use the production configuration. If you would like to use the development configuration, you can alter the APP_SETTINGS environment variable:

$ export APP_SETTINGS="project.server.config.DevelopmentConfig"

Start related applications/services

  1. Database default is sqlite. You can view/edit config at project/server/config.py
  2. Elasticsearch to index document
  3. RabbitMQ and Celery worker support index document asynchronous
celery -A manage.celery worker --loglevel=INFO

Using Pipenv or python-dotenv? Use the .env file to set environment variables:

APP_NAME="Skills Extractor"
APP_SETTINGS="project.server.config.DevelopmentConfig"
FLASK_DEBUG=1

Create DB

$ python manage.py create-db
$ python manage.py db init
$ python manage.py db migrate
$ python manage.py create-admin
$ python manage.py create-data

Run the Application

$ python manage.py run

Access the application at the address http://localhost:5000/

Testing

Without coverage:

$ python manage.py test

With coverage:

$ python manage.py cov

Run flake8 on the app:

$ python manage.py flake

or

$ flake8 project