Paul's Programming Notes     Archive     Feed     Github

Change Home Flask-Admin

This was the only thing I was able to get working: http://www.marteinn.se/blog/?p=637

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: http://www.slideshare.net/Stiivi/python-business-intelligence-pydata-2012-talk

SQLalchemy - Print Tables In Database (Show Tables)

from sqlalchemy import create_engine, Table, MetaData

engine = create_engine('mysql+mysqldb://username:password@111.111.111.111/databaseName')
metadata = MetaData(bind=engine)
metadata.reflect(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

https://wiki.amahi.org/index.php/Install_VNC_server_on_Ubuntu_Server_12.04

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.