I have a tuple, INSTALLED_APPS, and I want to merge extra items into it to get my local apps in the tuple too without altering the main settings file. I came this far:
DEFAULT_APPS = list(INSTALLED_APPS)
MY_APPS_LIST = DEFAULT_APPS.append('south')
however if I try to convert this into a tuple again by running:
INSTALLED_APPS = tuple(MY_APPS_LIST)
I get:
TypeError: 'NoneType' object is not iterable
The question is rather fundamental I’d say, but I can’t really find “the” method for this, or even any method that works for me at all… I did find that both list() and tuple() in the Django shell return an empty object of that type, so I don’t understand where the TypeError might be coming from…
Help appreciated!
appenddoesn’t return a new list — it modifies the original list, returningNone. You wantMY_APPS_LIST = DEFAULT_APPS + ['south']