diff --git a/picampaign/contact/management/commands/import_meps_from_compotista.py b/picampaign/contact/management/commands/import_meps_from_compotista.py index 4f00d9499292a6339486740885a46bd6d578239e..8b9932e4bdb38af7397fe83bd34e53f6ba3b8852 100644 --- a/picampaign/contact/management/commands/import_meps_from_compotista.py +++ b/picampaign/contact/management/commands/import_meps_from_compotista.py @@ -19,14 +19,14 @@ class Command(BaseCommand): def handle(self, *args, **options): if not exists(JSON_DUMP_LOCALIZATION): - print "download lastest data dump of meps from compotista" + print("download lastest data dump of meps from compotista") urllib.urlretrieve('http://compotista.mm.staz.be/latest/', JSON_DUMP_LOCALIZATION) - print "load json" + print("load json") meps = json.load(open(JSON_DUMP_LOCALIZATION, "r")) # This should not be used, since old contacts should stay in database - print "cleaning Contacts" + print("cleaning Contacts") Contact.objects.all().delete() - print "adding Contacts" + print("adding Contacts") added = 0 for mep in meps: insert_mep = False @@ -60,7 +60,7 @@ class Command(BaseCommand): twitter=twitter ) added += 1 - print '%d - %s %s' % (added, first_name, last_name) + print('%d - %s %s' % (added, first_name, last_name)) if added>=50: return diff --git a/picampaign/urls.py b/picampaign/urls.py index 5b962e4a08d5354838d1479dc3479ec9a38041f5..e1bc4c1554b1c921a8f24a3697cfa840feda4d46 100644 --- a/picampaign/urls.py +++ b/picampaign/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import patterns, include, url +from django.conf.urls import include, url from django.contrib import admin from rest_framework_nested import routers @@ -18,7 +18,8 @@ campaign_router.register(r'categories', CategoryViewSet) campaign_router.register(r'feedbacks', FeedbackViewSet) -urlpatterns = patterns('', - url(r'^admin/', include(admin.site.urls)), - url(r'^', include(router.urls)), - url(r'^', include(campaign_router.urls))) +urlpatterns = [ + url(r'^admin/', include(admin.site.urls)), + url(r'^', include(router.urls)), + url(r'^', include(campaign_router.urls)) + ]