src/manage.py
author ymh <ymh.work@gmail.com>
Fri, 30 Nov 2018 10:53:15 +0100
changeset 183 f8f3af9e5c83
parent 24 3b3999550508
permissions -rwxr-xr-x
Change the settings to avoid using Session authentication for rest framework as it raise exceptions in case client and backend are on the same domain On the filter, adapt to take into account new version of django_filters
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/env python
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
import os
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
import sys
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
if __name__ == "__main__":
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "irinotes.settings")
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
    try:
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
        from django.core.management import execute_from_command_line
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
    except ImportError:
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
        # The above import may fail for some other reason. Ensure that the
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
        # issue is really that Django is missing to avoid masking other
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
        # exceptions on Python 2.
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
        try:
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
            import django
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
        except ImportError:
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
            raise ImportError(
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
                "Couldn't import Django. Are you sure it's installed and "
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
                "available on your PYTHONPATH environment variable? Did you "
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
                "forget to activate a virtual environment?"
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
            )
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
        raise
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
    execute_from_command_line(sys.argv)