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])!

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
Highlight the keywords of a page if a visitor is coming from a search engine.

Django-SEKH Django Search Engine Keywords Highlighter, is a middleware for Django providing the capacities to highlight the user's search keywords if

Julien Fache 24 Oct 08, 2021
Improved Django model inheritance with automatic downcasting

Polymorphic Models for Django Django-polymorphic simplifies using inherited models in Django projects. When a query is made at the base model, the inh

1.4k Jan 03, 2023
Django-Text-to-HTML-converter - The simple Text to HTML Converter using Django framework

Django-Text-to-HTML-converter This is the simple Text to HTML Converter using Dj

Nikit Singh Kanyal 6 Oct 09, 2022
Django models and endpoints for working with large images -- tile serving

Django Large Image Models and endpoints for working with large images in Django -- specifically geared towards geospatial tile serving. DISCLAIMER: th

Resonant GeoData 42 Dec 17, 2022
Django Simple Spam Blocker is blocking spam by regular expression.

Django Simple Spam Blocker is blocking spam by regular expression.

Masahiko Okada 23 Nov 29, 2022
Plug and play continuous integration with django and jenkins

django-jenkins Plug and play continuous integration with Django and Jenkins Installation From PyPI: $ pip install django-jenkins Or by downloading th

Mikhail Podgurskiy 941 Oct 22, 2022
GameStop clone with Django

GameStop clone with Django This is my side project with GameStop clone Author: HackerApe GitHub Profile: View Profile LinkedIn Profile: View Profile

Dmitriy Shin 2 Dec 26, 2021
Simple reproduction of connection leak with celery/django/gevent

Redis connection leak with celery/django/gevent Reproduces celery issue at https://github.com/celery/celery/issues/6819 using gevented django web serv

2 Apr 03, 2022
Log and View requests made on Django

Django Request Viewer Log and view requests made on your Django App Introduction Recently, @ichtrojan and @toniastro released horus, a request logger

Akere Mukhtar 26 May 29, 2022
Updates redisearch instance with igdb data used for kimosabe

igdb-pdt Update RediSearch with IGDB games data in the following Format: { "game_slug": { "name": "game_name", "cover": "igdb_coverart_url",

6rotoms 0 Jul 30, 2021
A visual indicator of what environment/system you're using in django

A visual indicator of what environment/system you're using in django

Mark Walker 4 Nov 26, 2022
Loguru is an exceeding easy way to do logging in Python

Django Easy Logging Easy Django logging with Loguru Loguru is an exceeding easy way to do logging in Python. django-easy-logging makes it exceedingly

Neutron Sync 8 Oct 17, 2022
Django Pickled Model

Django Pickled Model Django pickled model provides you a model with dynamic data types. a field can store any value in any type. You can store Integer

Amir 3 Sep 14, 2022
Store events and publish to Kafka

Create an event from Django ORM object model, store the event into the database and also publish it into Kafka cluster.

Diag 6 Nov 30, 2022
Code coverage measurement for Python

Coverage.py Code coverage testing for Python. Coverage.py measures code coverage, typically during test execution. It uses the code analysis tools and

Ned Batchelder 2.3k Jan 05, 2023
With Django Hijack, admins can log in and work on behalf of other users without having to know their credentials.

Django Hijack With Django Hijack, admins can log in and work on behalf of other users without having to know their credentials. Docs 3.x docs are avai

1.2k Jan 05, 2023
Sistema de tratamento e análise de grandes volumes de dados através de técnicas de Data Science

Sistema de tratamento e análise de grandes volumes de dados através de técnicas de data science Todos os scripts, gráficos e relatórios de todas as at

Arthur Quintanilha Neto 1 Sep 05, 2022
Django CRUD REST API Generator

Django CRUD REST API Generator This is a simple tool that generates a Django REST API with the given models. Specs: Authentication, DRF generic views,

Mehmet Alp Sümer 57 Nov 24, 2022
The uncompromising Python code formatter

The Uncompromising Code Formatter “Any color you like.” Black is the uncompromising Python code formatter. By using it, you agree to cede control over

Python Software Foundation 30.7k Jan 03, 2023
Fast / fuzzy PostgreSQL counts for Django

Created by Stephen McDonald Introduction Up until PostgreSQL 9.2, COUNT queries generally required scanning every row in a database table. With millio

stephenmcd 85 Oct 25, 2021