Code below is from Django‘s settings.py. Since everything in Python is an object, why don’t just pass installed apps as tuple of objects:
INSTALLED_APPS = (
django.contrib.auth,
django.contrib.contenttypes,
.....
Is there some strong reason why they do this:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
.....
instead?
I’m new to Python and Django, so don’t judge me too much, please.
Passing module or class name as a string is typical solution to avoiding circular import error.
For example, if settings file contains
import myapp.modelsand myapp.models containsfrom django.conf import settingsthis would lead to circular import.