Django Module

Django deployment module. Creates necessary folders for housing project source code clones, deploys, submodule checkouts

Django Module Settings

DJANGO_GIT_REPO_URL = "git://your/repo.git" #django project repo url
DJANGO_STAGING_GIT_BRANCH = "develop"
DJANGO_STAGING_SERVER_NAME = "staging.some_project.com"
DJANGO_PRODUCTION_GIT_BRANCH = "master"
DJANGO_PRODUCTION_SERVER_NAME = "production.some_project.com"
DJANGO_GUNICORN_PORT = '9010'
DJANGO_LOCALSETTINGS_LOCAL_PATH = "localsettings.py" #Path to localsettings on local machine

# A dictionary you can use if you want to treat localsettings as a template. # This dict get’s autopopulated with other useful keys: # * project_root # * www_root - holds the log_dir and code_root # * log_dir # * code_root - where your django code ends up # * project_media - django media folder (in your code_root by default) ((usually used by collectstatic)) # * project_static - django static files folder location, also in code_root by default # * virtualenv_root # * services - path where things like apache.conf and supervisor.conf end up.

DJANGO_LOCALSETTINGS_TEMPLATE_DICT = {} DJANGO_LOCALSETTINGS_REMOTE_DESTINATION = “some_folder/localsettings.py” #RELATIVE TO THE CODE_ROOT ON REMOTE MACHINE DJANGO_LOCALSETTINGS_NO_TEMPLATE = True #Set to false if you want to treat localsettings.py as a template
modules.django.bootstrap(deploy_level='staging')[source]

Creates initial folders, clones the git repo. DOES NOT DEPLOY()

modules.django.clone_repo()[source]

clone a new copy of the git repository

modules.django.collectstatic()[source]

run collectstatic on remote environment. ASSUMES YOU ALREADY HAVE ALL REQUIRED PACKAGES AND VIRTUALENV INSTALLED.

modules.django.deploy(deploy_level='staging')[source]

deploy code to remote host by checking out the latest via git

modules.django.setup_dirs()[source]

create (if necessary) and make writable uploaded media, log, etc. directories

modules.django.start()[source]

Does nothing in this module

modules.django.stop()[source]

Does nothing in this module

modules.django.upload_localsettings()[source]

Uploads your django settings from your local machine to host

Table Of Contents

Previous topic

Dimagi Deploy Tools Modules

Next topic

OS Module

This Page