Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Django settings inside a fabric file

Tags:

django

fabric

I'd like to iterate through the INSTALLED_APPS in my Django settings file like so:

@task
def test_app
    print settings.INSTALLED_APPS

How do I access my settings file in a fabfile?

Thanks.

like image 641
paubins Avatar asked Feb 02 '12 21:02

paubins


1 Answers

It's documented: http://docs.fabfile.org/en/latest/api/contrib/django.html

from fabric.contrib import django

django.settings_module('myproject.settings')
from django.conf import settings
like image 95
arie Avatar answered Oct 25 '22 13:10

arie