Skip to content

IIC2173-2016-2/arquitran

Repository files navigation

Alquitrán Web Payments © REST API

Built with Python 3.5 and Django 🐍

Build Status

screenshot

API documentation | Running instance

Development

Clone this repository:

git clone https://github.com/IIC2173-2016-2/arquitran.git
cd arquitran

Prepare virtualenv:

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

Setup Postgres database:

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

Run server

Start the app at http://localhost:8000/ with:

python manage.py runserver

Production

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

Testing

Run the test suite with:

python manage.py test

About

Web Payments & Transactions 🐍 🐘 🐳

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published