Skip to content

immanuelraj/django-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Setup for Mac

  • Install python
    brew install python3
  • Install postgres
    brew install postgres
    brew install postgresql
  • Start postgres
    brew service start postgres
  • Create db
    createdb masterdb
  • Clone project
    git clone https://github.com/immanuelraj/django-project.git
    cd django-project/
  • Create virtualenv
    brew install mkvirtualenv
    mkvirtualenv --python=/usr/local/bin/python3 django-project
    workon django-project
  • Install packages
    pip install -r requirements.txt
  • To run the project
    cd project
    python manage.py migrate
    python manage.py collectstatic
    python manage.py createsuperuser
    python manage.py runserver

Project Setup for Ubuntu

  • Install Python
Sudo apt install python3.7
  • Install postgres
sudo apt install postgresql postgresql-contrib
sudo su postgres
createdb masterdb
  • Clone project
git clone https://github.com/immanuelraj/django-project.git
cd django-project/
  • Create virtualenv
sudo apt-get install python-pip
sudo pip install virtualenv
mkdir ~/.virtualenvs
sudo pip install virtualenvwrapper
export WORKON_HOME=~/.virtualenvs
. /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv django-project
workon django-project
pip install -r requirements.txt
  • To run the project
cd project
python manage.py migrate
python manage.py collectstatic
python manage.py createsuperuser
python manage.py runserver

Docker Setup by docker-compose

  • Download and Install docker application on mac

  • Create docker-compose.yml file and Add the Instruction

  • To run docker compose

    docker-compose up -d
  • To stop docker compose

    docker-compose down
  • connecting to django shell

    docker-compose exec web bash
    python manage.py shell
  • connecting to postgres

    docker-compose exec db bash
    psql -U admin masterdb

Docker Image and container

  • Create Dockerfile and Add the Instruction
  • Create a docker image
    docker build -t myimage:1 .
  • Create a docker container from image
    docker images
    docker run imageid
  • To clean up space used by docker
    docker system prune -a
    docker volumes prune

Heroku Setup

  • Install Heroku
    brew install heroku/brew/heroku
  • To Login to Heroku
    heroku login
  • Create heroku App
    heroku create django-project-app
  • Install django-heroku package and add it in settings
  • Add Procfile under root directory
  • Add domain to allowed_host
  • To push to Heroku
    git push heroku master
  • Basic Setup
    heroku run python manage.py migrate
    heroku run python manage.py createsuperuser
  • Add config
    heroku config:set SECRET_KEY='key'

Features

  • Login URL

    https://immanuelraj.herokuapp.com/accounts/login/
    
  • SignUp URL

    https://immanuelraj.herokuapp.com/accounts/signup/
  • Portfolio

    https://immanuelraj.herokuapp.com/
  • Create Dummy data

    python manage.py create_dummy_data
  • User Activity API

    https://immanuelraj.herokuapp.com/activity/user-activity/
    https://immanuelraj.herokuapp.com/activity/user-activity/?search=vwyfj9k1gr
    https://immanuelraj.herokuapp.com/activity/user-activity/?page=2
  • To add hotel

    cd ../scripts
    python add_hotel.py
    or
    https://immanuelraj.herokuapp.com/admin/hotel/hotel/add/
  • To add room

    python add_room.py
    or
    https://immanuelraj.herokuapp.com/dmin/hotel/room/add/
  • To view rooms

    python room_list.py
    or
    https://immanuelraj.herokuapp.com/hotel/room-list/
  • To view rooms by budget

    python price_wise_room_list.py
    or
    https://immanuelraj.herokuapp.com/hotel/room-list/?budget=50

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors