Giter Site home page Giter Site logo

heroku-django's Introduction

heroku-django

A 'press play' script for setting up your Django environment and deploying it to Heroku.

All you have to do is source setup_django_heroku.sh YOUR-PROJECT-NAME YOUR-HEROKU-APP-NAME, and then fill in your Django admin user details when prompted. (This assumes that all necessary dependencies are installed. Read below before running the script.)


Before You Get Started

  1. Make sure you have an account on Heroku.
  2. This script has only been testing on Ubuntu 14.04. Let me know if you test it on something different.
  3. I recommend installing the latest version of either Python 2.x or 3.x before you start.

If you don't have pip...

sudo apt-get update
sudo apt-get install python-pip

If you don't have virtualenv...

sudo apt-get update
sudo apt-get install python-virtualenv

If you don't have git...

sudo apt-get update
sudo apt-get install git
git config --global user.email "[email protected]"
git config --global user.name "Your Name"

If you don't have Heroku-CLI...

sudo apt-get update
sudo apt-get install ruby-full
sudo add-apt-repository "deb https://cli-assets.heroku.com/branches/stable/apt ./"
curl -L https://cli-assets.heroku.com/apt/release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install heroku
heroku login

Running the Script

Alright, here we go!

git clone https://github.com/stevenrouk/heroku-django
source setup_django_heroku.sh YOUR-PROJECT-NAME YOUR-HEROKU-APP-NAME

Then just fill in your Django admin user details when prompted.

That's it.


Example.

source setup_django_heroku.sh mysite classy-penguin-91919

Some Notes

  • Heroku app name: The script attempts to create a Heroku app with whatever name you provide, but the app name must be unique on Heroku or the script will fail. Try to come up with a name that you think no one else will have used before.
  • Virtualenv & git: This script will create and activate a virtual environment for you, as well as create a git repo and add all files that should be in version control to a first commit.

Best Practices

Using this script also helps you follow some best practices, like:

  • Keeping your SECRET_KEY out of version control,
  • Having Debug=False in your production settings file, and a local_settings file with Debug=True, and
  • Using a virtual environment.

These things are already accounted for when the script sets up your environment, so you don't have to worry about it.

heroku-django's People

Contributors

solkaz avatar stevenrouk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

wowkin2

heroku-django's Issues

setup_django_heroku.sh doesn't check for valid Django project name

The bash script doesn't check if a valid Django project name was entered, which if the user didn't do (such as inputting nothing), then the project files aren't generated, but the script will still generate a Heroku app; it probably should instead alert the user and exit the script

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.