Giter VIP home page Giter VIP logo

denim's Introduction

    _/_/_/                        _/                        _/          _/_/
   _/    _/    _/_/    _/_/_/        _/_/_/  _/_/        _/  _/      _/    _/
  _/    _/  _/_/_/_/  _/    _/  _/  _/    _/    _/      _/  _/          _/
 _/    _/  _/        _/    _/  _/  _/    _/    _/      _/  _/        _/
_/_/_/      _/_/_/  _/    _/  _/  _/    _/    _/        _/    _/  _/_/_/_/

A Fabric deployment strategy for Python web applications.

Denim has been primarily developed to support Django web applications, deployed to Debian GNU/Linux (and derivative) platforms. With tools to support nginx, supervisor, virtual env, gunicorn, pip etc.

Designed to provide a rich tool-set built on top of and working with the existing functionality provided by Fabric. Get up and running quickly with the default deployment strategy.

License https://pypip.in/v/denim/badge.png Travis CI Status Coveralls Requirements Status

The default strategy

The default strategy describes a project layout and deployment structure for Django applications that lets you deploy straight away

The strategy is designed to take a freshly deployed server and provision, deploy and activate your application, using best practices.

By default your application will run as the user webapps with a /bin/false shell and write access to limited parts of the filesystem. All code is owned by root.

Folder Structure

Key Variables

Certain key variables are required to be set in the Fabric env dictionary, these should be setup in your fabfile:

project_name
The name of your project, this does not need to be Python compatible (ie you can use a dash '-').
package_name
The name of the python package being deployed, this name is the name of your applications package folder (i.e. the django project name).
deploy_env
The name of the environment you are deploying your application into, this is used to determine which configuration should be used. For example production, stage, uat.

These key variables will be used throughout this document.

Deployment

/opt/webapps/project_name Deploy path
  app Application package deploy path
  current The current package version [1]
  revision/package_name The revision and application package
  bin Binary folder [2]
  include Include folder [2]
  lib Lib folder [2]
  public Public web root for web server
  media Application content or uploaded data [3]
  static Static application content
  var Application variable data [3]
  wsgi.sock WSGI socket
/var/log/webapps/project_name/package_name Project log path [3]
[1]Symlink to the current revision.
[2](1, 2, 3) Virtualenv created folders.
[3](1, 2, 3) Writable by application user.

Development

app Application source root
  package_name Application package [5]
  deployment Deployment settings folder
  settings.*deploy_env*.py Environment configuration [4]
  requirements.txt PIP requirements file
conf Configuration
  init.d Startup scripts for init.d
  nginx Nginx configuration
  nginx.*deploy_env*.conf Environment configuration [4]
fabfile.py Project fabric definition file
[4](1, 2) Used to apply specific configuration based on deployment environment.
[5]This structure is based on Django 1.4.

denim's People

Contributors

timsavage avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

icejoywoo

denim's Issues

demin recipe fails to find django

Traceback (most recent call last):
  File "/home/morgan/devel/ecologic/core/local/lib/python2.7/site-packages/fabric/main.py", line 658, in main
    docstring, callables, default = load_fabfile(fabfile)
  File "/home/morgan/devel/ecologic/core/local/lib/python2.7/site-packages/fabric/main.py", line 165, in load_fabfile
    imported = importer(os.path.splitext(fabfile)[0])
  File "/home/morgan/devel/ecologic/core/fabfile/__init__.py", line 15, in <module>
    from . import recipes
  File "/home/morgan/devel/ecologic/core/fabfile/recipes.py", line 42, in <module>
    from denim.recipes.django import ProvisionDjangoRecipe, DeployDjangoRecipe
ImportError: No module named django

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.