diff options
author | Ricardo Kirkner <ricardo.kirkner@canonical.com> | 2014-04-22 17:05:02 -0300 |
---|---|---|
committer | Ricardo Kirkner <ricardo.kirkner@canonical.com> | 2014-04-22 17:05:02 -0300 |
commit | 0a6bd0aa3877cac5b01ce15718d999b71d5b9148 (patch) | |
tree | 3d45c1e972d8f9d5360b3062d73cf43cdbad5059 | |
parent | 01b94c5dcb4901a42d58c713b1f7650e22d8fb8a (diff) | |
parent | de3a4ecef5b396269ded04a6ccc3ad759676cabc (diff) |
Added Django 1.4 based manage.py for example_consumer
This commit also contain changes that drop compatibility for the no longer supported Django 1.3 (and lower).
-rwxr-xr-x | example_consumer/manage.py | 15 | ||||
-rw-r--r-- | example_consumer/urls.py | 2 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | tox.ini | 28 |
4 files changed, 10 insertions, 37 deletions
diff --git a/example_consumer/manage.py b/example_consumer/manage.py index 5e78ea9..f9726f9 100755 --- a/example_consumer/manage.py +++ b/example_consumer/manage.py @@ -1,11 +1,10 @@ #!/usr/bin/env python -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) +import os +import sys if __name__ == "__main__": - execute_manager(settings) + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/example_consumer/urls.py b/example_consumer/urls.py index 6132fd3..4a9013c 100644 --- a/example_consumer/urls.py +++ b/example_consumer/urls.py @@ -27,7 +27,7 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -from django.conf.urls.defaults import * +from django.conf.urls import * from django.contrib import admin import views @@ -77,5 +77,5 @@ setup( 'django_openid_auth': ['templates/openid/*.html'], }, provides=['django_openid_auth'], - requires=['django (>=1.3)', 'openid (>=2.2.0)', 'south'], + requires=['django (>=1.4)', 'openid (>=2.2.0)', 'south'], ) @@ -1,37 +1,11 @@ [tox] envlist = - py2.6-django1.3, py2.6-django1.4, py2.6-django1.5, - py2.7-django1.3, py2.7-django1.4, py2.7-django1.5 + py2.7-django1.4, py2.7-django1.5 [testenv] commands = make check -# Python 2.6 -[testenv:py2.6-django1.3] -basepython = python2.6 -deps = django >= 1.3, < 1.4 - python-openid - south - -[testenv:py2.6-django1.4] -basepython = python2.6 -deps = django >= 1.4, < 1.5 - python-openid - south - -[testenv:py2.6-django1.5] -basepython = python2.6 -deps = django >= 1.5, < 1.6 - python-openid - south - # Python 2.7 -[testenv:py2.7-django1.3] -basepython = python2.7 -deps = django >= 1.3, < 1.4 - python-openid - south - [testenv:py2.7-django1.4] basepython = python2.7 deps = django >= 1.4, < 1.5 |