func HandleSetup(w http.ResponseWriter, r *http.Request) error {
	if users.Count() != 0 {
		return server.NotAuthorizedError(nil, "Users already exist")
	}
	params, err := mux.Params(r)
	if err != nil {
		return server.InternalError(err)
	}
	hash, err := auth.HashPassword(params.Get("password"))
	if err != nil {
		return server.InternalError(err, "Problem hashing password")
	}
	userParams := map[string]string{
		"email":         params.Get("email"),
		"password_hash": hash,
		"name":          nameFromEmail(params.Get("email")),
		"status":        "100",
		"role":          "100",
		"title":         "Administrator",
	}
	user := users.New()
	uid, err := user.Create(userParams)
	if err != nil {
		return server.InternalError(err)
	}
	user, err = users.Find(uid)
	if err != nil {
		return server.InternalError(err, "Error creating user")
	}
	session, err := auth.Session(w, r)
	if err != nil {
		log.Info(log.V{"msg": "login failed", "user_id": user.ID, "status": http.StatusInternalServerError})
	}
	session.Set(auth.SessionUserKey, fmt.Sprintf("%d", user.ID))
	session.Save(w)
	log.Info(log.V{"msg": "login", "user_email": user.Email, "user_id": user.ID})
	pageParams := map[string]string{
		"status": "100",
		"name":   "Fragmenta",
		"url":    "/",
		"text":   "<section class=\"padded\"><h1>Welcome to Fragmenta</h1><p><a href=\"/pages/1/update\">Edit this page</a></p></section>",
	}
	_, err = pages.New().Create(pageParams)
	if err != nil {
		return server.InternalError(err)
	}
	pageParams = map[string]string{
		"status": "100",
		"name":   "About Us",
		"url":    "/about",
		"text":   "<section class=\"narrow\"><h1>About us</h1><p>About us</p></section>",
	}
	_, err = pages.New().Create(pageParams)
	if err != nil {
		return server.InternalError(err)
	}
	pageParams = map[string]string{
		"status": "100",
		"name":   "Privacy Policy",
		"url":    "/privacy",
		"text":   "<section class=\"narrow\"><h1>Privacy Policy</h1><p>We respect your privacy.</p></section>",
	}
	_, err = pages.New().Create(pageParams)
	if err != nil {
		return server.InternalError(err)
	}
	return server.Redirect(w, r, "/")
}
HandleSetup responds to POST /fragmenta/setup
package pageactions
import (
	"fmt"
	"net/http"
	"strings"
	"github.com/fragmenta/auth"
	"github.com/fragmenta/mux"
	"github.com/fragmenta/server"
	"github.com/fragmenta/server/log"
	"github.com/fragmenta/view"
	"github.com/fragmenta/fragmenta-cms/src/pages"
	"github.com/fragmenta/fragmenta-cms/src/users"
)
func HandleSetupShow(w http.ResponseWriter, r *http.Request) error {
	if users.Count() != 0 {
		return server.NotAuthorizedError(nil, "Users already exist")
	}
	view := view.NewRenderer(w, r)
	view.Template("pages/views/setup.html.got")
	return view.Render()
}