[damned-lies] Update deprecation-pending code
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Update deprecation-pending code
- Date: Tue, 6 Nov 2012 09:00:30 +0000 (UTC)
commit 367717e34934c63d91418f5ac4389451e4e8cc44
Author: Claude Paroz <claude 2xlibre net>
Date: Tue Nov 6 09:59:16 2012 +0100
Update deprecation-pending code
feeds/urls.py | 2 +-
languages/urls.py | 2 +-
manage.py | 16 +++++++---------
people/urls.py | 2 +-
settings.py | 2 +-
teams/urls.py | 2 +-
urls.py | 2 +-
vertimus/urls.py | 2 +-
8 files changed, 14 insertions(+), 16 deletions(-)
---
diff --git a/feeds/urls.py b/feeds/urls.py
index 3343e2a..9aecaf7 100644
--- a/feeds/urls.py
+++ b/feeds/urls.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from django.conf.urls.defaults import patterns, url
+from django.conf.urls import patterns, url
from vertimus.feeds import LatestActionsByLanguage, LatestActionsByTeam
urlpatterns = patterns('',
diff --git a/languages/urls.py b/languages/urls.py
index ab636b4..f354c42 100644
--- a/languages/urls.py
+++ b/languages/urls.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from django.conf.urls.defaults import patterns, url
+from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(
diff --git a/manage.py b/manage.py
index d7797f3..f9726f9 100755
--- a/manage.py
+++ b/manage.py
@@ -1,12 +1,10 @@
#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-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/people/urls.py b/people/urls.py
index b7da158..cb58ea3 100644
--- a/people/urls.py
+++ b/people/urls.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from django.conf.urls.defaults import patterns, url
+from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from people import views
diff --git a/settings.py b/settings.py
index 4a16373..4ac2b43 100644
--- a/settings.py
+++ b/settings.py
@@ -116,7 +116,7 @@ MIDDLEWARE_CLASSES = (
'django.middleware.transaction.TransactionMiddleware',
)
-ROOT_URLCONF = '%s.urls' % PROJECT_NAME
+ROOT_URLCONF = 'urls'
TEMPLATE_DIRS = (
os.path.join(PROJECT_PATH, 'templates'),
diff --git a/teams/urls.py b/teams/urls.py
index 3a4b1d2..087405b 100644
--- a/teams/urls.py
+++ b/teams/urls.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from django.conf.urls.defaults import patterns, url
+from django.conf.urls import patterns, url
urlpatterns = patterns('teams.views',
url(
diff --git a/urls.py b/urls.py
index 0f42aba..daafdd5 100644
--- a/urls.py
+++ b/urls.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from django.conf.urls.defaults import include, patterns, url
+from django.conf.urls import include, patterns, url
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
diff --git a/vertimus/urls.py b/vertimus/urls.py
index f3f4642..8dddd29 100644
--- a/vertimus/urls.py
+++ b/vertimus/urls.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from django.conf.urls.defaults import patterns, url
+from django.conf.urls import patterns, url
urlpatterns = patterns('vertimus.views',
url(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]