gaw89 / dash-flask-login

A plugin to integrate Dash and Flask-Login
MIT License
56 stars 17 forks source link

Customize templates (default_login.html) #6

Open xapple opened 6 years ago

xapple commented 6 years ago

Hi,

First of all, great app, it works a charm.

I was just wondering, what is the best way to use my own template instead of the file default_login.html?

I see you call render_template('default_login.html') in several places.

I could override the file in the install directory of the dash-flask-login module, but that would only work locally, not when deploying to heroku.

Thanks.

xapple commented 6 years ago

An ugly solution but that works for prototyping purposes:

import os, shutil, mycoolapp, dash_flask_login
new = os.path.dirname(mycoolapp.__file__) + '/assets/login.html'
old = os.path.dirname(dash_flask_login.__file__) + '/templates/default_login.html'
shutil.copyfile(new, old)
gaw89 commented 6 years ago

@xapple I will look into an elegant fix for this very soon. Will post back here with the solution.