Skip to content

rakeshchoyal92/backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

1. Local server setup

2. Docker deployment

##Setting required env's

  • Rename env.sample (inside backend/docker/) to .env
  • Change the value of BACKEND_SOURCE pointing to the right path in your local system

Running docker

  • Navigate to backend/docker/ and run the command docker-compose up on your terminal
  • Test if the web server is running in the docker using the command docker ps or alternatively visit localhost:8000 in the browser.

3. Heroku

Create Heroku Project

After installing heroku, first login with your heroku account in terminal/console: heroku login then create an empty heroku project: heroku create Heroku will create random name directory for the project cd [project_name] and set the buildpack environment for python: heroku buildpacks:set heroku/python at last, move your django files to this directory

Deploy Project on Heroku

Now the project is setup, the next step is deploying it to heroku. We need to have two documents:

  • requirements.txt
  • Procfile(no .extend)

requirments.txt is telling heroku what should be installed for the deployment server, it can simply generated by calling pip freeze > requirements.txt we need to have two extra package for our project to run, adding the following lines in requirments.txt: django-cors-headers==2.4.0 gunicorn==19.7.1

Procfile is telling what the deployment server will automatlly run: web: gunicorn [servername].wsgi --log-file - the [servername] is the name of the django project, it is named server in our project.

Heroku is using git to publish, so next, we will need to add all our change in the heroku project and commit them. git add * git commit -m "deploy project" then we will push to heroku master branch: git push heroku master

About

Planimation Backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.9%
  • HTML 7.0%
  • Dockerfile 2.1%