from django.conf.urls import patterns, url

# API URLs
from .views import LocationFromIpView

urlpatterns = patterns('',
    url(r'^location/(?P<ip_address>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))/$', LocationFromIpView.as_view(),
        name='geoip-explicit-ip-view'),
    url(r'^location/$', LocationFromIpView.as_view(), name='geoip-implicit-ip-view')  # Take IP addr from request
)

from django.conf.urls import url

# API URLs
from .views import LocationFromIpView

urlpatterns = [
    url(r'^location/(?P<ip_address>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))/$', LocationFromIpView.as_view(),
        name='geoip-explicit-ip-view'),
    url(r'^location/$', LocationFromIpView.as_view(), name='geoip-implicit-ip-view')  # Take IP addr from request
]

Upgrade to new urlpatterns format
Upgrade to new urlpatterns format
- from django.conf.urls import patterns, url
+ from django.conf.urls import url
  
  # API URLs
  from .views import LocationFromIpView
  
- urlpatterns = patterns('',
+ urlpatterns = [
      url(r'^location/(?P<ip_address>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))/$', LocationFromIpView.as_view(),
          name='geoip-explicit-ip-view'),
      url(r'^location/$', LocationFromIpView.as_view(), name='geoip-implicit-ip-view')  # Take IP addr from request
- )
+ ]
  
Upgrade to new urlpatterns format
## Code Before:
from django.conf.urls import patterns, url

# API URLs
from .views import LocationFromIpView

urlpatterns = patterns('',
    url(r'^location/(?P<ip_address>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))/$', LocationFromIpView.as_view(),
        name='geoip-explicit-ip-view'),
    url(r'^location/$', LocationFromIpView.as_view(), name='geoip-implicit-ip-view')  # Take IP addr from request
)

## Instruction:
Upgrade to new urlpatterns format
## Code After:
from django.conf.urls import url

# API URLs
from .views import LocationFromIpView

urlpatterns = [
    url(r'^location/(?P<ip_address>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))/$', LocationFromIpView.as_view(),
        name='geoip-explicit-ip-view'),
    url(r'^location/$', LocationFromIpView.as_view(), name='geoip-implicit-ip-view')  # Take IP addr from request
]
