URL shortener written in Python + Flask
Requirements: Python 3, Pip and mariadb (mysql should be supported as well)
- Make sure Python 3.6+ is installed.
- Install virtualenv.
$ sudo pip install virtualenv
- Create a virtual environment venv and specify the Python version to use.
$ virtualenv venv -p python3
$ source venv/bin/activate
- Install requirements.
$ pip install -r requirements.txt
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
Debug
$ make debug # Run with flask debugger
Run as application
$ make run # Run application