prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Error with `deis certs:remove`
  Getting the following error when trying to remove a cert.
  
  ```
  $ deis certs:remove '*.brandfolder.com'
  Removing *.brandfolder.com... 405 METHOD NOT ALLOWED
  Detail:
  Method 'DELETE' not allowed.
  ```
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `controller/api/urls.py`
  Content:
  ```
  1 from __future__ import unicode_literals
  2 
  3 from django.conf import settings
  4 from django.conf.urls import include, patterns, url
  5 
  6 from api import routers, views
  7 
  8 
  9 router = routers.ApiRouter()
  10 
  11 # Add the generated REST URLs and login/logout endpoint
  12 urlpatterns = patterns(
  13     '',
  14     url(r'^', include(router.urls)),
  15     # application release components
  16     url(r'^apps/(?P<id>{})/config/?'.format(settings.APP_URL_REGEX),
  17         views.ConfigViewSet.as_view({'get': 'retrieve', 'post': 'create'})),
  18     url(r'^apps/(?P<id>{})/builds/(?P<uuid>[-_\w]+)/?'.format(settings.APP_URL_REGEX),
  19         views.BuildViewSet.as_view({'get': 'retrieve'})),
  20     url(r'^apps/(?P<id>{})/builds/?'.format(settings.APP_URL_REGEX),
  21         views.BuildViewSet.as_view({'get': 'list', 'post': 'create'})),
  22     url(r'^apps/(?P<id>{})/releases/v(?P<version>[0-9]+)/?'.format(settings.APP_URL_REGEX),
  23         views.ReleaseViewSet.as_view({'get': 'retrieve'})),
  24     url(r'^apps/(?P<id>{})/releases/rollback/?'.format(settings.APP_URL_REGEX),
  25         views.ReleaseViewSet.as_view({'post': 'rollback'})),
  26     url(r'^apps/(?P<id>{})/releases/?'.format(settings.APP_URL_REGEX),
  27         views.ReleaseViewSet.as_view({'get': 'list'})),
  28     # application infrastructure
  29     url(r'^apps/(?P<id>{})/containers/(?P<type>[-_\w]+)/(?P<num>[-_\w]+)/?'.format(
  30         settings.APP_URL_REGEX),
  31         views.ContainerViewSet.as_view({'get': 'retrieve'})),
  32     url(r'^apps/(?P<id>{})/containers/(?P<type>[-_\w.]+)/?'.format(settings.APP_URL_REGEX),
  33         views.ContainerViewSet.as_view({'get': 'list'})),
  34     url(r'^apps/(?P<id>{})/containers/?'.format(settings.APP_URL_REGEX),
  35         views.ContainerViewSet.as_view({'get': 'list'})),
  36     # application domains
  37     url(r'^apps/(?P<id>{})/domains/(?P<domain>[-\._\w]+)/?'.format(settings.APP_URL_REGEX),
  38         views.DomainViewSet.as_view({'delete': 'destroy'})),
  39     url(r'^apps/(?P<id>{})/domains/?'.format(settings.APP_URL_REGEX),
  40         views.DomainViewSet.as_view({'post': 'create', 'get': 'list'})),
  41     # application actions
  42     url(r'^apps/(?P<id>{})/scale/?'.format(settings.APP_URL_REGEX),
  43         views.AppViewSet.as_view({'post': 'scale'})),
  44     url(r'^apps/(?P<id>{})/logs/?'.format(settings.APP_URL_REGEX),
  45         views.AppViewSet.as_view({'get': 'logs'})),
  46     url(r'^apps/(?P<id>{})/run/?'.format(settings.APP_URL_REGEX),
  47         views.AppViewSet.as_view({'post': 'run'})),
  48     # apps sharing
  49     url(r'^apps/(?P<id>{})/perms/(?P<username>[-_\w]+)/?'.format(settings.APP_URL_REGEX),
  50         views.AppPermsViewSet.as_view({'delete': 'destroy'})),
  51     url(r'^apps/(?P<id>{})/perms/?'.format(settings.APP_URL_REGEX),
  52         views.AppPermsViewSet.as_view({'get': 'list', 'post': 'create'})),
  53     # apps base endpoint
  54     url(r'^apps/(?P<id>{})/?'.format(settings.APP_URL_REGEX),
  55         views.AppViewSet.as_view({'get': 'retrieve', 'delete': 'destroy'})),
  56     url(r'^apps/?',
  57         views.AppViewSet.as_view({'get': 'list', 'post': 'create'})),
  58     # key
  59     url(r'^keys/(?P<id>.+)/?',
  60         views.KeyViewSet.as_view({
  61             'get': 'retrieve', 'delete': 'destroy'})),
  62     url(r'^keys/?',
  63         views.KeyViewSet.as_view({'get': 'list', 'post': 'create'})),
  64     # hooks
  65     url(r'^hooks/push/?',
  66         views.PushHookViewSet.as_view({'post': 'create'})),
  67     url(r'^hooks/build/?',
  68         views.BuildHookViewSet.as_view({'post': 'create'})),
  69     url(r'^hooks/config/?',
  70         views.ConfigHookViewSet.as_view({'post': 'create'})),
  71     # authn / authz
  72     url(r'^auth/register/?',
  73         views.UserRegistrationViewSet.as_view({'post': 'create'})),
  74     url(r'^auth/cancel/?',
  75         views.UserManagementViewSet.as_view({'delete': 'destroy'})),
  76     url(r'^auth/passwd/?',
  77         views.UserManagementViewSet.as_view({'post': 'passwd'})),
  78     url(r'^auth/login/',
  79         'rest_framework.authtoken.views.obtain_auth_token'),
  80     # admin sharing
  81     url(r'^admin/perms/(?P<username>[-_\w]+)/?',
  82         views.AdminPermsViewSet.as_view({'delete': 'destroy'})),
  83     url(r'^admin/perms/?',
  84         views.AdminPermsViewSet.as_view({'get': 'list', 'post': 'create'})),
  85     url(r'^certs/(?P<common_name>[-_.\w]+)/?'.format(settings.APP_URL_REGEX),
  86         views.CertificateViewSet.as_view({'get': 'retrieve', 'delete': 'destroy'})),
  87     url(r'^certs/?',
  88         views.CertificateViewSet.as_view({'get': 'list', 'post': 'create'})),
  89     # list users
  90     url(r'^users/', views.UserView.as_view({'get': 'list'})),
  91 )
  92
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/controller/api/urls.py b/controller/api/urls.py
  --- a/controller/api/urls.py
  +++ b/controller/api/urls.py
  @@ -82,7 +82,7 @@
           views.AdminPermsViewSet.as_view({'delete': 'destroy'})),
       url(r'^admin/perms/?',
           views.AdminPermsViewSet.as_view({'get': 'list', 'post': 'create'})),
  -    url(r'^certs/(?P<common_name>[-_.\w]+)/?'.format(settings.APP_URL_REGEX),
  +    url(r'^certs/(?P<common_name>[-_*.\w]+)/?'.format(settings.APP_URL_REGEX),
           views.CertificateViewSet.as_view({'get': 'retrieve', 'delete': 'destroy'})),
       url(r'^certs/?',
           views.CertificateViewSet.as_view({'get': 'list', 'post': 'create'})),
  
verification_info: {"golden_diff": "diff --git a/controller/api/urls.py b/controller/api/urls.py\n--- a/controller/api/urls.py\n+++ b/controller/api/urls.py\n@@ -82,7 +82,7 @@\n         views.AdminPermsViewSet.as_view({'delete': 'destroy'})),\n     url(r'^admin/perms/?',\n         views.AdminPermsViewSet.as_view({'get': 'list', 'post': 'create'})),\n-    url(r'^certs/(?P<common_name>[-_.\\w]+)/?'.format(settings.APP_URL_REGEX),\n+    url(r'^certs/(?P<common_name>[-_*.\\w]+)/?'.format(settings.APP_URL_REGEX),\n         views.CertificateViewSet.as_view({'get': 'retrieve', 'delete': 'destroy'})),\n     url(r'^certs/?',\n         views.CertificateViewSet.as_view({'get': 'list', 'post': 'create'})),\n", "issue": "Error with `deis certs:remove`\nGetting the following error when trying to remove a cert.\n\n```\n$ deis certs:remove '*.brandfolder.com'\nRemoving *.brandfolder.com... 405 METHOD NOT ALLOWED\nDetail:\nMethod 'DELETE' not allowed.\n```\n\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.conf.urls import include, patterns, url\n\nfrom api import routers, views\n\n\nrouter = routers.ApiRouter()\n\n# Add the generated REST URLs and login/logout endpoint\nurlpatterns = patterns(\n    '',\n    url(r'^', include(router.urls)),\n    # application release components\n    url(r'^apps/(?P<id>{})/config/?'.format(settings.APP_URL_REGEX),\n        views.ConfigViewSet.as_view({'get': 'retrieve', 'post': 'create'})),\n    url(r'^apps/(?P<id>{})/builds/(?P<uuid>[-_\\w]+)/?'.format(settings.APP_URL_REGEX),\n        views.BuildViewSet.as_view({'get': 'retrieve'})),\n    url(r'^apps/(?P<id>{})/builds/?'.format(settings.APP_URL_REGEX),\n        views.BuildViewSet.as_view({'get': 'list', 'post': 'create'})),\n    url(r'^apps/(?P<id>{})/releases/v(?P<version>[0-9]+)/?'.format(settings.APP_URL_REGEX),\n        views.ReleaseViewSet.as_view({'get': 'retrieve'})),\n    url(r'^apps/(?P<id>{})/releases/rollback/?'.format(settings.APP_URL_REGEX),\n        views.ReleaseViewSet.as_view({'post': 'rollback'})),\n    url(r'^apps/(?P<id>{})/releases/?'.format(settings.APP_URL_REGEX),\n        views.ReleaseViewSet.as_view({'get': 'list'})),\n    # application infrastructure\n    url(r'^apps/(?P<id>{})/containers/(?P<type>[-_\\w]+)/(?P<num>[-_\\w]+)/?'.format(\n        settings.APP_URL_REGEX),\n        views.ContainerViewSet.as_view({'get': 'retrieve'})),\n    url(r'^apps/(?P<id>{})/containers/(?P<type>[-_\\w.]+)/?'.format(settings.APP_URL_REGEX),\n        views.ContainerViewSet.as_view({'get': 'list'})),\n    url(r'^apps/(?P<id>{})/containers/?'.format(settings.APP_URL_REGEX),\n        views.ContainerViewSet.as_view({'get': 'list'})),\n    # application domains\n    url(r'^apps/(?P<id>{})/domains/(?P<domain>[-\\._\\w]+)/?'.format(settings.APP_URL_REGEX),\n        views.DomainViewSet.as_view({'delete': 'destroy'})),\n    url(r'^apps/(?P<id>{})/domains/?'.format(settings.APP_URL_REGEX),\n        views.DomainViewSet.as_view({'post': 'create', 'get': 'list'})),\n    # application actions\n    url(r'^apps/(?P<id>{})/scale/?'.format(settings.APP_URL_REGEX),\n        views.AppViewSet.as_view({'post': 'scale'})),\n    url(r'^apps/(?P<id>{})/logs/?'.format(settings.APP_URL_REGEX),\n        views.AppViewSet.as_view({'get': 'logs'})),\n    url(r'^apps/(?P<id>{})/run/?'.format(settings.APP_URL_REGEX),\n        views.AppViewSet.as_view({'post': 'run'})),\n    # apps sharing\n    url(r'^apps/(?P<id>{})/perms/(?P<username>[-_\\w]+)/?'.format(settings.APP_URL_REGEX),\n        views.AppPermsViewSet.as_view({'delete': 'destroy'})),\n    url(r'^apps/(?P<id>{})/perms/?'.format(settings.APP_URL_REGEX),\n        views.AppPermsViewSet.as_view({'get': 'list', 'post': 'create'})),\n    # apps base endpoint\n    url(r'^apps/(?P<id>{})/?'.format(settings.APP_URL_REGEX),\n        views.AppViewSet.as_view({'get': 'retrieve', 'delete': 'destroy'})),\n    url(r'^apps/?',\n        views.AppViewSet.as_view({'get': 'list', 'post': 'create'})),\n    # key\n    url(r'^keys/(?P<id>.+)/?',\n        views.KeyViewSet.as_view({\n            'get': 'retrieve', 'delete': 'destroy'})),\n    url(r'^keys/?',\n        views.KeyViewSet.as_view({'get': 'list', 'post': 'create'})),\n    # hooks\n    url(r'^hooks/push/?',\n        views.PushHookViewSet.as_view({'post': 'create'})),\n    url(r'^hooks/build/?',\n        views.BuildHookViewSet.as_view({'post': 'create'})),\n    url(r'^hooks/config/?',\n        views.ConfigHookViewSet.as_view({'post': 'create'})),\n    # authn / authz\n    url(r'^auth/register/?',\n        views.UserRegistrationViewSet.as_view({'post': 'create'})),\n    url(r'^auth/cancel/?',\n        views.UserManagementViewSet.as_view({'delete': 'destroy'})),\n    url(r'^auth/passwd/?',\n        views.UserManagementViewSet.as_view({'post': 'passwd'})),\n    url(r'^auth/login/',\n        'rest_framework.authtoken.views.obtain_auth_token'),\n    # admin sharing\n    url(r'^admin/perms/(?P<username>[-_\\w]+)/?',\n        views.AdminPermsViewSet.as_view({'delete': 'destroy'})),\n    url(r'^admin/perms/?',\n        views.AdminPermsViewSet.as_view({'get': 'list', 'post': 'create'})),\n    url(r'^certs/(?P<common_name>[-_.\\w]+)/?'.format(settings.APP_URL_REGEX),\n        views.CertificateViewSet.as_view({'get': 'retrieve', 'delete': 'destroy'})),\n    url(r'^certs/?',\n        views.CertificateViewSet.as_view({'get': 'list', 'post': 'create'})),\n    # list users\n    url(r'^users/', views.UserView.as_view({'get': 'list'})),\n)\n", "path": "controller/api/urls.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.conf.urls import include, patterns, url\n\nfrom api import routers, views\n\n\nrouter = routers.ApiRouter()\n\n# Add the generated REST URLs and login/logout endpoint\nurlpatterns = patterns(\n    '',\n    url(r'^', include(router.urls)),\n    # application release components\n    url(r'^apps/(?P<id>{})/config/?'.format(settings.APP_URL_REGEX),\n        views.ConfigViewSet.as_view({'get': 'retrieve', 'post': 'create'})),\n    url(r'^apps/(?P<id>{})/builds/(?P<uuid>[-_\\w]+)/?'.format(settings.APP_URL_REGEX),\n        views.BuildViewSet.as_view({'get': 'retrieve'})),\n    url(r'^apps/(?P<id>{})/builds/?'.format(settings.APP_URL_REGEX),\n        views.BuildViewSet.as_view({'get': 'list', 'post': 'create'})),\n    url(r'^apps/(?P<id>{})/releases/v(?P<version>[0-9]+)/?'.format(settings.APP_URL_REGEX),\n        views.ReleaseViewSet.as_view({'get': 'retrieve'})),\n    url(r'^apps/(?P<id>{})/releases/rollback/?'.format(settings.APP_URL_REGEX),\n        views.ReleaseViewSet.as_view({'post': 'rollback'})),\n    url(r'^apps/(?P<id>{})/releases/?'.format(settings.APP_URL_REGEX),\n        views.ReleaseViewSet.as_view({'get': 'list'})),\n    # application infrastructure\n    url(r'^apps/(?P<id>{})/containers/(?P<type>[-_\\w]+)/(?P<num>[-_\\w]+)/?'.format(\n        settings.APP_URL_REGEX),\n        views.ContainerViewSet.as_view({'get': 'retrieve'})),\n    url(r'^apps/(?P<id>{})/containers/(?P<type>[-_\\w.]+)/?'.format(settings.APP_URL_REGEX),\n        views.ContainerViewSet.as_view({'get': 'list'})),\n    url(r'^apps/(?P<id>{})/containers/?'.format(settings.APP_URL_REGEX),\n        views.ContainerViewSet.as_view({'get': 'list'})),\n    # application domains\n    url(r'^apps/(?P<id>{})/domains/(?P<domain>[-\\._\\w]+)/?'.format(settings.APP_URL_REGEX),\n        views.DomainViewSet.as_view({'delete': 'destroy'})),\n    url(r'^apps/(?P<id>{})/domains/?'.format(settings.APP_URL_REGEX),\n        views.DomainViewSet.as_view({'post': 'create', 'get': 'list'})),\n    # application actions\n    url(r'^apps/(?P<id>{})/scale/?'.format(settings.APP_URL_REGEX),\n        views.AppViewSet.as_view({'post': 'scale'})),\n    url(r'^apps/(?P<id>{})/logs/?'.format(settings.APP_URL_REGEX),\n        views.AppViewSet.as_view({'get': 'logs'})),\n    url(r'^apps/(?P<id>{})/run/?'.format(settings.APP_URL_REGEX),\n        views.AppViewSet.as_view({'post': 'run'})),\n    # apps sharing\n    url(r'^apps/(?P<id>{})/perms/(?P<username>[-_\\w]+)/?'.format(settings.APP_URL_REGEX),\n        views.AppPermsViewSet.as_view({'delete': 'destroy'})),\n    url(r'^apps/(?P<id>{})/perms/?'.format(settings.APP_URL_REGEX),\n        views.AppPermsViewSet.as_view({'get': 'list', 'post': 'create'})),\n    # apps base endpoint\n    url(r'^apps/(?P<id>{})/?'.format(settings.APP_URL_REGEX),\n        views.AppViewSet.as_view({'get': 'retrieve', 'delete': 'destroy'})),\n    url(r'^apps/?',\n        views.AppViewSet.as_view({'get': 'list', 'post': 'create'})),\n    # key\n    url(r'^keys/(?P<id>.+)/?',\n        views.KeyViewSet.as_view({\n            'get': 'retrieve', 'delete': 'destroy'})),\n    url(r'^keys/?',\n        views.KeyViewSet.as_view({'get': 'list', 'post': 'create'})),\n    # hooks\n    url(r'^hooks/push/?',\n        views.PushHookViewSet.as_view({'post': 'create'})),\n    url(r'^hooks/build/?',\n        views.BuildHookViewSet.as_view({'post': 'create'})),\n    url(r'^hooks/config/?',\n        views.ConfigHookViewSet.as_view({'post': 'create'})),\n    # authn / authz\n    url(r'^auth/register/?',\n        views.UserRegistrationViewSet.as_view({'post': 'create'})),\n    url(r'^auth/cancel/?',\n        views.UserManagementViewSet.as_view({'delete': 'destroy'})),\n    url(r'^auth/passwd/?',\n        views.UserManagementViewSet.as_view({'post': 'passwd'})),\n    url(r'^auth/login/',\n        'rest_framework.authtoken.views.obtain_auth_token'),\n    # admin sharing\n    url(r'^admin/perms/(?P<username>[-_\\w]+)/?',\n        views.AdminPermsViewSet.as_view({'delete': 'destroy'})),\n    url(r'^admin/perms/?',\n        views.AdminPermsViewSet.as_view({'get': 'list', 'post': 'create'})),\n    url(r'^certs/(?P<common_name>[-_*.\\w]+)/?'.format(settings.APP_URL_REGEX),\n        views.CertificateViewSet.as_view({'get': 'retrieve', 'delete': 'destroy'})),\n    url(r'^certs/?',\n        views.CertificateViewSet.as_view({'get': 'list', 'post': 'create'})),\n    # list users\n    url(r'^users/', views.UserView.as_view({'get': 'list'})),\n)\n", "path": "controller/api/urls.py"}]}