Paul's Programming Notes     Archive     Feed     Github

Change Home Flask-Admin

This was the only thing I was able to get working:

Just putting index.html into an admin/ directory wouldn't work.

There's also an even shorter way to do it, for example:
admin = Admin(app, "G-Cal Manager", index_view=AdminIndexView(name='Home', template='admin/home.html', url='/'))

The example above will change the root url to / instead of /admin and it will use home.html from your templates/admin folder.

To fix the 404 errors on your stylesheets after the change, you will also need to change the static_folder in your flask object:
app = Flask(__name__, static_folder='admin')

Clone/Copy Table Schema From One Database To Another - SQLalchemy

I got the following code from slide 36 of this slideshow:

SQLalchemy - Print Tables In Database (Show Tables)

from sqlalchemy import create_engine, Table, MetaData

engine = create_engine('mysql+mysqldb://username:password@')
metadata = MetaData(bind=engine)
print metadata.tables.keys()

You could also use that for looping through a list of the tables in the database.

Best VNC Installation Guide

That guide gave me the least amount of hassle when I installed VNC on a server. I started by trying to get it working with 13.10, but had issues with a grey screen when tightvnc connected.