Commits

hideki nara committed eb14883

django management command interface

  • Participants
  • Parent commits 9e15762

Comments (0)

Files changed (17)

 eggs
 parts
 src/.*.egg-info
+build
          ],
      ),
      test_suite='nose.collector',
-     tests_require=['Nose','minimock','pep8'],
+     tests_require=[
+        'Nose',
+        'minimock',
+        'pep8'],
      entry_points="""
         [console_scripts]
         schema2rst = schema2rst:main

File src/schema2rst/management/__init__.py

Empty file added.

File src/schema2rst/management/commands/__init__.py

Empty file added.

File src/schema2rst/management/commands/schemadoc.py

+# -*- coding: utf-8 -*-
+
+from django.core.management.base import BaseCommand, CommandError
+#from django.db import transaction
+#from django.db.utils import IntegrityError
+#from django.db.models import AutoField,Sum,Max ,Q
+#from django.contrib.auth.models import User
+from django.conf import settings
+
+from schema2rst import schema2rst
+from optparse import make_option
+from datetime import datetime
+import commands
+import os
+#import csv
+#
+#import time
+
+class Command(BaseCommand):
+    args = ''
+    help = ''
+
+    option_list = BaseCommand.option_list + (
+
+        make_option('--file',
+            action='store',
+            dest='file',
+            default='schema.rst',
+            help=u'file name'),
+
+        make_option('--command',
+            action='store',
+            dest='command',
+            default='generate',
+            help=u'Command name'),
+        
+        make_option('--db',
+            action='store',
+            dest='db',
+            default='default',
+            help=u'Django Databases index name'),
+
+        make_option('--encoding',
+            action='store',
+            dest='encoding',
+            default='utf-8',
+            help=u'Encodings'),
+        )
+    '''  Options list
+        
+    '''
+
+    def handle_generate(self,*args,**options):  
+        ''' generate schema 
+        '''
+        config = settings.DATABASES[ options['db'] ]
+        config = dict( [(k.lower(),v ) for k,v in config.items()] )
+        config['db'] = config['name']
+        config['passwd'] = config['password']
+
+        schema2rst.main(config)
+
+    def handle_help(self  ,*args, **options):
+        ''' help '''
+        print "do something later" 
+
+    def handle(self  ,*args, **options):
+        ''' Main'''
+        getattr(self, 'handle_%s'% options['command'],Command.handle_help)(*args,**options)
+

File src/schema2rst/schema2rst.py

 from sphinx import SphinxDocGenerator
 
 
-def main():
-    if len(sys.argv) != 2:
-        sys.stderr.write('Usage: schema2rst CONFIG_FILE\n')
-        sys.exit(1)
-
-    config = yaml.load(file(sys.argv[1]))
+def main(config = None):
+    if config == None:
+        if len(sys.argv) != 2:
+            sys.stderr.write('Usage: schema2rst CONFIG_FILE\n')
+            sys.exit(1)
+    
+        config = yaml.load(file(sys.argv[1]))
 
     url = 'mysql://%s:%s@%s/%s' % \
-          (config['user'], config['passwd'], config['host'], config['db'])
+        (config['user'], config['passwd'], config['host'], config['db'])
+
     engine = sqlalchemy.create_engine(url)
 
     insp = inspectors.create_inspector(engine)

File test/app/__init__.py

Empty file added.

File test/app/initial_data.json

+[
+  {
+    "pk": 5, 
+    "model": "contenttypes.contenttype", 
+    "fields": {
+      "model": "contenttype", 
+      "name": "content type", 
+      "app_label": "contenttypes"
+    }
+  }, 
+  {
+    "pk": 2, 
+    "model": "contenttypes.contenttype", 
+    "fields": {
+      "model": "group", 
+      "name": "group", 
+      "app_label": "auth"
+    }
+  }, 
+  {
+    "pk": 4, 
+    "model": "contenttypes.contenttype", 
+    "fields": {
+      "model": "message", 
+      "name": "message", 
+      "app_label": "auth"
+    }
+  }, 
+  {
+    "pk": 8, 
+    "model": "contenttypes.contenttype", 
+    "fields": {
+      "model": "openid", 
+      "name": "OpenID \u30a2\u30a4\u30c7\u30f3\u30c6\u30a3\u30c6\u30a3", 
+      "app_label": "openid"
+    }
+  }, 
+  {
+    "pk": 1, 
+    "model": "contenttypes.contenttype", 
+    "fields": {
+      "model": "permission", 
+      "name": "permission", 
+      "app_label": "auth"
+    }
+  }, 
+  {
+    "pk": 6, 
+    "model": "contenttypes.contenttype", 
+    "fields": {
+      "model": "session", 
+      "name": "session", 
+      "app_label": "sessions"
+    }
+  }, 
+  {
+    "pk": 7, 
+    "model": "contenttypes.contenttype", 
+    "fields": {
+      "model": "site", 
+      "name": "site", 
+      "app_label": "sites"
+    }
+  }, 
+  {
+    "pk": 3, 
+    "model": "contenttypes.contenttype", 
+    "fields": {
+      "model": "user", 
+      "name": "user", 
+      "app_label": "auth"
+    }
+  }, 
+  {
+    "pk": 1, 
+    "model": "sites.site", 
+    "fields": {
+      "domain": "example.com", 
+      "name": "example.com"
+    }
+  }, 
+  {
+    "pk": 4, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "add_group", 
+      "name": "Can add group", 
+      "content_type": 2
+    }
+  }, 
+  {
+    "pk": 5, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "change_group", 
+      "name": "Can change group", 
+      "content_type": 2
+    }
+  }, 
+  {
+    "pk": 6, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "delete_group", 
+      "name": "Can delete group", 
+      "content_type": 2
+    }
+  }, 
+  {
+    "pk": 10, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "add_message", 
+      "name": "Can add message", 
+      "content_type": 4
+    }
+  }, 
+  {
+    "pk": 11, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "change_message", 
+      "name": "Can change message", 
+      "content_type": 4
+    }
+  }, 
+  {
+    "pk": 12, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "delete_message", 
+      "name": "Can delete message", 
+      "content_type": 4
+    }
+  }, 
+  {
+    "pk": 1, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "add_permission", 
+      "name": "Can add permission", 
+      "content_type": 1
+    }
+  }, 
+  {
+    "pk": 2, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "change_permission", 
+      "name": "Can change permission", 
+      "content_type": 1
+    }
+  }, 
+  {
+    "pk": 3, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "delete_permission", 
+      "name": "Can delete permission", 
+      "content_type": 1
+    }
+  }, 
+  {
+    "pk": 7, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "add_user", 
+      "name": "Can add user", 
+      "content_type": 3
+    }
+  }, 
+  {
+    "pk": 8, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "change_user", 
+      "name": "Can change user", 
+      "content_type": 3
+    }
+  }, 
+  {
+    "pk": 9, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "delete_user", 
+      "name": "Can delete user", 
+      "content_type": 3
+    }
+  }, 
+  {
+    "pk": 13, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "add_contenttype", 
+      "name": "Can add content type", 
+      "content_type": 5
+    }
+  }, 
+  {
+    "pk": 14, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "change_contenttype", 
+      "name": "Can change content type", 
+      "content_type": 5
+    }
+  }, 
+  {
+    "pk": 15, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "delete_contenttype", 
+      "name": "Can delete content type", 
+      "content_type": 5
+    }
+  }, 
+  {
+    "pk": 22, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "add_openid", 
+      "name": "Can add OpenID \u30a2\u30a4\u30c7\u30f3\u30c6\u30a3\u30c6\u30a3", 
+      "content_type": 8
+    }
+  }, 
+  {
+    "pk": 23, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "change_openid", 
+      "name": "Can change OpenID \u30a2\u30a4\u30c7\u30f3\u30c6\u30a3\u30c6\u30a3", 
+      "content_type": 8
+    }
+  }, 
+  {
+    "pk": 24, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "delete_openid", 
+      "name": "Can delete OpenID \u30a2\u30a4\u30c7\u30f3\u30c6\u30a3\u30c6\u30a3", 
+      "content_type": 8
+    }
+  }, 
+  {
+    "pk": 16, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "add_session", 
+      "name": "Can add session", 
+      "content_type": 6
+    }
+  }, 
+  {
+    "pk": 17, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "change_session", 
+      "name": "Can change session", 
+      "content_type": 6
+    }
+  }, 
+  {
+    "pk": 18, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "delete_session", 
+      "name": "Can delete session", 
+      "content_type": 6
+    }
+  }, 
+  {
+    "pk": 19, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "add_site", 
+      "name": "Can add site", 
+      "content_type": 7
+    }
+  }, 
+  {
+    "pk": 20, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "change_site", 
+      "name": "Can change site", 
+      "content_type": 7
+    }
+  }, 
+  {
+    "pk": 21, 
+    "model": "auth.permission", 
+    "fields": {
+      "codename": "delete_site", 
+      "name": "Can delete site", 
+      "content_type": 7
+    }
+  }, 
+  {
+    "pk": 1, 
+    "model": "auth.user", 
+    "fields": {
+      "username": "admin", 
+      "first_name": "", 
+      "last_name": "", 
+      "is_active": true, 
+      "is_superuser": true, 
+      "is_staff": true, 
+      "last_login": "2012-01-24 05:50:32", 
+      "groups": [], 
+      "user_permissions": [], 
+      "password": "sha1$5ff35$54968a6d724a8e64e240a4aaba2f0cea17199291", 
+      "email": "admin@admin.com", 
+      "date_joined": "2012-01-24 05:50:32"
+    }
+  }
+]

File test/app/manage.py

+#!/usr/bin/env python
+from django.core.management import execute_manager
+import imp
+try:
+    imp.find_module('settings') # Assumed to be in the same directory.
+except ImportError:
+    import sys
+    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
+    sys.exit(1)
+
+import settings
+
+if __name__ == "__main__":
+    execute_manager(settings)

File test/app/openid/__init__.py

+__all__ = ('__version__', '__build__')
+__version__ = (0,0,1)
+__build__ = ''

File test/app/openid/models.py

+# -*- coding: utf-8 -*-
+
+from django.db.models import AutoField,Sum,Max ,Q
+from django.db import models
+from django.contrib.auth.models import User
+from django.contrib.auth import authenticate
+from django.core.urlresolvers import reverse
+
+from datetime import datetime,timedelta
+
+class OpenID(models.Model):
+    ''' OpenID '''
+
+    user= models.ForeignKey(User,verbose_name=u'システムユーザ−',blank=True,null=True,default=None )
+    openid = models.CharField(u'OpenIDユーザ−識別子(user_id)',max_length=255, ) 
+    dt_created =  models.DateTimeField(u'作成時刻',help_text=u'',default=datetime.now )
+    dt_updated =  models.DateTimeField(u'更新時刻',help_text=u'',default=datetime.now )
+
+    def __unicode__(self):
+        return "%s for %s" % ( self.openid, self.user )
+
+    class Meta:
+        verbose_name =u'OpenID アイデンティティ'
+        verbose_name_plural =u'OpenID アイデンティティ'
+

File test/app/openid/tests.py

+# -*- coding: utf-8 -*-
+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+from models import *
+from django.contrib.auth.models import User
+import jwt
+
+import urllib,cgi,os
+
+class OpenIDRpTest(TestCase):
+    '''  Sepcify running server_id ( http://op.net:8001/ )
+        
+    ''' 
+    fixtures = []
+
+    def test_begin_provide_peer_op(self):
+        """ 
+        python manage.py test openid.OpenIDRpTest.test_begin_provide_peer_op
+        """
+        print "running RP is ", os.environ['RP']
+        op = OpenIDServer.objects.get_remote_server(os.environ['OP'] )        
+        print "OP...>", op
+        self.failUnless( op )
+
+    def test_begin_provide_peer_rp(self):
+        """ 
+        python manage.py test openid.OpenIDRpTest.test_begin_provide_peer_rp
+        """
+        op = OpenIDServer.objects.get_remote_server(os.environ['OP'] )        
+        self.failUnless( op )
+        print "OP = ",op
+        print "OP Reg Request (dict)=", op.gen_auto_regist_client_request().to_dict()
+        print "OP Reg Request (json)=", op.gen_auto_regist_client_request().to_json()
+
+        rp = op.get_connecting_client( os.environ['RP']  )
+        print "RP = ",rp
+        self.failUnless( rp )
+
+    def test_begin_create_request(self):
+        """ 
+        python manage.py test accounts.openid.tests.OpenIDRpTest.test_begin_create_request
+        """
+        op = OpenIDServer.objects.get_remote_server(os.environ['OP'] )        
+        rp = op.get_connecting_client( os.environ['RP']  )
+        req = rp.create_request( {'scope':'openid'})
+        self.failUnless( req )
+        print "request ",req,"redirect url:",req.redirect_url()
+

File test/app/readme.rst

+Schema2rst django integration
+------------------------------------------------------
+
+run like this::
+
+    $python manage.py schemadoc > static/schema.rst
+    $rst2html.py  static/schema.rst  > static/schema.html

File test/app/settings.py

+# Django settings for app project.
+import os
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.abspath(__file__)))
+
+ADMINS = (
+    # ('Your Name', 'your_email@example.com'),
+)
+
+MANAGERS = ADMINS
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'schema2rst',                      # Or path to database file if using sqlite3.
+        'USER': 'schema2rst',                      # Not used with sqlite3.
+        'PASSWORD': 'schema2rst',                  # Not used with sqlite3.
+        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
+        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+    }
+}
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# On Unix systems, a value of None will cause Django to use the same
+# timezone as the operating system.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'Asia/Tokyo'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'ja-jp'
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = True
+
+# Absolute filesystem path to the directory that will hold user-uploaded files.
+# Example: "/home/media/media.lawrence.com/media/"
+MEDIA_ROOT = ''
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash.
+# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
+MEDIA_URL = ''
+
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+# Example: "/home/media/media.lawrence.com/static/"
+STATIC_ROOT = ''
+
+# URL prefix for static files.
+# Example: "http://media.lawrence.com/static/"
+STATIC_URL = '/static/'
+
+# URL prefix for admin static files -- CSS, JavaScript and images.
+# Make sure to use a trailing slash.
+# Examples: "http://foo.com/static/admin/", "/static/admin/".
+ADMIN_MEDIA_PREFIX = '/static/admin/'
+
+# Additional locations of static files
+STATICFILES_DIRS = (
+    # Put strings here, like "/home/html/static" or "C:/www/django/static".
+    # Always use forward slashes, even on Windows.
+    # Don't forget to use absolute paths, not relative paths.
+    os.path.join(PROJECT_DIR,'static'),
+)
+
+# List of finder classes that know how to find static files in
+# various locations.
+STATICFILES_FINDERS = (
+    'django.contrib.staticfiles.finders.FileSystemFinder',
+    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
+)
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = 'un-x&sffsq%a7@ejkpp@8^#azfvsq@y1cbiyyux6yd%1wq0rrv'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    'django.template.loaders.filesystem.Loader',
+    'django.template.loaders.app_directories.Loader',
+#     'django.template.loaders.eggs.Loader',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+)
+
+ROOT_URLCONF = 'app.urls'
+
+TEMPLATE_DIRS = (
+    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+    # Always use forward slashes, even on Windows.
+    # Don't forget to use absolute paths, not relative paths.
+)
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+    # Uncomment the next line to enable the admin:
+    # 'django.contrib.admin',
+    # Uncomment the next line to enable admin documentation:
+    # 'django.contrib.admindocs',
+    'schema2rst',
+    #
+    'openid',
+)
+
+# A sample logging configuration. The only tangible logging
+# performed by this configuration is to send an email to
+# the site admins on every HTTP 500 error.
+# See http://docs.djangoproject.com/en/dev/topics/logging for
+# more details on how to customize your logging configuration.
+LOGGING = {
+    'version': 1,
+    'disable_existing_loggers': False,
+    'handlers': {
+        'mail_admins': {
+            'level': 'ERROR',
+            'class': 'django.utils.log.AdminEmailHandler'
+        }
+    },
+    'loggers': {
+        'django.request': {
+            'handlers': ['mail_admins'],
+            'level': 'ERROR',
+            'propagate': True,
+        },
+    }
+}

File test/app/static/schema.html

+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
+<title>Schema: schema2rst</title>
+<style type="text/css">
+
+/*
+:Author: David Goodger (goodger@python.org)
+:Id: $Id: html4css1.css 7056 2011-06-17 10:50:48Z milde $
+:Copyright: This stylesheet has been placed in the public domain.
+
+Default cascading style sheet for the HTML output of Docutils.
+
+See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
+customize this style sheet.
+*/
+
+/* used to remove borders from tables and images */
+.borderless, table.borderless td, table.borderless th {
+  border: 0 }
+
+table.borderless td, table.borderless th {
+  /* Override padding for "table.docutils td" with "! important".
+     The right padding separates the table cells. */
+  padding: 0 0.5em 0 0 ! important }
+
+.first {
+  /* Override more specific margin styles with "! important". */
+  margin-top: 0 ! important }
+
+.last, .with-subtitle {
+  margin-bottom: 0 ! important }
+
+.hidden {
+  display: none }
+
+a.toc-backref {
+  text-decoration: none ;
+  color: black }
+
+blockquote.epigraph {
+  margin: 2em 5em ; }
+
+dl.docutils dd {
+  margin-bottom: 0.5em }
+
+object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
+  overflow: hidden;
+}
+
+/* Uncomment (and remove this text!) to get bold-faced definition list terms
+dl.docutils dt {
+  font-weight: bold }
+*/
+
+div.abstract {
+  margin: 2em 5em }
+
+div.abstract p.topic-title {
+  font-weight: bold ;
+  text-align: center }
+
+div.admonition, div.attention, div.caution, div.danger, div.error,
+div.hint, div.important, div.note, div.tip, div.warning {
+  margin: 2em ;
+  border: medium outset ;
+  padding: 1em }
+
+div.admonition p.admonition-title, div.hint p.admonition-title,
+div.important p.admonition-title, div.note p.admonition-title,
+div.tip p.admonition-title {
+  font-weight: bold ;
+  font-family: sans-serif }
+
+div.attention p.admonition-title, div.caution p.admonition-title,
+div.danger p.admonition-title, div.error p.admonition-title,
+div.warning p.admonition-title {
+  color: red ;
+  font-weight: bold ;
+  font-family: sans-serif }
+
+/* Uncomment (and remove this text!) to get reduced vertical space in
+   compound paragraphs.
+div.compound .compound-first, div.compound .compound-middle {
+  margin-bottom: 0.5em }
+
+div.compound .compound-last, div.compound .compound-middle {
+  margin-top: 0.5em }
+*/
+
+div.dedication {
+  margin: 2em 5em ;
+  text-align: center ;
+  font-style: italic }
+
+div.dedication p.topic-title {
+  font-weight: bold ;
+  font-style: normal }
+
+div.figure {
+  margin-left: 2em ;
+  margin-right: 2em }
+
+div.footer, div.header {
+  clear: both;
+  font-size: smaller }
+
+div.line-block {
+  display: block ;
+  margin-top: 1em ;
+  margin-bottom: 1em }
+
+div.line-block div.line-block {
+  margin-top: 0 ;
+  margin-bottom: 0 ;
+  margin-left: 1.5em }
+
+div.sidebar {
+  margin: 0 0 0.5em 1em ;
+  border: medium outset ;
+  padding: 1em ;
+  background-color: #ffffee ;
+  width: 40% ;
+  float: right ;
+  clear: right }
+
+div.sidebar p.rubric {
+  font-family: sans-serif ;
+  font-size: medium }
+
+div.system-messages {
+  margin: 5em }
+
+div.system-messages h1 {
+  color: red }
+
+div.system-message {
+  border: medium outset ;
+  padding: 1em }
+
+div.system-message p.system-message-title {
+  color: red ;
+  font-weight: bold }
+
+div.topic {
+  margin: 2em }
+
+h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
+h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
+  margin-top: 0.4em }
+
+h1.title {
+  text-align: center }
+
+h2.subtitle {
+  text-align: center }
+
+hr.docutils {
+  width: 75% }
+
+img.align-left, .figure.align-left, object.align-left {
+  clear: left ;
+  float: left ;
+  margin-right: 1em }
+
+img.align-right, .figure.align-right, object.align-right {
+  clear: right ;
+  float: right ;
+  margin-left: 1em }
+
+img.align-center, .figure.align-center, object.align-center {
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+.align-left {
+  text-align: left }
+
+.align-center {
+  clear: both ;
+  text-align: center }
+
+.align-right {
+  text-align: right }
+
+/* reset inner alignment in figures */
+div.align-right {
+  text-align: inherit }
+
+/* div.align-center * { */
+/*   text-align: left } */
+
+ol.simple, ul.simple {
+  margin-bottom: 1em }
+
+ol.arabic {
+  list-style: decimal }
+
+ol.loweralpha {
+  list-style: lower-alpha }
+
+ol.upperalpha {
+  list-style: upper-alpha }
+
+ol.lowerroman {
+  list-style: lower-roman }
+
+ol.upperroman {
+  list-style: upper-roman }
+
+p.attribution {
+  text-align: right ;
+  margin-left: 50% }
+
+p.caption {
+  font-style: italic }
+
+p.credits {
+  font-style: italic ;
+  font-size: smaller }
+
+p.label {
+  white-space: nowrap }
+
+p.rubric {
+  font-weight: bold ;
+  font-size: larger ;
+  color: maroon ;
+  text-align: center }
+
+p.sidebar-title {
+  font-family: sans-serif ;
+  font-weight: bold ;
+  font-size: larger }
+
+p.sidebar-subtitle {
+  font-family: sans-serif ;
+  font-weight: bold }
+
+p.topic-title {
+  font-weight: bold }
+
+pre.address {
+  margin-bottom: 0 ;
+  margin-top: 0 ;
+  font: inherit }
+
+pre.literal-block, pre.doctest-block, pre.math {
+  margin-left: 2em ;
+  margin-right: 2em }
+
+span.classifier {
+  font-family: sans-serif ;
+  font-style: oblique }
+
+span.classifier-delimiter {
+  font-family: sans-serif ;
+  font-weight: bold }
+
+span.interpreted {
+  font-family: sans-serif }
+
+span.option {
+  white-space: nowrap }
+
+span.pre {
+  white-space: pre }
+
+span.problematic {
+  color: red }
+
+span.section-subtitle {
+  /* font-size relative to parent (h1..h6 element) */
+  font-size: 80% }
+
+table.citation {
+  border-left: solid 1px gray;
+  margin-left: 1px }
+
+table.docinfo {
+  margin: 2em 4em }
+
+table.docutils {
+  margin-top: 0.5em ;
+  margin-bottom: 0.5em }
+
+table.footnote {
+  border-left: solid 1px black;
+  margin-left: 1px }
+
+table.docutils td, table.docutils th,
+table.docinfo td, table.docinfo th {
+  padding-left: 0.5em ;
+  padding-right: 0.5em ;
+  vertical-align: top }
+
+table.docutils th.field-name, table.docinfo th.docinfo-name {
+  font-weight: bold ;
+  text-align: left ;
+  white-space: nowrap ;
+  padding-left: 0 }
+
+h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
+h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
+  font-size: 100% }
+
+ul.auto-toc {
+  list-style-type: none }
+
+</style>
+</head>
+<body>
+<div class="document" id="schema-schema2rst">
+<h1 class="title">Schema: schema2rst</h1>
+
+<div class="section" id="auth-group">
+<h1>auth_group</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>name</td>
+<td>name</td>
+<td>varchar(80)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="keys">
+<h2>Keys</h2>
+<ul class="simple">
+<li>UNIQUE KEY: name (name)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="auth-group-permissions">
+<h1>auth_group_permissions</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>group_id</td>
+<td>group_id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>permission_id</td>
+<td>permission_id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id1">
+<h2>Keys</h2>
+<ul class="simple">
+<li>UNIQUE KEY: group_id (group_id, permission_id)</li>
+<li>KEY: auth_group_permissions_bda51c3c (group_id)</li>
+<li>KEY: auth_group_permissions_1e014c8f (permission_id)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="auth-message">
+<h1>auth_message</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>user_id</td>
+<td>user_id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>message</td>
+<td>message</td>
+<td>longtext</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id2">
+<h2>Keys</h2>
+<ul class="simple">
+<li>KEY: auth_message_fbfc09f1 (user_id)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="auth-permission">
+<h1>auth_permission</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>name</td>
+<td>name</td>
+<td>varchar(50)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>content_type_id</td>
+<td>content_type_id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>codename</td>
+<td>codename</td>
+<td>varchar(100)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id3">
+<h2>Keys</h2>
+<ul class="simple">
+<li>UNIQUE KEY: content_type_id (content_type_id, codename)</li>
+<li>KEY: auth_permission_e4470c6e (content_type_id)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="auth-user">
+<h1>auth_user</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>username</td>
+<td>username</td>
+<td>varchar(30)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>first_name</td>
+<td>first_name</td>
+<td>varchar(30)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>last_name</td>
+<td>last_name</td>
+<td>varchar(30)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>email</td>
+<td>email</td>
+<td>varchar(75)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>password</td>
+<td>password</td>
+<td>varchar(128)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>is_staff</td>
+<td>is_staff</td>
+<td>tinyint(1)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>is_active</td>
+<td>is_active</td>
+<td>tinyint(1)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>is_superuser</td>
+<td>is_superuser</td>
+<td>tinyint(1)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>last_login</td>
+<td>last_login</td>
+<td>datetime</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>date_joined</td>
+<td>date_joined</td>
+<td>datetime</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id4">
+<h2>Keys</h2>
+<ul class="simple">
+<li>UNIQUE KEY: username (username)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="auth-user-groups">
+<h1>auth_user_groups</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>user_id</td>
+<td>user_id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>group_id</td>
+<td>group_id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id5">
+<h2>Keys</h2>
+<ul class="simple">
+<li>UNIQUE KEY: user_id (user_id, group_id)</li>
+<li>KEY: auth_user_groups_fbfc09f1 (user_id)</li>
+<li>KEY: auth_user_groups_bda51c3c (group_id)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="auth-user-user-permissions">
+<h1>auth_user_user_permissions</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>user_id</td>
+<td>user_id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>permission_id</td>
+<td>permission_id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id6">
+<h2>Keys</h2>
+<ul class="simple">
+<li>UNIQUE KEY: user_id (user_id, permission_id)</li>
+<li>KEY: auth_user_user_permissions_fbfc09f1 (user_id)</li>
+<li>KEY: auth_user_user_permissions_1e014c8f (permission_id)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="django-content-type">
+<h1>django_content_type</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>name</td>
+<td>name</td>
+<td>varchar(100)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>app_label</td>
+<td>app_label</td>
+<td>varchar(100)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>model</td>
+<td>model</td>
+<td>varchar(100)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id7">
+<h2>Keys</h2>
+<ul class="simple">
+<li>UNIQUE KEY: app_label (app_label, model)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="django-session">
+<h1>django_session</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>session_key</td>
+<td>session_key</td>
+<td>varchar(40)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>session_data</td>
+<td>session_data</td>
+<td>longtext</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>expire_date</td>
+<td>expire_date</td>
+<td>datetime</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id8">
+<h2>Keys</h2>
+<ul class="simple">
+<li>KEY: django_session_c25c2c28 (expire_date)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="django-site">
+<h1>django_site</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>domain</td>
+<td>domain</td>
+<td>varchar(100)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>name</td>
+<td>name</td>
+<td>varchar(50)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="section" id="openid-openid">
+<h1>openid_openid</h1>
+<table border="1" class="docutils">
+<colgroup>
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+<col width="14%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Fullname</th>
+<th class="head">Name</th>
+<th class="head">Type</th>
+<th class="head">NOT NULL</th>
+<th class="head">PKey</th>
+<th class="head">Default</th>
+<th class="head">Comment</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>id</td>
+<td>id</td>
+<td>int(11)</td>
+<td>False</td>
+<td>True</td>
+<td>None</td>
+<td>auto_increment</td>
+</tr>
+<tr><td>user_id</td>
+<td>user_id</td>
+<td>int(11)</td>
+<td>True</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>openid</td>
+<td>openid</td>
+<td>varchar(255)</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>dt_created</td>
+<td>dt_created</td>
+<td>datetime</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+<tr><td>dt_updated</td>
+<td>dt_updated</td>
+<td>datetime</td>
+<td>False</td>
+<td>False</td>
+<td>None</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id9">
+<h2>Keys</h2>
+<ul class="simple">
+<li>KEY: openid_openid_fbfc09f1 (user_id)</li>
+</ul>
+</div>
+</div>
+</div>
+</body>
+</html>

File test/app/static/schema.rst

+
+Schema: schema2rst
+==================
+
+
+auth_group
+----------
+
+.. list-table::
+   :header-rows: 1
+
+   * - Fullname
+     - Name
+     - Type
+     - NOT NULL
+     - PKey
+     - Default
+     - Comment
+   * - id
+     - id
+     - int(11)
+     - False
+     - True
+     - None
+     - auto_increment
+   * - name
+     - name
+     - varchar(80)
+     - False
+     - False
+     - None
+     - 
+
+Keys
+^^^^
+
+* UNIQUE KEY: name (name)
+
+auth_group_permissions
+----------------------
+
+.. list-table::
+   :header-rows: 1
+
+   * - Fullname
+     - Name
+     - Type
+     - NOT NULL
+     - PKey
+     - Default
+     - Comment
+   * - id
+     - id
+     - int(11)
+     - False
+     - True
+     - None
+     - auto_increment
+   * - group_id
+     - group_id
+     - int(11)
+     - False
+     - False
+     - None
+     - 
+   * - permission_id
+     - permission_id
+     - int(11)
+     - False
+     - False
+     - None
+     - 
+
+Keys
+^^^^
+
+* UNIQUE KEY: group_id (group_id, permission_id)
+* KEY: auth_group_permissions_bda51c3c (group_id)
+* KEY: auth_group_permissions_1e014c8f (permission_id)
+
+auth_message
+------------
+
+.. list-table::
+   :header-rows: 1
+
+   * - Fullname
+     - Name
+     - Type
+     - NOT NULL
+     - PKey
+     - Default
+     - Comment
+   * - id
+     - id
+     - int(11)
+     - False
+     - True
+     - None
+     - auto_increment
+   * - user_id
+     - user_id
+     - int(11)
+     - False
+     - False
+     - None
+     - 
+   * - message
+     - message
+     - longtext
+     - False
+     - False
+     - None
+     - 
+
+Keys
+^^^^
+
+* KEY: auth_message_fbfc09f1 (user_id)
+
+auth_permission
+---------------
+
+.. list-table::
+   :header-rows: 1
+
+   * - Fullname
+     - Name
+     - Type
+     - NOT NULL
+     - PKey
+     - Default
+     - Comment
+   * - id
+     - id
+     - int(11)
+     - False
+     - True
+     - None
+     - auto_increment
+   * - name
+     - name
+     - varchar(50)
+     - False
+     - False
+     - None
+     - 
+   * - content_type_id
+     - content_type_id
+     - int(11)
+     - False
+     - False
+     - None
+     - 
+   * - codename
+     - codename
+     - varchar(100)
+     - False
+     - False
+     - None
+     - 
+
+Keys
+^^^^
+
+* UNIQUE KEY: content_type_id (content_type_id, codename)
+* KEY: auth_permission_e4470c6e (content_type_id)
+
+auth_user
+---------
+
+.. list-table::
+   :header-rows: 1
+
+   * - Fullname
+     - Name
+     - Type
+     - NOT NULL
+     - PKey
+     - Default
+     - Comment
+   * - id
+     - id
+     - int(11)
+     - False
+     - True
+     - None
+     - auto_increment
+   * - username
+     - username
+     - varchar(30)
+     - False
+     - False
+     - None
+     - 
+   * - first_name
+     - first_name
+     - varchar(30)
+     - False
+     - False
+     - None
+     - 
+   * - last_name
+     - last_name
+     - varchar(30)
+     - False
+     - False
+     - None
+     - 
+   * - email
+     - email
+     - varchar(75)
+     - False
+     - False
+     - None
+     - 
+   * - password
+     - password
+     - varchar(128)
+     - False
+     - False
+     - None
+     - 
+   * - is_staff
+     - is_staff
+     - tinyint(1)
+     - False
+     - False
+     - None
+     - 
+   * - is_active
+     - is_active
+     - tinyint(1)
+     - False
+     - False
+     - None
+     - 
+   * - is_superuser
+     - is_superuser
+     - tinyint(1)
+     - False
+     - False
+     - None
+     - 
+   * - last_login
+     - last_login
+     - datetime
+     - False
+     - False
+     - None
+     - 
+   * - date_joined
+     - date_joined
+     - datetime
+     - False
+     - False
+     - None
+     - 
+
+Keys
+^^^^
+
+* UNIQUE KEY: username (username)
+
+auth_user_groups
+----------------
+
+.. list-table::
+   :header-rows: 1
+
+   * - Fullname
+     - Name
+     - Type
+     - NOT NULL
+     - PKey
+     - Default
+     - Comment
+   * - id
+     - id
+     - int(11)
+     - False
+     - True
+     - None
+     - auto_increment
+   * - user_id
+     - user_id
+     - int(11)
+     - False
+     - False
+     - None
+     - 
+   * - group_id
+     - group_id
+     - int(11)
+     - False
+     - False
+     - None
+     - 
+
+Keys
+^^^^
+
+* UNIQUE KEY: user_id (user_id, group_id)
+* KEY: auth_user_groups_fbfc09f1 (user_id)
+* KEY: auth_user_groups_bda51c3c (group_id)
+
+auth_user_user_permissions
+--------------------------
+
+.. list-table::
+   :header-rows: 1
+
+   * - Fullname
+     - Name
+     - Type
+     - NOT NULL
+     - PKey
+     - Default
+     - Comment
+   * - id
+     - id
+     - int(11)
+     - False
+     - True
+     - None
+     - auto_increment
+   * - user_id
+     - user_id
+     - int(11)
+     - False
+     - False
+     - None
+     - 
+   * - permission_id
+     - permission_id
+     - int(11)
+     - False
+     - False
+     - None
+     - 
+
+Keys
+^^^^
+
+* UNIQUE KEY: user_id (user_id, permission_id)
+* KEY: auth_user_user_permissions_fbfc09f1 (user_id)
+* KEY: auth_user_user_permissions_1e014c8f (permission_id)
+
+django_content_type
+-------------------
+
+.. list-table::
+   :header-rows: 1
+
+   * - Fullname
+     - Name
+     - Type
+     - NOT NULL
+     - PKey
+     - Default
+     - Comment
+   * - id
+     - id
+     - int(11)
+     - False
+     - True
+     - None
+     - auto_increment
+   * - name
+     - name
+     - varchar(100)
+     - False
+     - False
+     - None
+     - 
+   * - app_label
+     - app_label
+     - varchar(100)
+     - False
+     - False
+     - None
+     - 
+   * - model
+     - model