librelist archives

« back to archive

Third-Party Themes

Third-Party Themes

From:
Greg Lindstrom
Date:
2014-06-11 @ 15:23
I have written a nifty utility to use at work and would like to download
and use a third-party theme but, for the life of me, can not figure out how
to do it.  I have downloaded two files, bootstrap.css and bootstrap-min.css
and am told to replace "the existing files".  I was hoping that I could
define a path so I wouldn't have to replace existing library files, but am
stumped.

Can someone help me with this or point me to documentation?  I've been
looking for the past couple of days and haven't found anything simple
enough for this old dog to understand.

Thanks,
Greg Lindstrom
Little Rock, Arkansas

Re: [flask] Third-Party Themes

From:
Brad Porter
Date:
2014-06-11 @ 17:37
So you have a couple of options for using bootstrap. One would just be
to place the required CSS / JavaScript in their respective static
folders and link to them in the HTML template.

Your file structure would look like this:
<flask_dir>/static/css/bootstrap.min.css
<flask_dir>/static/js/bootstrap.min.js

Then in the template you would have some code like:
<script type='text/javascript' src="/static/js/bootstrap.min.js"></script>
<link href="/static/css/bootstrap.min.css" rel="stylesheet" media="screen">

Then you would of course have to make the proper HTML modifications to
have the template utilize the bootstrap theme you are wanting.

I found the following tutorial useful for this type of implementation:

http://www.realpython.com/blog/design/getting-started-with-bootstrap-3/

The alternative is to use the Flask-Bootstrap addon:
http://pythonhosted.org/Flask-Bootstrap/

On 6/11/14, 8:23 AM, Greg Lindstrom wrote:
> I have written a nifty utility to use at work and would like to download
> and use a third-party theme but, for the life of me, can not figure out
> how to do it.  I have downloaded two files, bootstrap.css and
> bootstrap-min.css and am told to replace "the existing files".  I was
> hoping that I could define a path so I wouldn't have to replace existing
> library files, but am stumped.
> 
> Can someone help me with this or point me to documentation?  I've been
> looking for the past couple of days and haven't found anything simple
> enough for this old dog to understand.
> 
> Thanks,
> Greg Lindstrom
> Little Rock, Arkansas

-- 
Brad Porter
Threat Intelligence Analyst
Internet Identity
E-mail: brad.porter@internetidentity.com