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