+ })
+
+
+@normalized_name
+def create_missing(request, name):
+ storage = getstorage()
+
+ if request.method == "POST":
+ form = DocumentCreateForm(request.POST, request.FILES)
+ if form.is_valid():
+ doc = storage.create_document(
+ name=form.cleaned_data['id'],
+ text=form.cleaned_data['text'],
+ )
+
+ return http.HttpResponseRedirect(reverse("wiki_editor", args=[doc.name]))
+ else:
+ form = DocumentCreateForm(initial={
+ "id": name.replace(" ", "_"),
+ "title": name.title(),
+ })
+
+ return direct_to_template(request, "wiki/document_create_missing.html", extra_context={
+ "document_name": name,
+ "form": form,