old_contents: """voting_app URL Configuration
  
  The `urlpatterns` list routes URLs to views. For more information please see:
      https://docs.djangoproject.com/en/1.11/topics/http/urls/
  Examples:
  Function views
      1. Add an import:  from my_app import views
      2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
  Class-based views
      1. Add an import:  from other_app.views import Home
      2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
  Including another URLconf
      1. Import the include() function: from django.conf.urls import url, include
      2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
  """
  import importlib
  
  from django.conf.urls import url, include
  from django.contrib import admin
  from django.conf import settings
  from django.views.generic import TemplateView
  
  from allauth.socialaccount import providers
  
  from polls.api.views import TwitterLogin
  
  
  # http://bit.ly/2p87rHz - removing everything from allauth, except social
  
  # twitter login - auth/twitter/login
  
  providers_urlpatterns = []
  
  for provider in providers.registry.get_list():
      prov_mod = importlib.import_module(provider.get_package() + '.urls')
      providers_urlpatterns += getattr(prov_mod, 'urlpatterns', [])
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^auth/', include(providers_urlpatterns)),
      url(r'^rest-auth/', include('rest_auth.urls')),
      url(r'^rest-auth/twitter/$', TwitterLogin.as_view(), name='twitter_login'),
      url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
      url(r'^password-reset/$',
          TemplateView.as_view(template_name="password_reset.html"),
          name='password-reset'),
      url(r'^password-reset/confirm/$',
          TemplateView.as_view(template_name="password_reset_confirm.html"),
          name='password-reset-confirm'),
      # this url is used to generate email content
      url(r'^password-reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
          TemplateView.as_view(template_name="password_reset_confirm.html"),
          name='password_reset_confirm'),
      url(r'^api/v1/', include('polls.api.urls', namespace='api'))
  ]
  
  if settings.DEBUG:
      import debug_toolbar
  
      urlpatterns = [
          url(r'^__debug__/', include(debug_toolbar.urls)),
      ] + urlpatterns
  
new_contents: """voting_app URL Configuration
  
  The `urlpatterns` list routes URLs to views. For more information please see:
      https://docs.djangoproject.com/en/1.11/topics/http/urls/
  Examples:
  Function views
      1. Add an import:  from my_app import views
      2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
  Class-based views
      1. Add an import:  from other_app.views import Home
      2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
  Including another URLconf
      1. Import the include() function: from django.conf.urls import url, include
      2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
  """
  import importlib
  
  from django.conf.urls import url, include
  from django.contrib import admin
  from django.conf import settings
  from django.views.generic import TemplateView
  
  from allauth.socialaccount import providers
  
  from polls.api.views import TwitterLogin
  
  
  # http://bit.ly/2p87rHz - removing everything from allauth, except social
  
  # twitter login - auth/twitter/login
  
  providers_urlpatterns = []
  
  for provider in providers.registry.get_list():
      prov_mod = importlib.import_module(provider.get_package() + '.urls')
      providers_urlpatterns += getattr(prov_mod, 'urlpatterns', [])
  
  urlpatterns = [
      url(r'^api/v1/', include('polls.api.urls', namespace='api')),
      url(r'^admin/', admin.site.urls),
      url(r'^auth/', include(providers_urlpatterns)),
      url(r'^rest-auth/', include('rest_auth.urls')),
      url(r'^rest-auth/twitter/$', TwitterLogin.as_view(), name='twitter_login'),
      url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
      url(r'^password-reset/$',
          TemplateView.as_view(template_name="password_reset.html"),
          name='password-reset'),
      url(r'^password-reset/confirm/$',
          TemplateView.as_view(template_name="password_reset_confirm.html"),
          name='password-reset-confirm'),
      # this url is used to generate email content
      url(r'^password-reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
          TemplateView.as_view(template_name="password_reset_confirm.html"),
          name='password_reset_confirm'),
  ]
  
  if settings.DEBUG:
      import debug_toolbar
  
      urlpatterns = [
          url(r'^__debug__/', include(debug_toolbar.urls)),
      ] + urlpatterns
  
subject: put api url on top