This adds two models -- Attachment and AttachmentRevision -- which
represent a file and its revisions. Attachments have a concept of
"current revision" just like Documents do, and any arbitrary revision
can be made the current one.

Attachments store a MindTouch ID, but not solely for bookkeeping
purposes. Because MindTouch's file URLs use the resource ID as a
unique identifier, we have to keep that in order to redirect MindTouch
URLs correctly. Their revisions store a MindTouch ID solely for future
migration bookkeeping; that field can be deleted later.

A ludicrously simple and possibly broken file-serving view is present,
and should be replaced with real views (coming in a future set of
commits).

Documents have a new property -- 'attachments' -- which returns a
queryset of Attachments for the current revision of the Document. At
the moment this is done by scanning the HTML for URLs matching the
MindTouch file URL pattern. This will, once kuma's own real file URLs
get settled, also look for those.
Bug 761826: Handle legacy MindTouch file URLs.

This is simply a URL pattern and corresponding view which responds to
the MindTouch file URL scheme, looks up the correspondong kuma
Attachment, and issues a redirect.

It is relatively future-proof for the case where kuma's own file URL
patterns change (very likely), and is testable independent of having a
fully-migrated set of files (very handy). Test cases are actual
MindTouch URLs, with corresponding dummy Attachments created so kuma
has something to redirect to.
fix bug 764426 - Prevent slashes in slugs from form
Merge pull request #314 from ubernostrum/file-models

Files #1
Bug 768492: Quick hack to enable a wiki doc to be treated as wiki CSS
Merge pull request #327 from lmorchard/admin-custom-css-768492

Bug 768492: Quick hack to enable a wiki doc to be treated as wiki CSS
fix bug 770066 - Allow spaces in wiki tags
Merge pull request #328 from darkwing/tag-spaces-770066

fix bug 770066 - Allow spaces in wiki tags
Add color, box-shadow, and gradients to CSS whitelist
Whitelist <ul> <ol> & <li> (and allows the style id & class attributes on them)
Merge pull request #329 from teoli2003/master

Whiteliste <ul> <ol> & <li>
bug 766252: Deferred and singleton page rendering

* Documents can be rendered on demand or offloaded into the Celery queue

    * Documents with `defer_rendering == True` are rendered with Celery
      queue tasks. Otherwise, rendering is attempted on demand during
      the request/reasponse cycle.

    * If a Document takes too long to render, `defer_rendering` is
      automatically set to True. This time limit is controlled by
      KUMA_DOCUMENT_FORCE_DEFERRED_TIMEOUT in Constance settings

* Allow only one rendering per Document at any given time. Additional
  attempts to render a Document while already in progress results in a
  warning message and/or stale content while the rendering finishes.

* Rendered content is now kept in the DB, rather than temporary cache

* Lots of additional Document fields to track rendering state, store
  rendered content, and control deferred rendering.

* Reload no longer triggers a render of the page. However, editing and
  saving a Document does.

* Shift-Reload by a logged-in user schedules a fresh render, assuming
  there's not one already in progress.

* Display warning messages about the render status of a page. But, only
  for logged-in users to keep search engine crawlers from indexing them.

* Display detailed Kumascript errors only to logged in users, also to
  avoid search indexing.

* Document rendering via kumascript refactored out of views.py and into
  models.py and kumascript.py

* Disable schedule_rebuild_kb and _maybe_schedule_rebuild in favor of
  new Document rendering system.

* Tweaks to Document admin to allow mass enable/disable of deferred
  rendering, link to public URL of Documents.

* Reenable celery queue in settings_local, tweaks to failing tests

* manage.py command for manually triggering or queuing a page render
Merge pull request #318 from lmorchard/page-rebuild-queue-task-766252

bug 766252: Deferred and singleton page rendering
Merge pull request #273 from darkwing/disallows-slashes-slug-764426

fix bug 764426 - Prevent slashes in slugs from form
bug 759356 - restore MT url paths to fix devmo_url
fix bug 760240 - Allowing ability to add main leve docs instead of 404
fix bug 770338 - Preventing translation issue whereby a redirect on the main level is created
fix bug 770400 - Search results use current hostname for links
fix bug 770395 - config for diff context lines
Merge pull request #333 from darkwing/search-redirect-770400

fix bug 770400 - Search results use current hostname for links