Skip to content

Shurl is a URL shortening application built with Django. It allows users to create short URLs for their long URLs.

License

Notifications You must be signed in to change notification settings

GuilhermeCAz/shurl_django

Repository files navigation

Shurl

License: MIT Django CI Python Version from PEP 621 TOML Django Docker PostgreSQL Make Ruff Checked with mypy OpenAPI Github Actions

Shurl is a URL shortening application built with Django. It allows users to create short URLs for their long URLs.

Features

  • Shorten long URLs
  • Redirect to the original URL using the shortened URL
  • User authentication and registration // TODO
  • URL statistics // TODO

Project Setup

Clone this repository:

git clone https://github.com/GuilhermeCAz/shurl_django.git
cd shurl_django

Create a .env file according to .env.example.

To build the Docker images and start the project in detached mode, use the following command:

docker compose up --build --detach

Using Make:

make up

Make Migrations

docker compose run web python manage.py makemigrations
docker compose run web python manage.py migrate

Using Make:

make migrate

Optional: To create a superuser for the Django admin, run:

docker compose run web python manage.py createsuperuser --noinput

Using Make:

make superuser

You'll need to set the necessary environment variables for the superuser credentials beforehand.

Usage

  1. Visit the Shurl homepage: http://localhost:8000
  2. Paste a long URL into the input field and click "Shorten".
  3. Copy the shortened URL and use it to share with others.
  4. Click the shortened URL to be redirected to the original URL.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

Installation (for development only)

Create .venv

python -m venv .venv

Activate the virtual environment

.venv/scripts/activate

Install dependencies

python -m pip install --upgrade pip
pip install -r requirements-dev.txt

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Shurl is a URL shortening application built with Django. It allows users to create short URLs for their long URLs.

Topics

Resources

License

Stars

Watchers

Forks