We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Remove or block impersonate's "list" and "search" urls
Saleor uses the [django-impersonate](https://bitbucket.org/petersanchez/django-impersonate/overview) for client impersonation feature. While working on #1549 I've found out that in addition to two views that we are using (start and stop impersonating the user), the library brings additional two views that we don't really want to support:

https://demo.getsaleor.com/impersonate/list/
https://demo.getsaleor.com/impersonate/search/?q=admin (note: this one 500's on link)

Ideally, library would've provided us with a settings to disable those views, but this isn't the case.

So its worth asking ourselves what harm is there in keeping those views around, and if we really want to get rid of those two views, how would we go about it?

Looking at the [imersonate.urls](https://bitbucket.org/petersanchez/django-impersonate/src/f898c697b2bd9945187f8667d680e6d10d06dc33/impersonate/urls.py?at=default&fileviewer=file-view-default), it may be as simple as updating our `urls.py` to explictly define `impersonate-start` and `impersonate-stop`, or perhaps we should open the issue upstream and see what library's author thinks about it?
  

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `saleor/urls.py`
Content:
```
1 from django.conf import settings
2 from django.conf.urls import url, include
3 from django.conf.urls.static import static
4 from django.contrib.sitemaps.views import sitemap
5 from django.contrib.staticfiles.views import serve
6 from django.views.i18n import JavaScriptCatalog
7 from graphene_django.views import GraphQLView
8 
9 from .cart.urls import urlpatterns as cart_urls
10 from .checkout.urls import urlpatterns as checkout_urls
11 from .core.sitemaps import sitemaps
12 from .core.urls import urlpatterns as core_urls
13 from .dashboard.urls import urlpatterns as dashboard_urls
14 from .data_feeds.urls import urlpatterns as feed_urls
15 from .order.urls import urlpatterns as order_urls
16 from .product.urls import urlpatterns as product_urls
17 from .registration.urls import urlpatterns as registration_urls
18 from .search.urls import urlpatterns as search_urls
19 from .userprofile.urls import urlpatterns as userprofile_urls
20 
21 urlpatterns = [
22     url(r'^', include(core_urls)),
23     url(r'^account/', include(registration_urls)),
24     url(r'^cart/', include((cart_urls, 'cart'), namespace='cart')),
25     url(r'^checkout/',
26         include((checkout_urls, 'checkout'), namespace='checkout')),
27     url(r'^dashboard/',
28         include((dashboard_urls, 'dashboard'), namespace='dashboard')),
29     url(r'^graphql', GraphQLView.as_view(graphiql=settings.DEBUG)),
30     url(r'^impersonate/', include('impersonate.urls')),
31     url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
32     url(r'^order/', include((order_urls, 'order'), namespace='order')),
33     url(r'^products/',
34         include((product_urls, 'product'), namespace='product')),
35     url(r'^profile/',
36         include((userprofile_urls, 'profile'), namespace='profile')),
37     url(r'^feeds/',
38         include((feed_urls, 'data_feeds'), namespace='data_feeds')),
39     url(r'^search/', include((search_urls, 'search'), namespace='search')),
40     url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps},
41         name='django.contrib.sitemaps.views.sitemap'),
42     url(r'', include('payments.urls')),
43     url('', include('social_django.urls', namespace='social')),
44 ]
45 
46 if settings.DEBUG:
47     # static files (images, css, javascript, etc.)
48     urlpatterns += [
49         url(r'^static/(?P<path>.*)$', serve)
50     ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
51
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/saleor/urls.py b/saleor/urls.py
--- a/saleor/urls.py
+++ b/saleor/urls.py
@@ -5,6 +5,7 @@
 from django.contrib.staticfiles.views import serve
 from django.views.i18n import JavaScriptCatalog
 from graphene_django.views import GraphQLView
+from impersonate.views import impersonate, stop_impersonate
 
 from .cart.urls import urlpatterns as cart_urls
 from .checkout.urls import urlpatterns as checkout_urls
@@ -27,7 +28,8 @@
     url(r'^dashboard/',
         include((dashboard_urls, 'dashboard'), namespace='dashboard')),
     url(r'^graphql', GraphQLView.as_view(graphiql=settings.DEBUG)),
-    url(r'^impersonate/', include('impersonate.urls')),
+    url(r'^impersonate/stop/$', stop_impersonate, name='impersonate-stop'),
+    url(r'^impersonate/(?P<uid>\d+)/$', impersonate, name='impersonate-start'),
     url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
     url(r'^order/', include((order_urls, 'order'), namespace='order')),
     url(r'^products/',

{"golden_diff": "diff --git a/saleor/urls.py b/saleor/urls.py\n--- a/saleor/urls.py\n+++ b/saleor/urls.py\n@@ -5,6 +5,7 @@\n from django.contrib.staticfiles.views import serve\n from django.views.i18n import JavaScriptCatalog\n from graphene_django.views import GraphQLView\n+from impersonate.views import impersonate, stop_impersonate\n \n from .cart.urls import urlpatterns as cart_urls\n from .checkout.urls import urlpatterns as checkout_urls\n@@ -27,7 +28,8 @@\n     url(r'^dashboard/',\n         include((dashboard_urls, 'dashboard'), namespace='dashboard')),\n     url(r'^graphql', GraphQLView.as_view(graphiql=settings.DEBUG)),\n-    url(r'^impersonate/', include('impersonate.urls')),\n+    url(r'^impersonate/stop/$', stop_impersonate, name='impersonate-stop'),\n+    url(r'^impersonate/(?P<uid>\\d+)/$', impersonate, name='impersonate-start'),\n     url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),\n     url(r'^order/', include((order_urls, 'order'), namespace='order')),\n     url(r'^products/',\n", "issue": "Remove or block impersonate's \"list\" and \"search\" urls\nSaleor uses the [django-impersonate](https://bitbucket.org/petersanchez/django-impersonate/overview) for client impersonation feature. While working on #1549 I've found out that in addition to two views that we are using (start and stop impersonating the user), the library brings additional two views that we don't really want to support:\r\n\r\nhttps://demo.getsaleor.com/impersonate/list/\r\nhttps://demo.getsaleor.com/impersonate/search/?q=admin (note: this one 500's on link)\r\n\r\nIdeally, library would've provided us with a settings to disable those views, but this isn't the case.\r\n\r\nSo its worth asking ourselves what harm is there in keeping those views around, and if we really want to get rid of those two views, how would we go about it?\r\n\r\nLooking at the [imersonate.urls](https://bitbucket.org/petersanchez/django-impersonate/src/f898c697b2bd9945187f8667d680e6d10d06dc33/impersonate/urls.py?at=default&fileviewer=file-view-default), it may be as simple as updating our `urls.py` to explictly define `impersonate-start` and `impersonate-stop`, or perhaps we should open the issue upstream and see what library's author thinks about it?\r\n  \n", "before_files": [{"content": "from django.conf import settings\nfrom django.conf.urls import url, include\nfrom django.conf.urls.static import static\nfrom django.contrib.sitemaps.views import sitemap\nfrom django.contrib.staticfiles.views import serve\nfrom django.views.i18n import JavaScriptCatalog\nfrom graphene_django.views import GraphQLView\n\nfrom .cart.urls import urlpatterns as cart_urls\nfrom .checkout.urls import urlpatterns as checkout_urls\nfrom .core.sitemaps import sitemaps\nfrom .core.urls import urlpatterns as core_urls\nfrom .dashboard.urls import urlpatterns as dashboard_urls\nfrom .data_feeds.urls import urlpatterns as feed_urls\nfrom .order.urls import urlpatterns as order_urls\nfrom .product.urls import urlpatterns as product_urls\nfrom .registration.urls import urlpatterns as registration_urls\nfrom .search.urls import urlpatterns as search_urls\nfrom .userprofile.urls import urlpatterns as userprofile_urls\n\nurlpatterns = [\n    url(r'^', include(core_urls)),\n    url(r'^account/', include(registration_urls)),\n    url(r'^cart/', include((cart_urls, 'cart'), namespace='cart')),\n    url(r'^checkout/',\n        include((checkout_urls, 'checkout'), namespace='checkout')),\n    url(r'^dashboard/',\n        include((dashboard_urls, 'dashboard'), namespace='dashboard')),\n    url(r'^graphql', GraphQLView.as_view(graphiql=settings.DEBUG)),\n    url(r'^impersonate/', include('impersonate.urls')),\n    url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),\n    url(r'^order/', include((order_urls, 'order'), namespace='order')),\n    url(r'^products/',\n        include((product_urls, 'product'), namespace='product')),\n    url(r'^profile/',\n        include((userprofile_urls, 'profile'), namespace='profile')),\n    url(r'^feeds/',\n        include((feed_urls, 'data_feeds'), namespace='data_feeds')),\n    url(r'^search/', include((search_urls, 'search'), namespace='search')),\n    url(r'^sitemap\\.xml$', sitemap, {'sitemaps': sitemaps},\n        name='django.contrib.sitemaps.views.sitemap'),\n    url(r'', include('payments.urls')),\n    url('', include('social_django.urls', namespace='social')),\n]\n\nif settings.DEBUG:\n    # static files (images, css, javascript, etc.)\n    urlpatterns += [\n        url(r'^static/(?P<path>.*)$', serve)\n    ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n", "path": "saleor/urls.py"}], "after_files": [{"content": "from django.conf import settings\nfrom django.conf.urls import url, include\nfrom django.conf.urls.static import static\nfrom django.contrib.sitemaps.views import sitemap\nfrom django.contrib.staticfiles.views import serve\nfrom django.views.i18n import JavaScriptCatalog\nfrom graphene_django.views import GraphQLView\nfrom impersonate.views import impersonate, stop_impersonate\n\nfrom .cart.urls import urlpatterns as cart_urls\nfrom .checkout.urls import urlpatterns as checkout_urls\nfrom .core.sitemaps import sitemaps\nfrom .core.urls import urlpatterns as core_urls\nfrom .dashboard.urls import urlpatterns as dashboard_urls\nfrom .data_feeds.urls import urlpatterns as feed_urls\nfrom .order.urls import urlpatterns as order_urls\nfrom .product.urls import urlpatterns as product_urls\nfrom .registration.urls import urlpatterns as registration_urls\nfrom .search.urls import urlpatterns as search_urls\nfrom .userprofile.urls import urlpatterns as userprofile_urls\n\nurlpatterns = [\n    url(r'^', include(core_urls)),\n    url(r'^account/', include(registration_urls)),\n    url(r'^cart/', include((cart_urls, 'cart'), namespace='cart')),\n    url(r'^checkout/',\n        include((checkout_urls, 'checkout'), namespace='checkout')),\n    url(r'^dashboard/',\n        include((dashboard_urls, 'dashboard'), namespace='dashboard')),\n    url(r'^graphql', GraphQLView.as_view(graphiql=settings.DEBUG)),\n    url(r'^impersonate/stop/$', stop_impersonate, name='impersonate-stop'),\n    url(r'^impersonate/(?P<uid>\\d+)/$', impersonate, name='impersonate-start'),\n    url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),\n    url(r'^order/', include((order_urls, 'order'), namespace='order')),\n    url(r'^products/',\n        include((product_urls, 'product'), namespace='product')),\n    url(r'^profile/',\n        include((userprofile_urls, 'profile'), namespace='profile')),\n    url(r'^feeds/',\n        include((feed_urls, 'data_feeds'), namespace='data_feeds')),\n    url(r'^search/', include((search_urls, 'search'), namespace='search')),\n    url(r'^sitemap\\.xml$', sitemap, {'sitemaps': sitemaps},\n        name='django.contrib.sitemaps.views.sitemap'),\n    url(r'', include('payments.urls')),\n    url('', include('social_django.urls', namespace='social')),\n]\n\nif settings.DEBUG:\n    # static files (images, css, javascript, etc.)\n    urlpatterns += [\n        url(r'^static/(?P<path>.*)$', serve)\n    ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n", "path": "saleor/urls.py"}]}