Deployment of django project using setuptools

48 views
Skip to first unread message

Tomas Ehrlich

unread,
May 2, 2014, 1:13:30 PM5/2/14
to django...@googlegroups.com
Hi there,
when I deploy my django projects I always run several commands after
pulling latest code from repository. I've started using setup.py few
weeks ago which adds manage.py script into $VENV/bin.

Basicaly, I always do:

source $VENV/bin/activate
export DJANGO_SETTINGS_MODULE=...

git pull
python setup.py install
manage.py syncdb --noinput
manage.py migrate
manage.py collectstatic --noinput
manage.py compilemessages


I wrote deployment scripts in fabric, salt, ansible, but now I'm
thinking that all these 'manage.py' actions should be part of setup
script. Anytime when would I run ``python setup.py install``
the setup script would run all defined management commands so my
environment, database and other stuff stays up to date.


I've found that install command can be extended:

http://www.niteoweb.com/blog/setuptools-run-custom-code-during-install

I haven't found any references that anyone have used this method to
deploy django project, so I'm looking for anyone who tried this
approach before.


Thanks in advance

Cheers,
Tom
signature.asc

Tomáš Ehrlich

unread,
May 2, 2014, 4:04:08 PM5/2/14
to django...@googlegroups.com
I've started experimenting with this idea and created simple app:

https://github.com/elvard/django-deploy

I would very appreciate any opinions, ideas or second thoughts.


Cheers,
   Tom


Dne pátek, 2. května 2014 19:13:30 UTC+2 Tomáš Ehrlich napsal(a):
Reply all
Reply to author
Forward
0 new messages