GithubHelp home page GithubHelp logo

django-chef's Introduction

django-chef

django-chef is a project that will help you provision a server for your Django app. It will install all the pieces of a modern web application and give you the tools to deploy with a single command.

You can use this project as a starting point. It includes a vagrant configuration which allows you to test your configuration and develop inside the same environment that you would in production.

Quick start

$ git clone git://github.com/honza/django-chef.git
$ cd django-chef
# add yourself to the "users" array in the Vagrantfile
$ sudo echo "127.0.0.1 example.example.com" >> /etc/hosts
$ vagrant up
$ fab vagrant:honza bootstrap  # replace with your name
$ vagrant ssh
$ run

Then open your browser to http://example.example.com:3456.

What it installs

  • nginx
  • postgresql
  • redis
  • git

How it works

Your django project goes into the src/ directory. Right now it includes a simple bare-bones project. You should place your files there.

The name of your application is assumed to be example. It's used throughout.

You can then use the included Chef cookbooks to provision a local VM.

It will install your application into /opt/example. The structure of that directory is something like this

/opt/example
    /apps
        /example
            # Your Django project here
    /venvs
        /example

Each developer on your team should be added to the users list in the Vagrantfile and the node file so that they can access the server.

Developing

If you want to develop in vagrant, it's as simple as provisioning the VM, logging in and typing in run. Instead of using supervisor to daemonize the gunicorn process that servers your Django application, you will use Django's built-in server. This is great because it will reload your application when it detects changes to the source code.

To facilitate this, there is a bit of special stuff in the nginx directive. But that's it. Everything else is the same as it would be in production.

When developing, you don't need to commit your changes in order to see if a bug was fixed. This project takes advantage of vagrant's shared folders. The source code on the host machine is symlinked to the /opt directory.

Deployment

Deploying is as easy as issue ia single Fabric command.

$ fab vagrant:honza deploy
# or
$ fab staging:honza deploy

Deployments are based around git. When you deploy, the script will run git push to your server so make sure your local changes are committed before deploying. Deploying with git is useful because the server knows which revision is currently live.

Todo

  • RabbitMQ + celery
  • Install patched postgresql

License

BSD, short and sweet

django-chef's People

Contributors

honza 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.