Module Import alias Import alias ImportFrom alias alias alias alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr IfExp NameLoad NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr IfExp NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Return Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr If UnaryOpNot Call NameLoad NameLoad body Expr Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Expr Call NameLoad NameLoad AttributeLoad NameLoad attr With Call NameLoad AttributeLoad NameLoad attr body Expr Call NameLoad Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str ImportFrom alias identifier With Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr body Expr Call NameLoad Str With Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Expr Call NameLoad Str NameLoad Assign NameStore Dict Str Str Str Str Str Call AttributeLoad Str attr AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Str Str Expr Call NameLoad Str Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad Str If CompareIn Str AttributeLoad NameLoad attr body Expr Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Dict Str Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Call AttributeLoad NameLoad attr Str Str Expr Call NameLoad Str Call AttributeLoad Str attr AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call NameLoad Str Expr Call NameLoad Str Expr Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad Str body With Call NameLoad keyword NameLoad body Expr Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr keyword Str Expr Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr keyword Str Expr Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Str AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Call AttributeLoad NameLoad attr Str Num Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Expr Call NameLoad Str Call AttributeLoad Str attr AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad With Call NameLoad keyword NameLoad body Expr Call NameLoad Str Expr Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call NameLoad Call AttributeLoad Str attr keyword AttributeLoad NameLoad attr Expr Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A sys N/A os.path fabric.api cd run sudo put settings fabric.contrib django fabric.contrib.files exists append utils.commands * utils.files upload_template make_zip config config ServerDeployer N/A object N/A N/A 
        Server deployer for django applications using fabric.
     __init__ N/A N/A self dir remote_dir name no_files N/A N/A N/A 
            Params:
                dir: the local app dir.
                remote_dir: the remote app dir.
                name: the django project name or package.
         N/A N/A self app_dir dir N/A N/A self app_name N/A N/A N/A os path basename N/A N/A N/A os path normpath N/A self app_dir N/A N/A self app_package N/A name name N/A self app_name N/A N/A self app_remote_dir N/A remote_dir remote_dir N/A self app_name N/A N/A N/A N/A sys path append N/A self app_dir N/A N/A N/A django project N/A self app_name N/A N/A self db_name N/A self app_name N/A N/A self no_files no_files N/A deploy_django_project N/A N/A self N/A N/A N/A 
            Copies the local django project to the remote location via scp.
         N/A N/A self no_files N/A N/A N/A local_dir N/A N/A {0} format N/A self app_dir N/A app_dir N/A N/A {0} format N/A self app_remote_dir N/A N/A N/A exists app_dir N/A N/A N/A mkdir app_dir N/A zip_name N/A make_zip local_dir N/A self app_name N/A N/A put zip_name N/A self app_remote_dir N/A N/A cd N/A self app_remote_dir N/A N/A N/A run N/A N/A unzip -o {0} format zip_name N/A N/A N/A os remove zip_name N/A install_django_project N/A N/A self N/A N/A N/A 
            Install the django project, sync the db and run django with gunicorn
         django.conf settings django_settings N/A N/A cd N/A N/A {0} format N/A self app_remote_dir N/A N/A N/A pip install -r requirements.txt N/A N/A cd N/A N/A {0} format N/A self app_package N/A N/A N/A N/A self setup_settings_local N/A N/A N/A self syncdb django_settings N/A N/A N/A self setup_gunicorn_supervisor N/A setup_settings_local N/A N/A self N/A N/A N/A line 
from settings_local import *
 N/A N/A append settings.py line N/A context N/A db_name db_user db_pass db_host db_port N/A N/A {0} format N/A self db_name N/A N/A {0} format N/A N/A config get postgres_user N/A self app_name N/A N/A {0} format N/A N/A config get postgres_password N/A self app_name localhost N/A N/A upload_template templates/settings_local.conf settings_local.py context overwrite True N/A syncdb N/A N/A self settings N/A N/A N/A N/A python manage.py syncdb --noinput N/A N/A south N/A settings INSTALLED_APPS N/A N/A N/A python manage.py migrate --noinput N/A setup_gunicorn_supervisor N/A N/A self N/A N/A N/A context N/A app_name app_package gunicorn_port user N/A self app_name N/A self app_package N/A N/A config get gunicorn_port 8000 N/A N/A config get user root N/A N/A upload_template templates/gunicorn_supervisor.conf N/A N/A /etc/supervisor/conf.d/{0}_gunicorn.conf format N/A self app_name context context overwrite True N/A N/A run supervisorctl reread N/A N/A run supervisorctl update N/A N/A run N/A N/A supervisorctl restart {0}_gunicorn format N/A self app_name N/A setup_virtual_env N/A N/A self N/A N/A N/A 
            Setup the virtual env and install the django project
         N/A N/A venv N/A N/A {0}_env format N/A self app_name N/A self install_django_project N/A setup_db N/A N/A self N/A N/A N/A 
            Setup the postgres db
         N/A N/A cd /var/lib/postgresql N/A N/A N/A settings warn_only True N/A N/A N/A sudo N/A N/A psql -c "CREATE USER {0} WITH PASSWORD '{1}';" format N/A N/A config get postgres_user N/A self app_name N/A N/A config get postgres_password N/A self app_name user postgres N/A N/A sudo N/A N/A createdb {0} format N/A self db_name user postgres N/A N/A sudo N/A N/A psql -c "GRANT ALL PRIVILEGES ON DATABASE {0} TO {1};" format N/A self db_name N/A N/A config get postgres_user N/A self app_name user postgres N/A add_webserver_virtual_host N/A N/A self N/A N/A N/A 
            Uploads the virtual host template and restart nginx to update the config
         N/A context N/A app gunicorn_port server_port N/A self app_name N/A N/A config get gunicorn_port 8000 N/A N/A config get server_port 80 N/A server_name N/A N/A config get server_name N/A server_name N/A N/A N/A context N/A server_name N/A N/A server_name {0}; format server_name N/A N/A upload_template templates/nginx_vhost.conf N/A N/A /etc/nginx/sites-available/{0}.conf format N/A self app_name context context overwrite True N/A N/A settings warn_only True N/A N/A N/A run rm /etc/nginx/sites-enabled/default N/A N/A run N/A N/A rm /etc/nginx/sites-enabled/{0}.conf format N/A self app_name N/A N/A run N/A N/A ln -s /etc/nginx/sites-available/{app}.conf /etc/nginx/sites-enabled/{app}.conf format app N/A self app_name N/A N/A run service nginx restart N/A clean N/A N/A self N/A N/A N/A 
            Add some env cleaning tasks here
         N/A N/A deploy N/A N/A self N/A N/A N/A 
            Deployment template method.
         N/A N/A N/A self clean N/A N/A N/A self deploy_django_project N/A N/A N/A self setup_db N/A N/A N/A self setup_virtual_env N/A N/A N/A self add_webserver_virtual_host N/A N/A