prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Nightly support
  - nightlies don't have a separate version number but a flag:
  
  ```
  curl -X POST -u "user:password" http://localhost:8000/api/v1/apps/releases -H "Content-Type: application/json" -d '{"download":"https://example.com/release.tar.gz", "nightly":true }'
  ```
  - this is also listed in the "get all apps" API with a `nightly: true` attribute https://nextcloudappstore.readthedocs.io/en/latest/restapi.html#get-all-apps-and-releases
  - upload of a new nightly will delete the previous one for that app
  - this allows to upgrade to a nightly (needs to be invoked by the admin and can be undone -> next regular release of the app will be installed)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `nextcloudappstore/core/api/v1/urls.py`
  Content:
  ```
  1 from django.conf.urls import url
  2 from django.views.decorators.http import etag
  3 from nextcloudappstore.core.api.v1.views import Apps, AppReleases, \
  4     app_api_etag, Categories, category_api_etag
  5 
  6 urlpatterns = [
  7     url(r'^platform/(?P<version>\d+\.\d+\.\d+)/apps\.json$',
  8         etag(app_api_etag)(Apps.as_view()), name='apps'),
  9     url(r'^apps/releases/?$', AppReleases.as_view(),
  10         name='app-release-create'),
  11     url(r'^apps/(?P<pk>[a-z_]+)/?$', Apps.as_view(), name='app-delete'),
  12     url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\d+\.\d+\.\d+)/?$',
  13         AppReleases.as_view(), name='app-release-delete'),
  14     url(r'^categories.json$',
  15         etag(category_api_etag)(Categories.as_view()), name='categories'),
  16 ]
  17
  ```
  --- 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/nextcloudappstore/core/api/v1/urls.py b/nextcloudappstore/core/api/v1/urls.py
  --- a/nextcloudappstore/core/api/v1/urls.py
  +++ b/nextcloudappstore/core/api/v1/urls.py
  @@ -9,7 +9,8 @@
       url(r'^apps/releases/?$', AppReleases.as_view(),
           name='app-release-create'),
       url(r'^apps/(?P<pk>[a-z_]+)/?$', Apps.as_view(), name='app-delete'),
  -    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\d+\.\d+\.\d+)/?$',
  +    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\d+\.\d+\.\d+'
  +        r'(?:-nightly)?)/?$',
           AppReleases.as_view(), name='app-release-delete'),
       url(r'^categories.json$',
           etag(category_api_etag)(Categories.as_view()), name='categories'),
  
verification_info: {"golden_diff": "diff --git a/nextcloudappstore/core/api/v1/urls.py b/nextcloudappstore/core/api/v1/urls.py\n--- a/nextcloudappstore/core/api/v1/urls.py\n+++ b/nextcloudappstore/core/api/v1/urls.py\n@@ -9,7 +9,8 @@\n     url(r'^apps/releases/?$', AppReleases.as_view(),\n         name='app-release-create'),\n     url(r'^apps/(?P<pk>[a-z_]+)/?$', Apps.as_view(), name='app-delete'),\n-    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\\d+\\.\\d+\\.\\d+)/?$',\n+    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\\d+\\.\\d+\\.\\d+'\n+        r'(?:-nightly)?)/?$',\n         AppReleases.as_view(), name='app-release-delete'),\n     url(r'^categories.json$',\n         etag(category_api_etag)(Categories.as_view()), name='categories'),\n", "issue": "Nightly support\n- nightlies don't have a separate version number but a flag:\n\n```\ncurl -X POST -u \"user:password\" http://localhost:8000/api/v1/apps/releases -H \"Content-Type: application/json\" -d '{\"download\":\"https://example.com/release.tar.gz\", \"nightly\":true }'\n```\n- this is also listed in the \"get all apps\" API with a `nightly: true` attribute https://nextcloudappstore.readthedocs.io/en/latest/restapi.html#get-all-apps-and-releases\n- upload of a new nightly will delete the previous one for that app\n- this allows to upgrade to a nightly (needs to be invoked by the admin and can be undone -> next regular release of the app will be installed)\n\n", "before_files": [{"content": "from django.conf.urls import url\nfrom django.views.decorators.http import etag\nfrom nextcloudappstore.core.api.v1.views import Apps, AppReleases, \\\n    app_api_etag, Categories, category_api_etag\n\nurlpatterns = [\n    url(r'^platform/(?P<version>\\d+\\.\\d+\\.\\d+)/apps\\.json$',\n        etag(app_api_etag)(Apps.as_view()), name='apps'),\n    url(r'^apps/releases/?$', AppReleases.as_view(),\n        name='app-release-create'),\n    url(r'^apps/(?P<pk>[a-z_]+)/?$', Apps.as_view(), name='app-delete'),\n    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\\d+\\.\\d+\\.\\d+)/?$',\n        AppReleases.as_view(), name='app-release-delete'),\n    url(r'^categories.json$',\n        etag(category_api_etag)(Categories.as_view()), name='categories'),\n]\n", "path": "nextcloudappstore/core/api/v1/urls.py"}], "after_files": [{"content": "from django.conf.urls import url\nfrom django.views.decorators.http import etag\nfrom nextcloudappstore.core.api.v1.views import Apps, AppReleases, \\\n    app_api_etag, Categories, category_api_etag\n\nurlpatterns = [\n    url(r'^platform/(?P<version>\\d+\\.\\d+\\.\\d+)/apps\\.json$',\n        etag(app_api_etag)(Apps.as_view()), name='apps'),\n    url(r'^apps/releases/?$', AppReleases.as_view(),\n        name='app-release-create'),\n    url(r'^apps/(?P<pk>[a-z_]+)/?$', Apps.as_view(), name='app-delete'),\n    url(r'^apps/(?P<app>[a-z_]+)/releases/(?P<version>\\d+\\.\\d+\\.\\d+'\n        r'(?:-nightly)?)/?$',\n        AppReleases.as_view(), name='app-release-delete'),\n    url(r'^categories.json$',\n        etag(category_api_etag)(Categories.as_view()), name='categories'),\n]\n", "path": "nextcloudappstore/core/api/v1/urls.py"}]}