Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

francium/microurl

Repository files navigation

Code Climate

micro url

URL shortener written in Python + Flask

Requirements: Python 3, Pip and mariadb (mysql should be supported as well)

Installation

  1. Make sure Python 3.6+ is installed.
  2. Install virtualenv.
$ sudo pip install virtualenv
  1. Create a virtual environment venv and specify the Python version to use.
$ virtualenv venv -p python3
$ source venv/bin/activate
  1. Install requirements.
$ pip install -r requirements.txt

Database Configuration

MariaDB or MySQL is required for the rest of the steps.

Create .config.json

{
    "user": "mysql_user",
    "password": "mysql_user's_password",
    "host": "mysql_server_ip",
    "db_name": "mysql_database"
}

Create table

$ python3 database.py create

Running

Debug

$ make debug    # Run with flask debugger

Run as application

$ make run      # Run application