Built with Python 3.5 and Django 🐍
API documentation | Running instance
Clone this repository:
git clone https://github.com/IIC2173-2016-2/arquitran.git
cd arquitran
pip install -U virtualenv
virtualenv --python=python3.5 arquitranenv
source ./arquitranenv/bin/activate
# To stop using this virtualenv:
deactivate
Install dependencies:
pip install -r requirements.txt
Open the Postgres interactive command line:
psql
Create the user, database and grant him permissions:
CREATE DATABASE arquitran;
CREATE USER arquitranuser WITH PASSWORD 'password';
ALTER USER arquitranuser CREATEDB;
GRANT ALL PRIVILEGES ON DATABASE arquitran TO arquitranuser;
Make migrations:
python manage.py migrate
Start the app at http://localhost:8000/
with:
python manage.py runserver
Make sure you have Docker and Docker-compose installed.
Create Docker volume:
docker volume create --name=alquitran-data
Setup environment variables:
# Keep this secret
export POSTGRES_PASSWORD=SECRET_AND_LONG_HASH
export SECRET_KEY=SECRET_AND_LONG_HASH
Run Docker-compose:
docker-compose up -d
Run migrations:
docker-compose exec django python manage.py migrate
Create super user:
docker-compose exec django python manage.py createsuperuser --username=admin --email=admin@example.com
Update app with short downtime:
docker-compose up -d --build
Run the test suite with:
python manage.py test