fix url /apps/ url conflicts
In urls.py we have:
url(r'^apps/$', views.WebappList.as_view(), name='webapp_list'),
url(r'^apps/authors/(?P<username>[\w.@+-]+)/$', views.UserWebappList.as_view(), name='user_webapp_list'),
url(r'^apps/(?P<docker_name>[\w-]+)/update/$', views.WebappUpdate.as_view(), name="webapp_update"),
url(r'^apps/create/$', views.WebappCreate.as_view(), name='webapp_creation'),
url(r'^apps/(?P<docker_name>[\w-]+)/sandbox/$', views.WebappSandboxPanel.as_view(), name="webapp_sandbox_panel"),
url(r'^apps/(?P<docker_name>[\w-]+)/json$', views.WebappJson.as_view(), name='webapp_json'),
This implies that authors, create and any possible future endpoint name has to be a reserved names (that cannot be used as a docker_name), otherwise we are exposed to routing conflicts.
It is not possible to be future-proof if we put actions in the same namespace as the webapp names. One solution I can suggest is to put actions in a _/
subdirectory and make _
a reserved name in the model (for the docker_name field):
url(r'^apps/_/authors/(?P<username>[\w.@+-]+)/$', views.UserWebappList.as_view(), name='user_webapp_list'),
url(r'^apps/_/create/$', views.WebappCreate.as_view(), name='webapp_creation'),