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
Set the draft security HTTP header Permissions-Policy (previously Feature-Policy) on your Django app.

django-permissions-policy Set the draft security HTTP header Permissions-Policy (previously Feature-Policy) on your Django app. Requirements Python 3.

Adam Johnson 78 Jan 02, 2023
Returns unicode slugs

Python Slugify A Python slugify application that handles unicode. Overview Best attempt to create slugs from unicode strings while keeping it DRY. Not

Val Neekman (AvidCoder) 1.3k Dec 23, 2022
A starter template for building a backend with Django and django-rest-framework using docker with PostgreSQL as the primary DB.

Django-Rest-Template! This is a basic starter template for a backend project with Django as the server and PostgreSQL as the database. About the templ

Akshat Sharma 11 Dec 06, 2022
Extensions for using Rich with Django.

django-rich Extensions for using Rich with Django. Requirements Python 3.6 to 3.10 supported. Django 2.2 to 4.0 supported. Are your tests slow? Check

Adam Johnson 88 Dec 26, 2022
Auto-detecting the n+1 queries problem in Python

nplusone nplusone is a library for detecting the n+1 queries problem in Python ORMs, including SQLAlchemy, Peewee, and the Django ORM. The Problem Man

Joshua Carp 837 Dec 29, 2022
A Django application that provides country choices for use with forms, flag icons static files, and a country field for models.

Django Countries A Django application that provides country choices for use with forms, flag icons static files, and a country field for models. Insta

Chris Beaven 1.2k Dec 31, 2022
Automatically upgrade your Django projects.

django-upgrade Automatically upgrade your Django projects. Installation Use pip: python -m pip install django-upgrade Python 3.8 to 3.10 supported. Or

Adam Johnson 525 Dec 29, 2022
Django Audit is a simple Django app that tracks and logs requests to your application.

django-audit Django Audit is a simple Django app that tracks and logs requests to your application. Quick Start Install django-audit pip install dj-au

Oluwafemi Tairu 6 Dec 01, 2022
Automated image processing for Django. Currently v4.0

ImageKit is a Django app for processing images. Need a thumbnail? A black-and-white version of a user-uploaded image? ImageKit will make them for you.

Matthew Dapena-Tretter 2.1k Jan 04, 2023
Django Livre Bank

Django Livre Bank Projeto final da academia Construdelas. API de um banco fictício com clientes, contas e transações. Integrantes da equipe Bárbara Sa

Cecília Costa 3 Dec 22, 2021
Full control of form rendering in the templates.

django-floppyforms Full control of form rendering in the templates. Authors: Gregor Müllegger and many many contributors Original creator: Bruno Renié

Jazzband 811 Dec 01, 2022
Transparently use webpack with django

Looking for maintainers This repository is unmaintained as I don't have any free time to dedicate to this effort. If you or your organisation are heav

Owais Lone 2.4k Jan 06, 2023
A Django app for working with BTCPayServer

btcpay-django A Django app for working with BTCPayServer Installation pip install btcpay-django Developers Release To cut a release, run bumpversion,

Crawford 3 Nov 20, 2022
Django API without Django REST framework.

Django API without DRF This is a API project made with Django, and without Django REST framework. This project was done with: Python 3.9.8 Django 3.2.

Regis Santos 3 Jan 19, 2022
System checks for your project's environment.

django-version-checks System checks for your project's environment. Requirements Python 3.6 to 3.9 supported. Django 2.2 to 3.2 supported. Are your te

Adam Johnson 33 Dec 22, 2022
Customize the behavior of django.contrib.auth permissions.

Customizando o comportamento do django.contrib.auth. O que queremos? Não criar as permissões padrões automaticamente (add, delete, view, read). Criar

Henrique Bastos 7 Nov 26, 2022
A tool to automatically fix Django deprecations.

A tool to help upgrade Django projects to newer version of the framework by automatically fixing deprecations. The problem When maintaining a Django s

Bruno Alla 155 Dec 14, 2022
Django admin CKEditor integration.

Django CKEditor NOTICE: django-ckeditor 5 has backward incompatible code moves against 4.5.1. File upload support has been moved to ckeditor_uploader.

2.2k Dec 31, 2022
Django Advance DumpData

Django Advance Dumpdata Django Manage Command like dumpdata but with have more feature to Output the contents of the database from given fields of a m

EhsanSafir 7 Jul 25, 2022
Django Login Api With Python

How to run this project Download and extract this project Create an environment and install all the libraries from requiements.txt pip freeze -r requi

Vikash Kisku 1 Dec 10, 2021