Skip to content

An URL shortener using Django web application and deploying on Heroku Platform.

Notifications You must be signed in to change notification settings

SirishC/Simplify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simplify | Web Application

URL shortener using Django and Delpoying on Heroku.

live on : sirishurl

getting started

Setting Up Virtual Environment for Django in Linux/Mac.

To set up we need to install certain libraries .

virtualenv installation.

    $ pip install virtualenv 

creating a virtual environment folder.

    $ virtualenv python_virtual_env
    $ cd python_virtual_env

activate the virtual environment.

    $ source bin/activate 
    (python_virtual_env)$

we are done setting up virtual environment !
Now let us install Django in the virtual environment
Django installation is very simple

    (python_virtual_env)$pip install django 

we need to create a project to work on.

    (python_virtual_env)$ django-admin.py startproject Simple
    (python_virtual_env)$ cd Simple 

we have to create a superuser who is similar to an admin.

    (python_virtual_env)$ python manage.py createsuperuser 

It will prompts certain requirements like username , email , passwords ..
We have finish setting up our first Djando server.

    (python_virtual_env)$ python manage.py runserver

great🤟 :)
progress █████▒▒▒▒▒ 50 %


Creating an App for our project.

Now to create an app we have to run

    (python_virtual_env)$ python manage.py startapp simplify 

it can be any name.

We Are All set to build a web application. Cool:)!


Web Applications

Automatically should create a shortcode of each url
push it into the sqlite3(initially)
When the link already in the database same shortcode will be given.

progress ████████▒▒ 80 %
Awesome !

Deploy live on Heroku

Requirements

(python_virtual_env)$pip install heroku 
(python_virtual_env)$pip install django-heroku
(python_virtual_env)$pip install psycopg2
(python_virtual_env)$pip install whitenoise
(python_virtual_env)$pip install gunicorn

Create a Procfile and a requirements.txt and configuration
How to do it
Djando app while deploying on heroku there may be errors due to static files
Configuration of static files
Static files
Since heroku provides postgresql so we have to configure postgresql
Full Configuration
Finally on , Heroku Server where our app is running we have to run

    $python manage.py migrate

OUR APP IS UP IN RUNNING !! AWESOME !!

██████████ 100% Successfully Done !

References

CodeForEntrepreneurs they are awesome


About

An URL shortener using Django web application and deploying on Heroku Platform.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published