annotate manage.py @ 152:1801236f27f0

update deploy.sh
author souliane <souliane@mailoo.org>
date Mon, 30 Oct 2017 23:39:09 +0100
parents b1c16cd53b62
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
149
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
1 #!/usr/bin/env python
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
2 import os
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
3 import sys
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
4
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
5 if __name__ == "__main__":
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
6 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
7 try:
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
8 from django.core.management import execute_from_command_line
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
9 except ImportError:
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
10 # The above import may fail for some other reason. Ensure that the
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
11 # issue is really that Django is missing to avoid masking other
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
12 # exceptions on Python 2.
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
13 try:
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
14 import django
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
15 except ImportError:
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
16 raise ImportError(
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
17 "Couldn't import Django. Are you sure it's installed and "
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
18 "available on your PYTHONPATH environment variable? Did you "
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
19 "forget to activate a virtual environment?"
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
20 )
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
21 raise
b1c16cd53b62 update django to version 1.11, refactor project structure, better PEP-8 compliance
souliane <souliane@mailoo.org>
parents:
diff changeset
22 execute_from_command_line(sys.argv)