Merge "update the huawei's lab"
[pharos.git] / tools / pharos-dashboard / src / manage.py
1 ##############################################################################
2 # Copyright (c) 2016 Max Breitenfeldt and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10
11 #!/usr/bin/env python
12 import os
13 import sys
14
15 if __name__ == "__main__":
16     os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pharos_dashboard.settings")
17     try:
18         from django.core.management import execute_from_command_line
19     except ImportError:
20         # The above import may fail for some other reason. Ensure that the
21         # issue is really that Django is missing to avoid masking other
22         # exceptions on Python 2.
23         try:
24             import django
25         except ImportError:
26             raise ImportError(
27                 "Couldn't import Django. Are you sure it's installed and "
28                 "available on your PYTHONPATH environment variable? Did you "
29                 "forget to activate a virtual environment?"
30             )
31         raise
32     execute_from_command_line(sys.argv)