Wednesday, March 14, 2012

Re: Django deployment practices -- do people use setup.py?

On 15 March 2012 02:40, bruno desthuilliers
<bruno.desthuilliers@gmail.com> wrote:
> We dont - we use virtualenvs (no-site-packages), pip requirements, and
> git.

We do the same here. Our deployment looks something like

# mkvirtualenv --no-site-packages foo
# workon foo
# cdvirtualenv
# svn checkout bar
# pip install -r deployment/pip-reqs.txt

It works. But it's ugly. And the pip-reqs are a pain to maintain.

Now I've got almost the same requirements as the OP for a new project.
We want to be able to distribute our Django 'app' as a standalone
module. This is pretty easy to do with a distutils and a well
constructed setup.py.

We also want to be able to distribute a self contained Django project
with sane defaults (and this is where it gets tricky).

In total we're looking at two packages:

dms_django (Django Project + base settings)
dms_core (Django app, and required packages)

So for a quick install we can do something like

# mkvirtualenv --no-site-packages dms
# workon dms
# cdvirtualenv
# pip install svn+https://mysvnrepo/dms_django/ # Install the
dms_django package and pull in dms_core as a requirement

... sit back and everything is taken care of. (well that's the idea)

However packaging a Django "project" using distutils is not straight forward:

Issues:

The default Django manage.py, assumes that settings.py is in the same
directory. So if we mark this as a script (in setup.py) so it gets
installed into ./bin and it wont work, unless we customise it first.

And where do we put local settings? Can we have setup.py create a
local project directory, with any local configs, user template
overrides. etc?

I'm hoping someone has already done this before and can advise on what
works and what doesn't...

Cheers, Andrew

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate