Coder Social home page Coder Social logo

django-blog's Introduction

django-example-project

  • Demonstrates best practices I have learned with my time spent working with Django.
  • Currently targets Django 1.5.

Features

This repository demonstrates:

  • Repository-level layout and organization
  • Project-level layout and organization
  • Gunicorn WSGI HTTP Server
  • Procfile-based process management with Foreman, which is great for deploying to Heroku
  • Supervisor based process management

Installation

This process assumes a basic knowledge of the Python ecosystem. If you are unfamilliar with Pip, Virtualenv and it's counterpart Virtualenvwrapper, and the like, you may want to do some initial research into those topics.

  1. Create a virtual environment mkvirtualenv django-example-project
  2. Clone this repository git clone [email protected]:RyanBalfanz/django-example-project.git
  3. From within the repository root, install project dependencies pip install -r requirements.txt

Usage

Once you have cloned this repository, you can run the example project with either Foreman or Supervisor. Either approach is fine.

I've found that Supervisor works great for local development where you have multiple processes to manage (usually a database such as PostgreSQL or MySQL) in conjunction with the Django Python process. I usually use a managed database solution such as Heroku Postgres or Amazon RDS for staging and production deployments, and a local install for my local development.

The choice is, obviously, up to you. Not being able to blow away your entire staging database as easily as rf -rf ./db or whatever is a best practice in my experience because it forces you to use migrations and be thoughtful about how to treat your database.

Running with Foreman

Foreman goes well with Heroku. To run the application with Foreman simply run foreman start in the repository root (where the Procfile lives).

Running with Supervisor

Alternatively, to run the application with Supervisor simply run supervisord in the repository root (where the supervisord.conf file lives).

django-blog's People

Contributors

ryanbalfanz avatar

Watchers

 avatar  avatar

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.