UrlShortener
UrlShortener copied to clipboard
Shortens long urls. Select from a list of available hosts.
UrlShortener
A Django web app that shortens long urls. User may select from a list of available hosts.
Available Hosts
- Tinyurl
- Is.gd
- Bit.ly
- Google URL Shortener
- Rebrand.ly
Pre-reqs
Virtualenv - Install required packages in a virtual environment. Not necessary, but recommended.
Installation
-
virtualenv YOURENVNAME
- Create new virtualenv for this project - Navigate to directory containing 'requirements.txt'
-
pip install -r requirements.txt
- Install required packages
Usage
On first usage you'll need to apply database migrations: python manage.py migrate
Otherwise run development server using: python manage.py runserver
Testing
Tests are run using pytest
For more information: pytest
Contributions
Getting Started
- Create a fork and then clone your fork of the repo
- Follow steps for Installation
- Ensure project runs: Usage
- Ensure tests pass: Testing
- Implement your changes along with tests for your change
- Push changes to your fork and submit a pull request
Adding a new host
This project uses the pyshorteners library for url shortening, read their documentation for more information on implementing a new host: pyshorteners
Docker
- Clone repository
- Make sure you have execute permission on run.sh and Docker is installed (Linux, 'chmod +x run.sh' in the repo)
- Run run.sh like ' ./run.sh '
- Visit localhost:8000 and watch it run