2019-02-22 18:36:11 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
import sys
|
|
|
|
|
|
|
|
from django.conf import global_settings, settings
|
|
|
|
from django.core.management import execute_from_command_line
|
|
|
|
|
|
|
|
|
|
|
|
class Settings:
|
|
|
|
def __getattr__(self, name):
|
2022-02-03 19:24:19 +00:00
|
|
|
if name == "FOO":
|
|
|
|
return "bar"
|
2019-02-22 18:36:11 +00:00
|
|
|
return getattr(global_settings, name)
|
|
|
|
|
|
|
|
def __dir__(self):
|
2022-02-03 19:24:19 +00:00
|
|
|
return super().__dir__() + dir(global_settings) + ["FOO"]
|
2019-02-22 18:36:11 +00:00
|
|
|
|
|
|
|
|
2022-02-03 19:24:19 +00:00
|
|
|
if __name__ == "__main__":
|
2019-02-22 18:36:11 +00:00
|
|
|
settings.configure(Settings())
|
|
|
|
execute_from_command_line(sys.argv)
|