Load env before main

This commit is contained in:
PCoder 2021-07-27 09:53:17 +05:30
parent 72d55a5f14
commit b4a21ae7e7

View file

@ -5,7 +5,6 @@ import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gmba_django.settings.development')
@ -24,9 +23,9 @@ def main():
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
dotenv.load_dotenv(
os.path.join(os.path.dirname(__file__), '.env')
)
if __name__ == '__main__':
main()