diff --git a/pyweb/manage.py b/pyweb/manage.py index a7da31a..f9726f9 100755 --- a/pyweb/manage.py +++ b/pyweb/manage.py @@ -1,27 +1,10 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- +import os +import sys -""" - * Copyright © 2009-2010, Michael "Svedrin" Ziegler - * - * Mumble-Django is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. -""" +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") -from django.core.management import execute_manager -try: - import settings # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) + from django.core.management import execute_from_command_line -if __name__ == "__main__": - execute_manager(settings) + execute_from_command_line(sys.argv)