https://github.com/francium/microurl
URL shortener written in Python + Flask
https://github.com/francium/microurl
flask python url-shortener
Last synced: about 1 year ago
JSON representation
URL shortener written in Python + Flask
- Host: GitHub
- URL: https://github.com/francium/microurl
- Owner: francium
- License: mit
- Archived: true
- Created: 2017-03-04T19:00:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-10-09T22:22:28.000Z (over 7 years ago)
- Last Synced: 2025-05-02T23:08:31.894Z (about 1 year ago)
- Topics: flask, python, url-shortener
- Language: Python
- Homepage: http://microurl.ml
- Size: 672 KB
- Stars: 12
- Watchers: 1
- Forks: 4
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://codeclimate.com/github/francium/microURL)
# 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+](https://www.python.org/downloads/) is installed.
2. Install [virtualenv](https://virtualenv.pypa.io/en/stable/).
```
$ sudo pip install virtualenv
```
3. Create a virtual environment venv and specify the Python version to use.
```
$ virtualenv venv -p python3
$ source venv/bin/activate
```
4. 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
```