Git Product home page Git Product logo

url_short's Introduction

Coding Challenge: URL Shortener - Django

A django app designed to make your urls pretty and less of a hassle!

Description & Task Requirements

Users can enter a URL e.g "https://www.hello-i-am-a-long-url.com" and get shortened one back e.g. "https://127.0.0.1:8000/UDHYX" which redirects to their original URL.

  • Users should be able to enter a url into an input box on your website's front page
  • Your backend will then generate a shortened path at which a User can access their url
  • You must implement Python in some capacity in this application
  • Store this shortened path and it's longer counterpart in a database
  • No login should be required to create a shortened URL
  • If User tries to access your website with a path you have stored in your database, they should get rerouted to the URL it relates to
  • If User tries to access your website with a path you do not have stored in your database, they should get rerouted to the homepage where they can create a new short URL

Installation & usage

For our app to be run on your local machine:

Clone this repo and navigate to the root directory of this repo.
pipenv shell
pipenv install
cd url_shortener
python manage.py runserver

It should load on http://127.0.0.1:8000/

Technologies

django

Process

  1. Create repo and link to local file
  2. Bootstrap a django project using django-admin startproject app
  3. Set up root route '/' and '/str:id' for dynamic id
  4. Create a form with templating to ask users for URL and on submit POST URL to database and return a short URL path
  5. Create out of bounds routes and error handling
  6. Styling and UI updates
  7. Attempt to deploy to Heroku
  8. Finalise and complete task requirements

Bugs

  • there may be environment issues - delete and reinstall Pipfile.lock!

Wins & Challenges

Wins

  • Form works!
  • Random string generator is an easy and straightforward way to generate a short URL path

Challenges

  • Deployment via Heroku with Django - static files issues
  • Redirecting link to new page without 'https://'
  • Difficulties setting up test suite!

url_short's People

Contributors

ravil-96 avatar natbibi avatar jameswheadon avatar

Watchers

 avatar

Forkers

natbibi

url_short's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.