sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Make web-only apps optional #72

Closed taldcroft closed 9 years ago

taldcroft commented 9 years ago

Something like this should work:

OPTIONAL_APPS = ('mica.web', 'find_attitude')
for app in OPTIONAL_APPS:
    try:
        __import__(app)
    except ImportError:
        pass
    else:
        INSTALLED_APPS += app

@jeanconn - we discussed this before, don't remember if it ever got to the point of some code.

jeanconn commented 9 years ago

Does this just belong against the web branch or against both master and web? I'm confused by the current branch strategy.

taldcroft commented 9 years ago

Me too.

jeanconn commented 9 years ago

Does INSTALLED_APPS need to be a tuple to satisfy Django? If so, should the code add to a list of INSTALLED_APPS and then tuple() it or can it just stay a list?

taldcroft commented 9 years ago

I don't know about the django requirements, but I think we can just change to INSTALLED_APPS += (app,).

jeanconn commented 9 years ago

I thought it was bad form to modify the tuple even by appending.

taldcroft commented 9 years ago

Well you cannot modify a tuple (in-place) at all, but I don't think it's bad form to concatenate. That's why they made the + operator work like it does, so you can concat tuples into another tuple.

taldcroft commented 9 years ago

I'd propose resolving this issue in #73.

jeanconn commented 9 years ago

I was wondering about merging #73 before this just to keep the merge simpler, but could obviously go either way.

taldcroft commented 9 years ago

Whatever works.