A Django web application that shortens long URLs. This is a demo project to show off my tech abilities.

Overview

Django URL Shortener

This project is just a complete and production-ready URL shortener web application to show off my tech and coding abilities.

Important Note

Since this is a demo project, I committed .env files. Please never commit important configs

Features

  • Users can login with email and password.
  • Forms can be protected by Google ReCaptcha. (For example register form in this project)
  • Users can shorten their long urls.
  • Users can have their customized short url by setting alias.
  • Users can monitor some analytics in their dashboard. (total clicks and unique clicks)
  • Users can edit their URLs.
  • Users can delete their URLs.

Used Technologies

  • Python Programming Language
  • Django Web Framework
  • Docker and Docker Compose
  • Nginx and Gunicorn
  • PostgresQL
  • HTML, CSS, and Bootstrap v4
  • JavaScript and jQuery
  • ChartJS

Used Techniques

  • Class Based Views
  • Pagination
  • Separated configs for production and development

Used Third-Party Libraries

  • hashids
  • django-bootstrap4
  • django-recaptcha

Screenshots

Index Page

Analytics Page

Chart Page

Useful Docker Commands

Here are some code snippets related to setting up this project.

Building

Development:

sudo docker-compose -f docker-compose.yml --build -d

Production:

sudo docker-compose -f docker-compose.prod.yml --build -d

Following Logs

Development:

sudo docker-compose -f docker-compose.yml logs -f

Production:

sudo docker-compose -f docker-compose.prod.yml logs -f

Migration

In development migration are applied automatically in entrypoint.sh.

Production:

sudo docker-compose -f docker-compose.prod.yml exec web python manage.py migrate

Collect Static Files

In development there is no need to collect static files!

Production:

sudo docker-compose -f docker-compose.prod.yml exec web python manage.py collectstatic --noinput --clear

Fill Database with Fake Data

For demo purposes only In development database is filled automatically in entrypoint.sh.

Production:

sudo docker-compose -f docker-compose.prod.yml exec web python manage.py fill_db

After executing this command an admin user will created for you:

Future Works

  • Add user email verification.
  • Protect login with reCaptcha.
  • Support other languages.
  • Add caching (redis).
  • Load tests.
  • More unit tests.

Thanks for your attention!

Feel free to create issues, pull requests or even contact me ([email protected])!

You might also like...
A Django web application to receive, virus check and validate transfers of digital archival records, and allow archivists to appraise and accession those records.

Aurora Aurora is a Django web application that can receive, virus check and validate transfers of digital archival records, and allows archivists to a

A Django web application that allows you to be in the loop about everything happening in your neighborhood.
A Django web application that allows you to be in the loop about everything happening in your neighborhood.

A Django web application that allows you to be in the loop about everything happening in your neighborhood. From contact information of different handyman to meeting announcements or even alerts.

This is a simple Todo web application built Django (back-end) and React JS (front-end)

Django REST Todo app This is a simple Todo web application built with Django (back-end) and React JS (front-end). The project enables you to systemati

This is a repository for a web application developed with Django, built with Crowdbotics

assignment_32558 This is a repository for a web application developed with Django, built with Crowdbotics Table of Contents Project Structure Features

Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.
Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.

Django-environ django-environ allows you to use Twelve-factor methodology to configure your Django application with environment variables. import envi

Rosetta is a Django application that eases the translation process of your Django projects
Rosetta is a Django application that eases the translation process of your Django projects

Rosetta Rosetta is a Django application that facilitates the translation process of your Django projects. Because it doesn't export any models, Rosett

Django-Audiofield is a simple app that allows Audio files upload, management and conversion to different audio format (mp3, wav & ogg), which also makes it easy to play audio files into your Django application.
Django-Audiofield is a simple app that allows Audio files upload, management and conversion to different audio format (mp3, wav & ogg), which also makes it easy to play audio files into your Django application.

Django-Audiofield Description: Django Audio Management Tools Maintainer: Areski Contributors: list of contributors Django-Audiofield is a simple app t

django Filer is a file management application for django that makes handling of files and images a breeze.
django Filer is a file management application for django that makes handling of files and images a breeze.

django Filer is a file management application for django that makes handling of files and images a breeze.

django-reversion is an extension to the Django web framework that provides version control for model instances.

django-reversion django-reversion is an extension to the Django web framework that provides version control for model instances. Requirements Python 3

Owner
Seyyed Ali Ayati
I'm 22 years old, interested in Python programming language and its libraries and frameworks, also in love with software and its development process!
Seyyed Ali Ayati
Use Database URLs in your Django Application.

DJ-Database-URL This simple Django utility allows you to utilize the 12factor inspired DATABASE_URL environment variable to configure your Django appl

Jacob Kaplan-Moss 1.3k Dec 30, 2022
TinyApp - A Python (Django) Full Stack Application for shortening URLs

TinyApp A Python (Django) Full Stack Application for shortening URLs. How to sta

Li Deng 1 Jan 23, 2022
demo project for django channels tutorial

django_channels_chat_official_tutorial demo project for django channels tutorial code from tutorial page: https://channels.readthedocs.io/en/stable/tu

lightsong 1 Oct 22, 2021
django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the dashboard framework Dashing

django-dashing django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project.

talPor Solutions 703 Dec 22, 2022
Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project

Django URL Shortener Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project Install this package to your Dja

Rishav Sinha 4 Nov 18, 2021
A beginner django project and also my first Django project which involves shortening of a longer URL into a short one using a unique id.

Django-URL-Shortener A beginner django project and also my first Django project which involves shortening of a longer URL into a short one using a uni

Rohini Rao 3 Aug 8, 2021
Show how the redis works with Python (Django).

Redis Leaderboard Python (Django) Show how the redis works with Python (Django). Try it out deploying on Heroku (See notes: How to run on Google Cloud

Tom Xu 4 Nov 16, 2021
A simple Django dev environment setup with docker for demo purposes for GalsenDev community

GalsenDEV Docker Demo This is a basic Django dev environment setup with docker and docker-compose for a GalsenDev Meetup. The main purposes was to mak

null 3 Jul 3, 2021
Simple yet powerful and really extendable application for managing a blog within your Django Web site.

Django Blog Zinnia Simple yet powerful and really extendable application for managing a blog within your Django Web site. Zinnia has been made for pub

Julien Fache 2.1k Dec 24, 2022
PWA is a simple Django app to develope and deploy a Progressive Web Application.

PWA PWA is a simple Django app to develope and deploy a Progressive Web Application. Detailed documentation is in the "docs" directory. Quick start Ad

Nima 6 Dec 9, 2022