GithubHelp home page GithubHelp logo

bbengfort / django-makefile Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kaleissin/django-makefile

0.0 2.0 0.0 120 KB

Makefile templates to aid in development and deployment of Django sites

django-makefile's Introduction

django-makefile

Makefile templates to aid in development and deployment of Django sites

Why Make?

Because it's there.

Because calling commands from a file hosted with the rest of the source greatly simplifies deployment scripts. The deployment script need know of fewer paths.

Because

cd someproject-dir
make test

is easier to type than

django-admin.py test --settings=someproject.settings.test --pythonpath=/path/to/project/src

especially on the Monday the first working day after your vacation.

Because fabric gave me indigestion.

Deployment

Currently I use a shell script, something along the lines of:

#!/bin/bash

PROJECT_HOME="/path/to/project"
REMOTE="[email protected]"
REMOTE_HOME="/path/on/remote/machine"
REMOTE_VENV="/path/to/remote/virtualenv"
LOCAL_VENV="/path/to/local/virtualenv"
SECRET_KEY='production_secret_key_whatever_that_is'
REMOTE_PREFIX="export SECRET_KEY='${SECRET_KEY}' "
REMOTE_MAKE="${REMOTE_PREFIX} && make -C ${REMOTE_HOME} VIRTUAL_ENV=${REMOTE_VENV}"
LOCAL_MAKE="make -C ${PROJECT_HOME} VIRTUAL_ENV=${LOCAL_VENV} "

${LOCAL_MAKE} REMOTE_URI=${REMOTE}:${REMOTE_HOME} rsync

ssh ${REMOTE} "${REMOTE_MAKE} all"

This is not under version control since it needs to be updated per project, per client machine, and per remote machine.

Most Useful Targets

cmd:
Runs any django command with production settings (in the CMD variable)
refresh:
Touches the wsgi-file, thereby refreshing/reloading the site
showenv:
Dumps some relevant environment variables
djangohelp:
Runs django-admin.py help
test:
Runs all tests
bootstrap:
Sets up a virtualenv and runs pip, provided there's a requirements-file
all:
Regenerates static files and reloads the site

django-makefile's People

Contributors

kaleissin avatar

Watchers

Benjamin Bengfort 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.