<?xml version="1.0"?>
<News hasArchived="true" page="8925" pageCount="10710" pageSize="10" timestamp="Tue, 30 Jun 2026 04:15:37 -0400" url="https://my3.my.umbc.edu/posts.xml?page=8925">
<NewsItem contentIssues="true" id="123418" important="false" status="posted" url="https://my3.my.umbc.edu/posts/123418">
<Title>Jones &#8217;06, social work, on Hrabowski as Role Model</Title>
<Body>
<![CDATA[
    <div class="html-content">
    <img width="150" height="150" src="https://umbc.edu/wp-content/uploads/2013/05/jones_subimage1-150x150.jpg" alt="" style="max-width: 100%; height: auto;"><p><a href="http://umbcalumni.files.wordpress.com/2011/09/jones_subimage1.jpg" rel="nofollow external" class="bo"><img src="http://umbcalumni.files.wordpress.com/2011/09/jones_subimage1.jpg" alt="jones_subimage1" width="250" height="329" style="max-width: 100%; height: auto;"></a>In a Q&amp;A with <em>City Biz List</em>, <strong>Joseph T. Jones ’06, social work</strong>, CEO of The Center for Urban Families, shares some of the challenges of his childhood years, and some of the secrets to his success in the non-profit sector, including a mentor relationship with UMBC president <strong>Freeman A. Hrabowski, III</strong>. Jones founded CFUF, a non-profit organization that connects men and women to career paths and strengthens their families, in 1999.</p>
    <p>As he tells <em>City Biz List</em>:</p>
    <blockquote><p>I met Freeman at an event that I was speaking at in 2004 about education, father absence, and my personal story. After the talk, Freeman came up to me and asked why I never went back to school. I started making excuses and I had heard about Freeman but really didn’t know much about him; just that he has a really booming voice and presence. So he said that he wanted me in his office the next day. I go to his office and this man, in about 15 minutes, completely dresses me down—the way in which a father would dress down a son when he is not realizing his potential. I had no intention of going back to school; focusing my additional years on this earth in an academic institution was the furthest thing from my mind. I really don’t even know what the hell happened but the next thing you know I’m sitting in a class. Two years later, I graduated from UMBC cum laude. I would not have done that without him.</p></blockquote>
    <p><a href="http://baltimore.citybizlist.com/article/qa-joe-jones-founder-and-ceo-center-urban-families?goback=.gde_86715_member_224214192" rel="nofollow external" class="bo">Read the full Q&amp;A here.</a></p>
    <p><a href="https://umbcmagazine.wordpress.com/umbc-magazine-fall-2011/striving-to-make-a-difference/" rel="nofollow external" class="bo">Read an interview with Jones from <em>UMBC Magazine</em> here.</a></p>
    </div>
]]>
</Body>
<Summary>In a Q&amp;A with City Biz List, Joseph T. Jones ’06, social work, CEO of The Center for Urban Families, shares some of the challenges of his childhood years, and some of the secrets to his...</Summary>
<Website>https://umbc.edu/stories/jones-06-social-work-on-hrabowski-as-role-model/</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/123418/guest@my.umbc.edu/f942facd3cc3fe3d8a6b7a23151f6a33/api/pixel</TrackingUrl>
<Tag>alumni</Tag>
<Group token="umbc-news-magazine">UMBC News &amp;amp; Magazine</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/umbc-news-magazine</GroupUrl>
<AvatarUrl>https://assets1-my.umbc.edu/system/shared/avatars/groups/000/001/943/24435aa6207c452e7bc15cc74b42c7bb/xsmall.png?1748556657</AvatarUrl>
<AvatarUrl size="original">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/001/943/24435aa6207c452e7bc15cc74b42c7bb/original.png?1748556657</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets2-my.umbc.edu/system/shared/avatars/groups/000/001/943/24435aa6207c452e7bc15cc74b42c7bb/xxlarge.png?1748556657</AvatarUrl>
<AvatarUrl size="xlarge">https://assets2-my.umbc.edu/system/shared/avatars/groups/000/001/943/24435aa6207c452e7bc15cc74b42c7bb/xlarge.png?1748556657</AvatarUrl>
<AvatarUrl size="large">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/001/943/24435aa6207c452e7bc15cc74b42c7bb/large.png?1748556657</AvatarUrl>
<AvatarUrl size="medium">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/001/943/24435aa6207c452e7bc15cc74b42c7bb/medium.png?1748556657</AvatarUrl>
<AvatarUrl size="small">https://assets2-my.umbc.edu/system/shared/avatars/groups/000/001/943/24435aa6207c452e7bc15cc74b42c7bb/small.png?1748556657</AvatarUrl>
<AvatarUrl size="xsmall">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/001/943/24435aa6207c452e7bc15cc74b42c7bb/xsmall.png?1748556657</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets2-my.umbc.edu/system/shared/avatars/groups/000/001/943/24435aa6207c452e7bc15cc74b42c7bb/xxsmall.png?1748556657</AvatarUrl>
<Sponsor>UMBC News &amp; Magazine</Sponsor>
<PawCount>0</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>false</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 20:15:45 -0400</PostedAt>
</NewsItem>

<NewsItem contentIssues="true" id="26620" important="false" status="posted" url="https://my3.my.umbc.edu/posts/26620">
<Title>talk: The Problem with Print: publishing born digital scholarship</Title>
<Body>
<![CDATA[
    <div class="html-content">
    <p><a href="http://www.csee.umbc.edu/wp-content/uploads/2013/03/burgess.png" rel="nofollow external" class="bo"><img alt="" height="142" src="http://www.csee.umbc.edu/wp-content/uploads/2013/03/burgess.png" width="700" style="max-width: 100%; height: auto;"></a></p>
    <p><span>The Problem with Print: publishing born digital scholarship</span></p>
    <p><span>Professor Helen J. Burgess<br>
    	Department of English, UMBC</span></p>
    <p><span>4:00pm Monday, 25 March 2013<br>
    	7th Floor, A. O. Kuhn Library</span></p>
    <p>Dr. Burgess will discuss some of the difficulties for academics seeking to work and publish outside traditional "print-bound" models of humanities scholarship – including issues of professional evaluation and distribution – and show some examples of "born digital" works that would benefit from a new model of publishing. A reception, sponsored by the Libby Kuhn Endowment Fund, will follow the program.</p>
    <p><a href="http://www.umbc.edu/english/faculty/burgess.html" rel="nofollow external" class="bo">Helen J. Burgess</a> is an Assistant Professor of English in the Communication and Technology track. Dr Burgess received her BA(Hons) and MA(Dist.) in English Language and Literature from Victoria University of Wellington, in New Zealand, and her PhD in English from West Virginia University. She is active in the new media research community as editor of the online journal <a href="http://www.hyperrhiz.net/" rel="nofollow external" class="bo">Hyperrhiz: new Media Cultures</a>, and technical editor of <a href="http://rhizomes.net/" rel="nofollow external" class="bo">Rhizomes: Cultural Studies in Emerging Knowledge</a>. Dr Burgess is coauthor of Red Planet: Scientific and Cultural Enounters with Mars and Biofutures: Owning Body Parts and Information, both titles published in the Mariner10 interactive DVD-Rom series at the University of Pennsylvania Press. She has interests in multimedia and web development, open source and open content production, electronic literature, and science fiction.</p>
    </div>
]]>
</Body>
<Summary>The Problem with Print: publishing born digital scholarship   Professor Helen J. Burgess   Department of English, UMBC   4:00pm Monday, 25 March 2013   7th Floor, A. O. Kuhn Library   Dr. Burgess...</Summary>
<Website>http://www.csee.umbc.edu/2013/03/talk-the-problem-with-print-publishing-born-digital-scholarship/</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/26620/guest@my.umbc.edu/a0ed758411aaca30c7f68d61ea23e68f/api/pixel</TrackingUrl>
<Tag>news</Tag>
<Tag>talks</Tag>
<Group token="csee">Computer Science and Electrical Engineering</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/csee</GroupUrl>
<AvatarUrl>https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/099/d117dca133c64bf78a4b7696dd007189/xsmall.png?1314043393</AvatarUrl>
<AvatarUrl size="original">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/000/099/d117dca133c64bf78a4b7696dd007189/original.png?1314043393</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/000/099/d117dca133c64bf78a4b7696dd007189/xxlarge.png?1314043393</AvatarUrl>
<AvatarUrl size="xlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/099/d117dca133c64bf78a4b7696dd007189/xlarge.png?1314043393</AvatarUrl>
<AvatarUrl size="large">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/099/d117dca133c64bf78a4b7696dd007189/large.png?1314043393</AvatarUrl>
<AvatarUrl size="medium">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/000/099/d117dca133c64bf78a4b7696dd007189/medium.png?1314043393</AvatarUrl>
<AvatarUrl size="small">https://assets2-my.umbc.edu/system/shared/avatars/groups/000/000/099/d117dca133c64bf78a4b7696dd007189/small.png?1314043393</AvatarUrl>
<AvatarUrl size="xsmall">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/099/d117dca133c64bf78a4b7696dd007189/xsmall.png?1314043393</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/099/d117dca133c64bf78a4b7696dd007189/xxsmall.png?1314043393</AvatarUrl>
<Sponsor>Computer Science and Electrical Engineering</Sponsor>
<PawCount>1</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>true</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 18:24:17 -0400</PostedAt>
</NewsItem>

<NewsItem contentIssues="false" id="26619" important="false" status="posted" url="https://my3.my.umbc.edu/posts/26619">
<Title>There&#8217;s more to the CSS rem unit than font sizing</Title>
<Body>
<![CDATA[
    <div class="html-content">
    <p><em>The following is a guest post by Roman Rudenko, a mad scientist at <a href="http://www.mobify.com/" rel="nofollow external" class="bo">Mobify</a> where he’s tasked with understanding why browsers misbehave and with cajoling them into playing nice. When he’s not coding, Roman is learning to ride a motorbike without crashing into too many solid objects.</em></p>
    <p>Many web designers and developers are familiar with the CSS <code>rem</code> <a href="http://css-tricks.com/the-lengths-of-css/" rel="nofollow external" class="bo">length</a> unit. But, you may not know that it has a couple of handy alternate uses. In this post, I’ll describe how to use the CSS <code>rem</code> unit to scale specific page elements while leaving others unaffected. I’ll also discuss how to use it as a replacement for the under-supported <code>vw</code> (viewporth width) unit.</p>
    <p>For readers unfamiliar with the <code>rem</code> unit (standing for "root em"), it provides a way to specify lengths as fractions of the root element’s font size. In practical terms, this almost always means the font size of the <code>&lt;html&gt;</code> element. The most obvious use for <code>rem</code> is replacing <code>em</code> to protect inner element font sizes from being changed by outer elements, thus avoiding the classic nested <code>em</code> scaling problem. But <code>rem</code> effectively operates as a custom adjustable unit, so it can be useful for other things too. </p>
    <p>First, let’s look at how <code>rem</code> works and how it differs from the <code>em</code> unit. An <code>em</code> value is calculated against the <code>font-size</code> of a current element, so boxes sized with it will consequently scale as font sizes are adjusted by the element or its ancestors. Meanwhile, <code>rem</code> is defined as the <code>font-size</code> of the root element. So, all references to <code>rem</code> will return the same value, regardless of ancestor font size. In effect, <code>rem</code> is a document-wide CSS variable. Browser support for <code>rem</code> is quite good these days. It’s limited on desktop because IE8 does not support it, but common mobile and tablet browsers handle it much better.</p>
    <p>Rem can be used for its typical font sizing duty. When markup nests in complex ways, <code>font-size</code> declarations with <code>em</code> values may compound unexpectedly, and <code>rem</code> is a good choice for untangling those issues. However, there are some other interesting uses of <code>rem</code>.</p>
    <h3>Scaling document elements</h3>
    <p>You can use <code>rem</code> to scale some elements in a document while leaving others in place. In this example, the <code>font-size</code> of secondary page content (slideshow controls, illustration names, post metadata) is controlled via <code>rem</code>, but the primary content remains sized in pixels.</p>
    <pre><a href="http://codepen.io/romanrudenko/pen/wqisa" rel="nofollow external" class="bo">Check out this Pen!</a></pre>
    <p>When one of the red size adjustment links is clicked, a small piece of JavaScript adjusts <code>&lt;html&gt;</code> <code>font-size</code>, resizing secondary elements without altering primary ones.</p>
    <p>This style of sizing can be useful for user-driven customization, or to adapt layouts for cases that require secondary elements to be more touchable (tablet) or visible (TV). Without <code>rem</code>, every adjustable element would have to be resized separately.</p>
    <pre><code>/* States */&#x000A;    html.secondary-12px { font-size: 12px; }&#x000A;    html.secondary-14px { font-size: 14px; }&#x000A;    html.secondary-16px { font-size: 16px; }&#x000A;    &#x000A;    /* Primary content stays fixed */&#x000A;    body { font-size: 18px; }&#x000A;    &#x000A;    /* Secondary content scales */&#x000A;    .post-inner .meta { font-size: 1rem; }&#x000A;    .figure .title { font-size: 1rem; }&#x000A;    .slideshow .controls { font-size: 1.25rem; }&#x000A;    .slideshow .controls a { padding: 0 0.5rem; }</code></pre>
    <h3>Replacement for vw</h3>
    <p>The CSS <a href="http://css-tricks.com/viewport-sized-typography/" rel="nofollow external" class="bo">vw unit</a> is defined as 1/100th of viewport width. This unit is useful for avoiding compounding in width calculations, just as <code>rem</code> avoids <code>font-size</code> multiplier compounding. It can also be used for non-width properties, such as <code>font-size </code>(fitting a fixed fragment of text into a percentage-sized box) or height (preserving element aspect ratio). <a href="http://caniuse.com/viewport-units" rel="nofollow external" class="bo">Support for vw</a> is still spotty. So, we can use rem instead and dynamically recalculate <code>&lt;html&gt;</code> font size to match <code>vw</code> unit size.</p>
    <p>Let’s have a look at an example implementation for this workaround (resize browser to see adjustments):</p>
    <pre><a href="http://codepen.io/romanrudenko/pen/GrqcI" rel="nofollow external" class="bo">Check out this Pen!</a></pre>
    <pre><code>body { font-size: 12px; margin: 0; padding: 0;}&#x000A;    .one, .two {&#x000A;      border: solid #666;&#x000A;      border-width: 10px; border-width: 0.01rem;   /* 1vw */&#x000A;      border-radius: 30px; border-radius: 0.03rem; /* 3vw */&#x000A;      font-size: 20px; font-size: 0.02rem;         /* 2vw */&#x000A;      padding: 20px; padding: 0.02rem;             /* 2vw */&#x000A;    }</code></pre>
    <p>Here, the <code>&lt;body&gt;</code> element <code>font-size</code> rule insulates content from changes in <code>&lt;html&gt;</code> <code>font-size</code>. Browsers that don’t understand <code>rem</code> are given a pixel-based fallback; browsers that do know <code>rem</code> derive the proper dimension from <code>&lt;html&gt;</code> font size. </p>
    <p><small>An earlier version of this example allowed browsers that recognize the vw property to use it directly, but that was pulled after Chrome 25 failed to apply a border width specified with vw. Rem-based ersatz replacement had no such issue.</small></p>
    <p>It was possible to do all of this before the <code>rem</code> unit was available by computing and assigning properties directly with JavaScript. But, <code>rem</code> makes things much easier. With <code>rem</code>, there’s only one assignment to make for the entire document, and the script doesn’t need to remember which properties should be scaled in what exact manner.</p>
    <pre><code>(function (doc, win) {&#x000A;        var docEl = doc.documentElement,&#x000A;            recalc = function () {&#x000A;                var clientWidth = docEl.clientWidth;&#x000A;                if (!clientWidth) return;&#x000A;    &#x000A;                docEl.style.fontSize = clientWidth + 'px';&#x000A;                docEl.style.display = "none";&#x000A;                docEl.clientWidth; // Force relayout - important to new Android devices&#x000A;                docEl.style.display = "";&#x000A;            };&#x000A;    &#x000A;        // Abort if browser does not support addEventListener&#x000A;        if (!doc.addEventListener) return;&#x000A;    &#x000A;        // Test rem support&#x000A;        var div = doc.createElement('div');&#x000A;        div.setAttribute('style', 'font-size: 1rem');&#x000A;    &#x000A;        // Abort if browser does not recognize rem&#x000A;        if (div.style.fontSize != "1rem") return;&#x000A;    &#x000A;        win.addEventListener('resize', recalc, false);&#x000A;        doc.addEventListener('DOMContentLoaded', recalc, false);&#x000A;    })(document, window);</code></pre>
    <p>There are a few things to note in the above JavaScript. First, the script will terminate early if the browser is out-of-date and doesn’t support the <code>addEventListener</code> API or the <code>rem</code> unit itself. Second, instead of setting <code>&lt;html&gt;</code> font size to an actual <code>vw</code> unit, it’s set to the viewport width in pixels. This means the CSS would need to scale <code>vw</code> values by a factor of 100 for use with <code>rem</code>, but avoids rounding bugs that would otherwise arise due to the limited <code>font-size</code> precision in Webkit.</p>
    <p>Other viewport units can be supported in pretty much the same way. There are downsides to this approach. For instance, you can’t use <code>rem</code> for other purposes. And, you can only make use of one viewport unit (<code>vw</code>) at a time and so can’t use others like <code>vh</code>, <code>vmin</code>, or <code>vmax</code>.</p>
    <p>While almost no production browser today supports true CSS variables, quite a few let you cheat a bit and get one in the form of the <code>rem</code> unit. If you don’t need to use <code>rem</code> for normal font sizing, you can use it for runtime scaling of pretty much anything. If you must use <code>rem</code> for font sizing, you have the option of using CSS preprocessors (Sass or Less) to compute proper font dimensions, leaving the rem unit free for runtime trickery.</p>
    <p><small>The CSS-Tricks feed is sponsored by Wufoo, the best online form builder there is. I use it on every project I've done as long as I've been a web worker. Quickly build any type of form you need, from the humble contact form to the epic multi-page, logic-riddled, mobile-friendly, custom-designed, spam-protected, payment-taking super form. <a href="http://www.wufoo.com/?utm_source=csstricks&amp;utm_medium=ppc&amp;cmpid=brand&amp;utm_network=d&amp;utm_term=csstricksrss" rel="nofollow external" class="bo">Try Wufoo for free today!</a></small></p>
    
    <p><small><a href="http://css-tricks.com/theres-more-to-the-css-rem-unit-than-font-sizing/" rel="nofollow external" class="bo">There’s more to the CSS rem unit than font sizing</a> is a post from <a href="http://css-tricks.com" rel="nofollow external" class="bo">CSS-Tricks</a></small></p>
    </div>
]]>
</Body>
<Summary>The following is a guest post by Roman Rudenko, a mad scientist at Mobify where he’s tasked with understanding why browsers misbehave and with cajoling them into playing nice. When he’s not...</Summary>
<Website>http://css-tricks.com/theres-more-to-the-css-rem-unit-than-font-sizing/</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/26619/guest@my.umbc.edu/ec8bd18b26ac0659285ce6990d161dbf/api/pixel</TrackingUrl>
<Tag>article</Tag>
<Tag>css</Tag>
<Tag>html</Tag>
<Tag>javascript</Tag>
<Tag>mysql</Tag>
<Tag>php</Tag>
<Tag>sql</Tag>
<Tag>tricks</Tag>
<Group token="retired-583">Web Developer - Build Group</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/retired-583</GroupUrl>
<AvatarUrl>https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xsmall.png?1363101197</AvatarUrl>
<AvatarUrl size="original">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/original.jpg?1363101197</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xxlarge.png?1363101197</AvatarUrl>
<AvatarUrl size="xlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xlarge.png?1363101197</AvatarUrl>
<AvatarUrl size="large">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/large.png?1363101197</AvatarUrl>
<AvatarUrl size="medium">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/medium.png?1363101197</AvatarUrl>
<AvatarUrl size="small">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/small.png?1363101197</AvatarUrl>
<AvatarUrl size="xsmall">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xsmall.png?1363101197</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xxsmall.png?1363101197</AvatarUrl>
<Sponsor>Web Developer - Build Group</Sponsor>
<PawCount>0</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>true</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 17:55:27 -0400</PostedAt>
<EditAt>Fri, 22 Mar 2013 17:55:27 -0400</EditAt>
</NewsItem>

<NewsItem contentIssues="true" id="26603" important="false" status="posted" url="https://my3.my.umbc.edu/posts/26603">
<Title>STARS Findings on Campus Infrastructure and Sustainable Development</Title>
<Body>
<![CDATA[
    <div class="html-content">
    <p>This article looks at infrastructure development among colleges and universities participating in STARS. Data related to building construction and maintenance, GHG emissions, and energy consumption can shed light on how campuses are developing, whether improvements are being made over time, and how infrastructure relates to campus sustainability on a grand scale. The analysis was conducted on 237 STARS <a href="https://stars.aashe.org/institutions/rated/" rel="nofollow external" class="bo">rated institutions</a> in Spring 2013, and focused on data submitted within the Buildings, Climate, and Energy subcategories.</p>
    <p><strong>Building Operations &amp; Construction</strong><br>
    Two credits in STARS depict how colleges and universities address building operations and new design and construction. <em>OP 1: Buildings Operations &amp; Maintenance</em> and <em>OP 2: Building Design &amp; Construction</em> award points based on the proportion of sustainable building space on campus. Points are awarded at incremental values based on earned <a href="http://new.usgbc.org/leed/rating-systems" rel="nofollow external" class="bo">LEED ratings</a>. STARS awards minimal points for space that is not certified, but is designed or maintained in accordance with green standards.</p>
    <p><strong>Comparing Building Operations &amp; New Construction - all Institutions</strong> <img src="http://www.aashe.org/files/documents/STARS/Buildings%20Comparison%20.6.png" alt="Buildings Comparison" style="max-width: 100%; height: auto;"><br>
    When comparing building operations and new construction side-by-side, a significant disparity on green building standards can be found. In the area of existing building operations, only one percent of total building space earned a LEED for Existing Buildings: Operations &amp; Maintenance (EBOM) rating. The majority of building space was identified as being “maintained in accordance with green standards.” For new construction, over one-third of new building space earned a LEED rating while one-quarter was identified as being “designed and constructed in accordance with green standards.”</p>
    <p>What can account for the disparity between the rate of LEED EBOM and LEED for new building certifications? One explanation may be that new building certifications are more established, with EBOM coming on the scene later. Other possible considerations: Is it more difficult or costly to attain a strong LEED EBOM rating? How does deferred maintenance and aging campus infrastructure play a role? We welcome readers’ feedback.</p>
    <p>Perhaps the more important question is, how do these campus infrastructure trends affect the state of campus sustainability on a larger scale? In higher education, building operations tend to generate the greatest proportion of greenhouse gas emissions and energy consumption. For this reason, a review of Climate and Energy credits may shed additional light on the question.</p>
    <p><strong>Greenhouse Gas Emissions</strong><br>
    <em>OP 5: Greenhouse Gas Emissions</em> is the central credit in the Climate subcategory, with up to 14 points available for reducing Scope 1 and 2 emissions per weighted campus users (WCU) compared to a 2005 baseline (see page 109 of the <a href="http://www.aashe.org/files/documents/STARS/stars_1.2_technical_manual.pdf" rel="nofollow external" class="bo">STARS Technical Manual</a> to see how WCU is calculated).</p>
    <p><img src="http://www.aashe.org/files/documents/STARS/Emissions%20per%20WCU%20.6.png" alt="Emissions per WCU .6.png" style="max-width: 100%; height: auto;"><br>
    STARS data reveal that over time, average emissions per WCU decreased from 6.5 to 5.5 metric tons of carbon dioxide equivalent (CO2e). Sixty percent of rated institutions reduced their net greenhouse gas emissions relative to WCU between the 2005 baseline year and performance year (institutions select performance year based on when the most-recent data are available). While a drop in average emissions per weighted campus users does seem promising, can this be considered enough in the grand scheme of things? It is after all total emissions that cause harm to our environment and society.</p>
    <p><img src="http://www.aashe.org/files/documents/STARS/Total%20Emissions%20.6.png" alt="Total Emissions .6.png" style="max-width: 100%; height: auto;"><br>
    The graph above depicts total GHG emissions reported for the 2005 baseline year and performance year among all STARS institutions. Scope 1 &amp; 2 emissions decreased slightly between the baseline and performance years, while carbon offsets generated on-site increased marginally. Purchase of carbon offsets grew ten-fold between 2005 and performance years (though still covered only a fraction of total emissions).</p>
    <p>Despite a promising reduction in GHG emissions per weighted campus user, STARS data depict a more modest reduction in total emissions. Does this demonstrate a sustainable rate of reduction? It may be too soon to tell, but it’s clear that more needs to be done in the area of climate mitigation.</p>
    <p><strong>Energy Consumption</strong><br>
    <em>OP 7: Building Energy Consumption</em> is one of two central credits in the Energy subcategory of STARS. Institutions are awarded up to 8 points for reducing total building energy consumption per gross square foot (GSF) of building space compared to a 2005 baseline.</p>
    <p><img src="http://www.aashe.org/files/documents/STARS/Energy%20Consumption%20per%20GSF%20.6.png" alt="Energy Consumption per GSF .6.png" style="max-width: 100%; height: auto;"><br>
    Energy consumption per GSF dropped from .18 to .16 MMBtu between the 2005 baseline and performance year for all STARS institutions. Overall, 68 percent of rated institutions had reduced energy consumption per GSF of building space during that time.</p>
    <p><img src="http://www.aashe.org/files/documents/STARS/Total%20Energy%20Consumption%20.6.png" alt="Total Energy Consumption" style="max-width: 100%; height: auto;"><br>
    Once again, a review of total energy consumption presents a less-optimistic reality. STARS data reveal that total energy consumption (above-left) actually increased between 2005 and the performance year, despite a decrease in consumption per GSF. A slight increase in energy consumption can primarily be explained by growth in campus building space (above-right). The analysis reveals that a lot more needs to be done to achieve a sustainable rate of energy reduction.</p>
    <p><strong>Sustainable Development</strong><br>
    Among STARS institutions, few existing buildings are earning EBOM ratings, though most are being maintained in accordance with green practices. A much higher rate of new building construction results in earned LEED ratings. Despite these findings, STARS data suggest that an increase in building space resulting from new construction and major renovations is a significant obstacle for achieving sustainability in the higher education sector. More should be done to plan for growth more effectively while cutting emissions and consumption.</p>
    <p><strong>Tackling the Problem</strong><br>
    Emissions and consumption rates must be reduced by significant amounts regardless of the size and growth of our built environment and population. AASHE’s <a href="http://www.aashe.org/wiki/cool-campus-how-guide-college-and-university-climate-action-planning/cool-campus-how-guide-coll" rel="nofollow external" class="bo">Climate Action Planning How-to Guide</a> provides specific recommendations for GHG mitigation strategies related to all of the following and more: energy conservation and efficiency; on-site renewable energy technologies; maximizing space utilization; and designing and building only the greenest, most energy efficient new buildings. The <a href="http://www.aashe.org/resources/campus-operations-resources/" rel="nofollow external" class="bo">Operations section</a> of AASHE’s Resource Center also provides relevant suggestions and resources.</p>
    <p>What else can colleges and universities do to encourage sustainable campus growth? What are some successful outreach strategies that campuses are using along with mitigation strategies? We welcome feedback on additional suggestions and ideas.</p>
    </div>
]]>
</Body>
<Summary>This article looks at infrastructure development among colleges and universities participating in STARS. Data related to building construction and maintenance, GHG emissions, and energy...</Summary>
<Website>http://feedproxy.google.com/~r/CampusSustainabilityPerspectives/~3/d0cgmAVpyNs/stars-findings-campus-infrastructure-and-sustainable-development</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/26603/guest@my.umbc.edu/dcb153f69ed8a99c01eddea07eb94181/api/pixel</TrackingUrl>
<Tag>buildings</Tag>
<Tag>climate</Tag>
<Tag>energy</Tag>
<Tag>stars</Tag>
<Group token="sustainability">Sustainability Matters at UMBC</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/sustainability</GroupUrl>
<AvatarUrl>https://assets1-my.umbc.edu/system/shared/avatars/groups/000/000/086/91091ac32f525d88daa6d6b721420ac1/xsmall.png?1586269437</AvatarUrl>
<AvatarUrl size="original">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/086/91091ac32f525d88daa6d6b721420ac1/original.png?1586269437</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/086/91091ac32f525d88daa6d6b721420ac1/xxlarge.png?1586269437</AvatarUrl>
<AvatarUrl size="xlarge">https://assets2-my.umbc.edu/system/shared/avatars/groups/000/000/086/91091ac32f525d88daa6d6b721420ac1/xlarge.png?1586269437</AvatarUrl>
<AvatarUrl size="large">https://assets2-my.umbc.edu/system/shared/avatars/groups/000/000/086/91091ac32f525d88daa6d6b721420ac1/large.png?1586269437</AvatarUrl>
<AvatarUrl size="medium">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/086/91091ac32f525d88daa6d6b721420ac1/medium.png?1586269437</AvatarUrl>
<AvatarUrl size="small">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/086/91091ac32f525d88daa6d6b721420ac1/small.png?1586269437</AvatarUrl>
<AvatarUrl size="xsmall">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/000/086/91091ac32f525d88daa6d6b721420ac1/xsmall.png?1586269437</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/086/91091ac32f525d88daa6d6b721420ac1/xxsmall.png?1586269437</AvatarUrl>
<Sponsor>UMBC SUSTAINABILITY</Sponsor>
<PawCount>0</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>false</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 16:23:23 -0400</PostedAt>
</NewsItem>

<NewsItem contentIssues="true" id="26601" important="false" status="posted" url="https://my3.my.umbc.edu/posts/26601">
<Title>Jones &#8217;06, social work, on Hrabowski as Role Model</Title>
<Body>
<![CDATA[
    <div class="html-content">In a Q&amp;A with City Biz List, Joseph T. Jones ’06, social work, CEO of The Center for Urban Families, shares some of the challenges of his childhood years, and some of the secrets to his success in the non-profit … <a href="http://umbcalumni.wordpress.com/2013/03/22/jones-06-social-work-on-hrabowski-as-role-model/" rel="nofollow external" class="bo">Continue reading <span>→</span></a>
    </div>
]]>
</Body>
<Summary>In a Q&amp;A with City Biz List, Joseph T. Jones ’06, social work, CEO of The Center for Urban Families, shares some of the challenges of his childhood years, and some of the secrets to his...</Summary>
<Website>http://umbcalumni.wordpress.com/2013/03/22/jones-06-social-work-on-hrabowski-as-role-model/</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/26601/guest@my.umbc.edu/513d6424993e16518548cbf8e9f4c01d/api/pixel</TrackingUrl>
<Tag>00s-alums</Tag>
<Tag>social-sciences</Tag>
<Group token="retired-20">UMBC Alumni</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/retired-20</GroupUrl>
<AvatarUrl>https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xsmall.png?1280681147</AvatarUrl>
<AvatarUrl size="original">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/original.png?1280681147</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xxlarge.png?1280681147</AvatarUrl>
<AvatarUrl size="xlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xlarge.png?1280681147</AvatarUrl>
<AvatarUrl size="large">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/large.png?1280681147</AvatarUrl>
<AvatarUrl size="medium">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/medium.png?1280681147</AvatarUrl>
<AvatarUrl size="small">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/small.png?1280681147</AvatarUrl>
<AvatarUrl size="xsmall">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xsmall.png?1280681147</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xxsmall.png?1280681147</AvatarUrl>
<Sponsor>UMBC Alumni</Sponsor>
<PawCount>0</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>false</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 16:15:45 -0400</PostedAt>
</NewsItem>

<NewsItem contentIssues="true" id="26908" important="false" status="posted" url="https://my3.my.umbc.edu/posts/26908">
<Title>Jones &#8217;06, social work, on Hrabowski as Role Model</Title>
<Body>
<![CDATA[
    <div class="html-content">In a Q&amp;A with City Biz List, Joseph T. Jones ’06, social work, CEO of The Center for Urban Families, shares some of the challenges of his childhood years, and some of the secrets to his success in the non-profit … <a href="https://umbcalumni.wordpress.com/2013/03/22/jones-06-social-work-on-hrabowski-as-role-model/" rel="nofollow external" class="bo">Continue reading <span>→</span></a>
    </div>
]]>
</Body>
<Summary>In a Q&amp;A with City Biz List, Joseph T. Jones ’06, social work, CEO of The Center for Urban Families, shares some of the challenges of his childhood years, and some of the secrets to his...</Summary>
<Website>https://umbcalumni.wordpress.com/2013/03/22/jones-06-social-work-on-hrabowski-as-role-model/</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/26908/guest@my.umbc.edu/c1c0de191fb3406c8121ff60c9a85e06/api/pixel</TrackingUrl>
<Tag>00s-alums</Tag>
<Tag>social-sciences</Tag>
<Group token="retired-20">UMBC Alumni</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/retired-20</GroupUrl>
<AvatarUrl>https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xsmall.png?1280681147</AvatarUrl>
<AvatarUrl size="original">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/original.png?1280681147</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xxlarge.png?1280681147</AvatarUrl>
<AvatarUrl size="xlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xlarge.png?1280681147</AvatarUrl>
<AvatarUrl size="large">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/large.png?1280681147</AvatarUrl>
<AvatarUrl size="medium">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/medium.png?1280681147</AvatarUrl>
<AvatarUrl size="small">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/small.png?1280681147</AvatarUrl>
<AvatarUrl size="xsmall">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xsmall.png?1280681147</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/020/08fe2621d8e716b02ec0da35256a998d/xxsmall.png?1280681147</AvatarUrl>
<Sponsor>UMBC Alumni</Sponsor>
<PawCount>0</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>false</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 16:15:45 -0400</PostedAt>
</NewsItem>

<NewsItem contentIssues="false" id="107032" important="false" status="posted" url="https://my3.my.umbc.edu/posts/107032">
<Title>Jones &#8217;06, social work, on Hrabowski as Role Model</Title>
<Body>
<![CDATA[
    <div class="html-content">In a Q&amp;A with City Biz List, Joseph T. Jones ’06, social work, CEO of The Center for Urban Families, …</div>
]]>
</Body>
<Summary>In a Q&amp;A with City Biz List, Joseph T. Jones ’06, social work, CEO of The Center for Urban Families, …</Summary>
<Website>https://magazine.umbc.edu/jones-06-social-work-on-hrabowski-as-role-model/</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/107032/guest@my.umbc.edu/77b98c7a06117fe1c5e12e8495f167b7/api/pixel</TrackingUrl>
<Tag>alumni</Tag>
<Group token="retired-1945">UMBC Magazine</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/retired-1945</GroupUrl>
<AvatarUrl>https://assets3-my.umbc.edu/images/avatars/group/8/xsmall.png?1782487796</AvatarUrl>
<AvatarUrl size="original">https://assets3-my.umbc.edu/images/avatars/group/8/original.png?1782487796</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets1-my.umbc.edu/images/avatars/group/8/xxlarge.png?1782487796</AvatarUrl>
<AvatarUrl size="xlarge">https://assets2-my.umbc.edu/images/avatars/group/8/xlarge.png?1782487796</AvatarUrl>
<AvatarUrl size="large">https://assets4-my.umbc.edu/images/avatars/group/8/large.png?1782487796</AvatarUrl>
<AvatarUrl size="medium">https://assets4-my.umbc.edu/images/avatars/group/8/medium.png?1782487796</AvatarUrl>
<AvatarUrl size="small">https://assets1-my.umbc.edu/images/avatars/group/8/small.png?1782487796</AvatarUrl>
<AvatarUrl size="xsmall">https://assets3-my.umbc.edu/images/avatars/group/8/xsmall.png?1782487796</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets4-my.umbc.edu/images/avatars/group/8/xxsmall.png?1782487796</AvatarUrl>
<Sponsor>UMBC Magazine</Sponsor>
<PawCount>0</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>false</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 16:15:45 -0400</PostedAt>
</NewsItem>

<NewsItem contentIssues="true" id="26599" important="false" status="posted" url="https://my3.my.umbc.edu/posts/26599">
<Title>Intro to Flask: Adding a Contact Page</Title>
<Body>
<![CDATA[
    <div class="html-content">
    <a href="http://rss.buysellads.com/click.php?z=1260013&amp;k=d754f1e9ba63a736ba8ff5ece958f7dd&amp;a=28982&amp;c=2052851820" rel="nofollow external" class="bo"><img src="http://rss.buysellads.com/img.php?z=1260013&amp;k=d754f1e9ba63a736ba8ff5ece958f7dd&amp;a=28982&amp;c=2052851820" alt="" style="max-width: 100%; height: auto;"></a><p>In the <a href="http://net.tutsplus.com/tutorials/python-tutorials/an-introduction-to-pythons-flask-framework" rel="nofollow external" class="bo">previous article</a> in this mini-series, we leveraged <a href="http://flask.pocoo.org/" rel="nofollow external" class="bo">Flask</a> to build a simple website that contains “Home” and “About” pages using a generalized workflow that we can apply to other Flask-based web apps. In this lesson, I’ll demonstrate how to add a “Contact” page that allow users to send you messages.</p>
    <p></p>
    <p>The code used in this article can be found on <a href="https://github.com/NETTUTS/intro-to-flask" rel="nofollow external" class="bo">GitHub</a>. Captions, such as <strong>Checkpoint: 05_contact_form</strong>, mean that you can switch to the branch named “05_contact_form” and review the code at that point in the article.</p>
    <hr>
    <h2>Flask Extensions</h2>
    <blockquote><p> You can find a full list of extensions in the <a href="http://flask.pocoo.org/extensions/" rel="nofollow external" class="bo">Flask Extension Registry</a>.</p></blockquote>
    <p>Flask doesn’t come with many features off the shelf, making it easy to pick up and learn. There is no object-relational mapper for database interaction or admin interfaces to add and update content. It only offers a small set of functions, two of which we’ve already used — <code>url_for()</code> and <code>render_template()</code>.</p>
    <p>Instead of shipping with extra functionality, Flask’s extension model allows you to add functionality as needed. A Flask extension is a package that adds specific functionality to your app. For example, <a href="http://packages.python.org/Flask-SQLAlchemy/" rel="nofollow external" class="bo">Flask-SQLAlchemy</a> adds database support to your app, whereas <a href="http://packages.python.org/Flask-Login/" rel="nofollow external" class="bo">Flask-Login</a> adds login/logout support. You can find a full list of extensions in the <a href="http://flask.pocoo.org/extensions/" rel="nofollow external" class="bo">Flask Extension Registry</a>.</p>
    <p>To create a Contact page, we’ll use <a href="http://packages.python.org/Flask-WTF/" rel="nofollow external" class="bo">Flask-WTF</a> to handle and validate form data and <a href="http://packages.python.org/Flask-Mail/" rel="nofollow external" class="bo">Flask-Mail</a> to email the form data to you.</p>
    <hr>
    <h2>Flask-WTF</h2>
    <p><a href="http://packages.python.org/Flask-WTF/" rel="nofollow external" class="bo">Flask-WTF</a> is an exension that handles and validates form data. What does that mean? Look at the following figure:</p>
    <div> <img src="http://cdn.tutsplus.com/net.tutsplus.com/authors/lalith-polepeddi/intro-to-flask-p2-fig1.png" style="max-width: 100%; height: auto;"><p><strong>Fig. 1</strong></p>
    </div>
    <ol>
    <li>A user issues a GET request for a web page that contains a form.</li>
    <li>The user fills in the form.</li>
    <li>The user clicks the “Send” button, submitting it to the server via a POST request.</li>
    <li>The server validates the information.</li>
    <li>If one or more fields do not validate, the web page containing the form loads again with a helpful error message, prompting the user to try again.</li>
    <li>If all fields validate, the form information is used in the next step in the pipeline.</li>
    </ol>
    <p>A contact page will have fields for the user’s name, email, subject, and message. In Flask, we’ll POST the form to a function inside <code>routes.py</code>. This function is called the form handler. We’ll run a few validation checks, and if any of the input does not pass muster, we’ll refresh the page to display a message that describes the error. Once all validation checks pass, we’ll use the form data for the next step: emailing the message to you, the website owner.</p>
    <blockquote><p>Flask extensions are simple, powerful tools that extend the functionality of your Flask-based app.</p></blockquote>
    <p>That’s how form handling and validation works. Now where do we actually define the form? We could write HTML using the <code>&lt;form&gt;</code> element and set its <code>action</code> attribute to a Python script. The Python script would mirror the form in order to capture each form field and validate the form field data. If we use this strategy, however, we’d essentially define the form twice — once for the front-end and once for the back-end.</p>
    <p>It would be great to define the form only once: in the Python script. This is exactly what Flask-WTF allows us to do. We’ll define the form just once in a Python script, and then we’ll let Flask-WTF generate the form’s HTML for us. The point of all of this is to separate presentation from content.</p>
    <p>Enough chatter. Let’s code.</p>
    <h3>Creating a Form</h3>
    <p>As a first step, let’s get back into the isolated development environment we created last time.</p>
    <pre>$ cd flaskapp&#x000A;    $ . bin/activate&#x000A;    </pre>
    <p>Now that we’ve entered and activated our development environment, we can safely install Flask-WTF:</p>
    <pre>$ pip install flask-wtf&#x000A;    </pre>
    <p>Let’s now define the form in a Python script. We already have <code>routes.py</code>, which maps URLs to functions. Let’s not clutter it with unrelated code. Instead, create a new file called <code>forms.py</code>, and place it inside the <code>app/</code> folder.</p>
    <p><strong>app/forms.py</strong></p>
    <pre>from flask.ext.wtf import Form, TextField, TextAreaField, SubmitField&#x000A;    &#x000A;    class ContactForm(Form):&#x000A;      name = TextField("Name")&#x000A;      email = TextField("Email")&#x000A;      subject = TextField("Subject")&#x000A;      message = TextAreaField("Message")&#x000A;      submit = SubmitField("Send")&#x000A;    </pre>
    <p>We just created a form. What did we do? First, we imported a few useful classes from Flask-WTF — the base <code>Form</code> class, a text field, a textarea field for multi-line text input, and a submit button. Next, we created a new class named <code>ContactForm</code>, inheriting from the base <code>Form</code> class. Then we created each field that we want to see in the contact form. Instead of writing <code>&lt;input type="text"&gt;Name&lt;/input&gt;</code> in an HTML file, you write <code>name = TextField("Name")</code>.</p>
    <h3>Using the Form</h3>
    <p>Now let’s use our form. We want it to appear when a user visits the contact page. In Flask terms, we want the form to show up in a web template and map a URL to that web template so we can visit it in the browser. This means we need to create a new web template and a new URL mapping. Let’s start by creating a new URL mapping.</p>
    <blockquote><p>This is an action-packed section, and it may be a little confusing. But stick with me and we’ll get through it.</p></blockquote>
    <p>As a first step, open <code>routes.py</code> and import our newly created form by adding <code>from forms import ContactForm</code> at the beginning of the script.</p>
    <p><strong>app/routes.py</strong></p>
    <pre>from flask import Flask, render_template&#x000A;    from forms import ContactForm&#x000A;    </pre>
    <blockquote><p>You can prevent a CSRF attack by making sure that the form submission originates from your web app.</p></blockquote>
    <p>Next, configure Flask-WTF to handle a security exploit known as cross-site request forgery (CSRF). In a perfect world, your server would only process forms that belong to your web app. In other words, your server would only handle and validate the forms that you created. However, it is possible for an attacker to create a form on his own website, fill it in with malicious information, and submit it to your server. If your server accepts this malicious information, all sorts of bad things can happen next.</p>
    <p>You can prevent a CSRF attack by making sure that the form submission originates from your web app. One way to do this is to keep a unique token hidden inside your HTML <code>&lt;form&gt;</code> tag that cannot be guessed by attackers. When the form POSTs to your server, the token is checked first. If the token does not match, your server rejects the form submission and does not touch the form data. If the token matches, the server proceeds with form handling and validation.</p>
    <p>Flask-WTF does all of this with an easy one-liner. Just configure Flask-WTF with a secret key, and Flask-WTF takes care of generating and managing unique tokens for your forms.</p>
    <p><strong>app/routes.py</strong></p>
    <pre>from flask import Flask, render_template, request, flash&#x000A;    from forms import ContactForm&#x000A;    &#x000A;    app = Flask(__name__) &#x000A;    &#x000A;    app.secret_key = 'development key'&#x000A;    </pre>
    <p>Here in line six, I set the secret key to ‘development key’. Feel free to make yours more complex, longer, and alphanumeric.</p>
    <p>Now that we’ve imported and configured our contact form, we can use it in a URL mapping in <code>routes.py</code>. Let’s go ahead and create that URL mapping.</p>
    <p><strong>app/routes.py</strong></p>
    <pre>@app.route('/contact')&#x000A;    def contact():&#x000A;      form = ContactForm()&#x000A;      return render_template('contact.html', form=form)&#x000A;    </pre>
    <p>Now when someone visits the URL <code>/contact</code>, the function <code>contact()</code> will execute. Inside <code>contact()</code>, we first create a new instance of our contact form in line three and sent it to a web template named <code>contact.html</code> in line four. We will create this web template shortly.</p>
    <p>We still have some work to do here though. Figure 1 showed that if a GET request is sent to the server, the web page containing the form should be retrieved and loaded in browser. If the server receives a POST request, a function should capture the form field data and check if it’s valid. In Python terms, this logic can be expressed in an <code>if...else</code> statement. There is a Flask class for distinguishing between GET and POST requests, so let’s start by importing that class at the beginning of <code>routes.py</code> and add the <code>if...else</code> logic to the <code>contact()</code> function.</p>
    <p><strong>app/routes.py</strong></p>
    <pre>from flask import Flask, render_template, request&#x000A;    .&#x000A;    .&#x000A;    .&#x000A;    @app.route('/contact', methods=['GET', 'POST'])&#x000A;    def contact():&#x000A;      form = ContactForm()&#x000A;    &#x000A;      if request.method == 'POST':&#x000A;        return 'Form posted.'&#x000A;    &#x000A;      elif request.method == 'GET':&#x000A;        return render_template('contact.html', form=form)&#x000A;    </pre>
    <p>We already imported the Flask class and <code>render_template()</code> in the <a href="http://net.tutsplus.com/tutorials/python-tutorials/an-introduction-to-pythons-flask-framework" rel="nofollow external" class="bo">previous article</a>, so here we import one more Flask class named <code>request</code>. <code>request</code> determines whether the current HTTP method is a GET or a POST. Next is the <code>if...else</code> logic to the <code>contact()</code> function (lines 9-13).</p>
    <blockquote><p>In the case of a POST request, a string indicating that the form has been posted will be returned.</p></blockquote>
    <p>This string is a temporary placeholder, and we’ll replace it with real code in the final step of this article. Otherwise, if the request uses GET, we return the web template <code>contact.html</code> that contains the form.</p>
    <p>The next step is to create the web template <code>contact.html</code> and put it inside the <code>templates/</code> folder.</p>
    <p><strong>app/templates/contact.html</strong></p>
    <pre>{% extends "layout.html" %}&#x000A;    &#x000A;    {% block content %}&#x000A;      &lt;h2&gt;Contact&lt;/h2&gt;&#x000A;      &lt;form action="{{ url_for('contact') }}" method=post&gt;&#x000A;        {{ form.hidden_tag() }}&#x000A;    &#x000A;        {{ form.name.label }}&#x000A;        {{ form.name }}&#x000A;    &#x000A;        {{ form.email.label }}&#x000A;        {{ form.email }}&#x000A;    &#x000A;        {{ form.subject.label }}&#x000A;        {{ form.subject }}&#x000A;    &#x000A;        {{ form.message.label }}&#x000A;        {{ form.message }}&#x000A;    &#x000A;        {{ form.submit }}&#x000A;      &lt;/form&gt;&#x000A;    {% endblock %} &#x000A;    </pre>
    <p>As with <code>home.html</code> and <code>about.html</code>, the <code>contact.html</code> template extends <code>layout.html</code> and fills the ‘content’ block with its own text. We first specify where to send the form data on submission by setting the <code>&lt;form&gt;</code> element’s <code>action</code> attribute to the <code>contact()</code> function we created in <code>routes.py</code> (line five). Next, we let the Jinja2 template engine generate the bulk of the form for us (lines 6-20). We start by inserting a hidden tag in line six to protect against CSRF exploits. Lastly, we add each label and field of the form.</p>
    <p>We are now ready to see the result of all our work. Just type the following:</p>
    <pre>$ python routes.py&#x000A;    </pre>
    <p>Then go to <a href="http://localhost:5000/contact" rel="nofollow external" class="bo">http://localhost:5000/contact</a> in your favorite web browser.</p>
    <div> <img src="http://cdn.tutsplus.com/net.tutsplus.com/authors/lalith-polepeddi/intro-to-flask-p2-contact1.png" style="max-width: 100%; height: auto;">
    </div>
    <p>The contact page containing the form has loaded. Fill in the form fields and click the "Send" button. You’ll see a page that looks like this:</p>
    <div> <img src="http://cdn.tutsplus.com/net.tutsplus.com/authors/lalith-polepeddi/intro-to-flask-p2-contact2.png" style="max-width: 100%; height: auto;">
    </div>
    <p>Awesome! Form submission is working.</p>
    <p>Let’s quickly review everything we did in this section:</p>
    <ul>
    <li>We type in the URL <a href="http://localhost:5000/contact" rel="nofollow external" class="bo">http://localhost:5000/contact</a> into the browser’s address bar.</li>
    <li>The GET request hits <code>routes.py</code>, where the URL <code>/contact</code> is mapped to the function <code>contact()</code>.</li>
    <li>The function <code>contact()</code> executes, where a variable named <code>form</code> containing a usable instance of the <code>ContactForm</code> class is sent to the web template <code>contact.html</code>.</li>
    <li>
    <code>contact.html</code> generates the contact form’s HTML.</li>
    <li>Rendered HTML is sent back to <code>routes.py</code>.</li>
    <li>
    <code>routes.py</code> sends the HTML back to the browser and we see the contact page containing the form.</li>
    <li>We fill in the contact form and submit it by clicking the “Send” button.</li>
    <li>The POST request hits <code>routes.py</code>, where the URL <code>/contact</code> is mapped to the function <code>contact()</code>.</li>
    <li>The function <code>contact()</code> executes once more, this time following the <code>if...else</code> control flow for the HTTP POST request.</li>
    <li>The string <code>'Form posted.'</code> is sent back to the browser, giving us the screen above.</li>
    </ul>
    <p>— <strong>Checkpoint: 05_contact_form</strong> —</p>
    <p>This is cool, but the contact form looks ugly. Let’s make it look better by adding some CSS. Open up <code>main.css</code> and add these rules:</p>
    <p><strong>static/css/main.css</strong></p>
    <pre>/* Contact form */&#x000A;    form label {&#x000A;      font-size: 1.2em;&#x000A;      font-weight: bold;&#x000A;      display: block;&#x000A;      padding: 10px 0;&#x000A;    }&#x000A;    &#x000A;    form input#name,&#x000A;    form input#email,&#x000A;    form input#subject {&#x000A;      width: 400px;&#x000A;      background-color: #fafafa;&#x000A;      -webkit-border-radius: 3px;&#x000A;         -moz-border-radius: 3px;&#x000A;              border-radius: 3px;&#x000A;      border: 1px solid #cccccc;&#x000A;      padding: 5px;&#x000A;      font-size: 1.1em;&#x000A;    }&#x000A;    &#x000A;    form textarea#message {&#x000A;      width: 500px;&#x000A;      height: 100px;&#x000A;      background-color: #fafafa;&#x000A;      -webkit-border-radius: 3px;&#x000A;         -moz-border-radius: 3px;&#x000A;              border-radius: 3px;&#x000A;      border: 1px solid #cccccc;&#x000A;      margin-bottom: 10px;&#x000A;      padding: 5px;&#x000A;      font-size: 1.1em;&#x000A;    }&#x000A;    &#x000A;    form input#submit {&#x000A;      display: block;&#x000A;      -webkit-border-radius: 3px; &#x000A;         -moz-border-radius: 3px;&#x000A;              border-radius: 3px;&#x000A;      border:1px solid #d8d8d8;&#x000A;      padding: 10px; &#x000A;      font-weight:bold; &#x000A;      text-align: center; &#x000A;      color: #000000; &#x000A;      background-color: #f4f4f4;&#x000A;      background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4f4f4), color-stop(100%, #e5e5e5));&#x000A;      background-image: -webkit-linear-gradient(top, #f4f4f4, #e5e5e5);&#x000A;      background-image: -moz-linear-gradient(top, #f4f4f4, #e5e5e5);&#x000A;      background-image: -ms-linear-gradient(top, #f4f4f4, #e5e5e5);&#x000A;      background-image: -o-linear-gradient(top, #f4f4f4, #e5e5e5);&#x000A;      background-image: linear-gradient(top, #f4f4f4, #e5e5e5);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#f4f4f4, endColorstr=#e5e5e5);&#x000A;    }&#x000A;    &#x000A;    form input#submit:hover{&#x000A;      cursor: pointer;&#x000A;      border:1px solid #c1c1c1; &#x000A;      background-color: #dbdbdb;&#x000A;      background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dbdbdb), color-stop(100%, #cccccc));&#x000A;      background-image: -webkit-linear-gradient(top, #dbdbdb, #cccccc);&#x000A;      background-image: -moz-linear-gradient(top, #dbdbdb, #cccccc);&#x000A;      background-image: -ms-linear-gradient(top, #dbdbdb, #cccccc);&#x000A;      background-image: -o-linear-gradient(top, #dbdbdb, #cccccc);&#x000A;      background-image: linear-gradient(top, #dbdbdb, #cccccc);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#dbdbdb, endColorstr=#cccccc);&#x000A;    }&#x000A;    </pre>
    <p>Switch back to the browser and refresh <a href="http://localhost:5000/contact" rel="nofollow external" class="bo">http://localhost:5000/contact</a> to see the result of the CSS.</p>
    <div> <img src="http://cdn.tutsplus.com/net.tutsplus.com/authors/lalith-polepeddi/intro-to-flask-p2-contact3.png" style="max-width: 100%; height: auto;">
    </div>
    <p>This looks much better. Let’s move on to form validation.</p>
    <p>— <strong>Checkpoint: 06_contact_styling</strong> —</p>
    <h3>Validating Form Data</h3>
    <p>A user can now visit the URL <code>/contact</code> and fill in the form. But what happens if the user does not properly fill out the form? We need to validate the user input so that it won’t cause problems in later steps.</p>
    <p>Form validation is performed by using form validators. Fortunately, Flask-WTF comes with many useful, built-in validators that we can use right away. We’ll put these validators in the <code>ContactForm</code> class definition in <code>forms.py</code>.</p>
    <p>The most basic validator is <em>presence</em>, which simply ensures that all form fields are filled in, so let’s start here.</p>
    <p><strong>app/forms.py</strong></p>
    <pre>from flask.ext.wtf import Form, TextField, TextAreaField, SubmitField, validators, ValidationError&#x000A;    &#x000A;    class ContactForm(Form):&#x000A;      name = TextField("Name",  [validators.Required()])&#x000A;      email = TextField("Email",  [validators.Required()])&#x000A;      subject = TextField("Subject",  [validators.Required()])&#x000A;      message = TextAreaField("Message",  [validators.Required()])&#x000A;      submit = SubmitField("Send")&#x000A;    </pre>
    <p>We start by importing <code>validators</code> and <code>ValidationError</code> from Flask-WTF. This gives us access to Flask-WTF’s built-in validators. Next we add <code>[validators.Required()]</code> to each form field in order to validate its presence. Notice that this validator is inside a Python list, meaning that we can easily add more validators to this list.</p>
    <p>Next, let’s require email addresses to match the pattern <code><a href="mailto:user@example.com">user@example.com</a></code> by adding the <em>Email</em> validator to the email field.</p>
    <p><strong>app/forms.py</strong></p>
    <pre>from flask.ext.wtf import Form, TextField, TextAreaField, SubmitField, validators, ValidationError&#x000A;    &#x000A;    class ContactForm(Form):&#x000A;      name = TextField("Name",  [validators.Required()])&#x000A;      email = TextField("Email",  [validators.Required(), validators.Email()])&#x000A;      subject = TextField("Subject",  [validators.Required()])&#x000A;      message = TextAreaField("Message",  [validators.Required()])&#x000A;      submit = SubmitField("Send")&#x000A;    </pre>
    <p>That does it for our form validations.</p>
    <p>— <strong>Checkpoint: 07_form_validations</strong> —</p>
    <h3>Flashing Error Messages</h3>
    <p>Looking back at Figure 1, if any validation check fails, the contact page should reload with an error message so that the user can fix the mistake and try again. This error message must only appear when validation fails and disappear when the mistake has been fixed.</p>
    <p>Our next step is to send this sort of temporary error message to the user when validation fails. Flask makes this really easy by using its <code>flash()</code> function. Let’s start by opening <code>routes.py</code> and importing Flask’s <code>flash()</code> function at the beginning of the script.</p>
    <p><strong>app/routes.py</strong></p>
    <pre>from flask import Flask, render_template, request, flash&#x000A;    </pre>
    <p>After the contact form POSTs to the server, any validation failure should reload the form with a helpful error message. Otherwise, the input data can be used for future processing. Once again, this logic can be expressed in an <code>if...else</code> statement. Let’s add this <code>if...else</code> logic to the <code>contact()</code> function inside the <code>if request.method == 'POST':</code> block.</p>
    <p><strong>app/routes.py</strong></p>
    <pre>@app.route('/contact', methods=['GET', 'POST'])&#x000A;    def contact():&#x000A;      form = ContactForm()&#x000A;    &#x000A;      if request.method == 'POST':&#x000A;        if form.validate() == False:&#x000A;          flash('All fields are required.')&#x000A;          return render_template('contact.html', form=form)&#x000A;        else:&#x000A;          return 'Form posted.'&#x000A;    &#x000A;      elif request.method == 'GET':&#x000A;        return render_template('contact.html', form=form)&#x000A;    </pre>
    <p>If any validation check fails, <code>form.validate()</code> will be <code>False</code>. The error message <code>All fields are required</code> will be sent to <code>contact.html</code>. Otherwise, we’ll see the temporary placeholder string <code>Form posted</code>, indicating the form has been successfully submitted.</p>
    <p>Next, let’s modify <code>contact.html</code> so that it can receive and display these temporary error messages. See the following block:</p>
    <pre>{% for message in get_flashed_messages() %}&#x000A;      &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;    {% endfor %}&#x000A;    </pre>
    <p>The function <code>get_flashed_messages()</code> pulls all flashed messages and returns them. We then simply display each flashed message by using a Jinja2 <code>for</code> loop. Add this code block to <code>contact.html</code> after <code>&lt;h2&gt;Contact&lt;/h2&gt;</code> and before the <code>&lt;form&gt;</code> tag.</p>
    <p><strong>app/templates/contact.html</strong></p>
    <pre>{% extends "layout.html" %}&#x000A;    &#x000A;    {% block content %}&#x000A;      &lt;h2&gt;Contact&lt;/h2&gt;&#x000A;    &#x000A;      {% for message in get_flashed_messages() %}&#x000A;        &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;      {% endfor %}&#x000A;      &#x000A;      &lt;form action="{{ url_for('contact') }}" method=post&gt;&#x000A;        {{ form.hidden_tag() }}&#x000A;    &#x000A;        {{ form.name.label }}&#x000A;        {{ form.name }}&#x000A;    &#x000A;        {{ form.email.label }}&#x000A;        {{ form.email }}&#x000A;    &#x000A;        {{ form.subject.label }}&#x000A;        {{ form.subject }}&#x000A;    &#x000A;        {{ form.message.label }}&#x000A;        {{ form.message }}&#x000A;    &#x000A;        {{ form.submit }}&#x000A;      &lt;/form&gt;&#x000A;    {% endblock %}&#x000A;    </pre>
    <p>Lastly, let’s add a CSS rule in <code>main.css</code> so that flashed error messages look pretty.</p>
    <p><strong>main.css</strong></p>
    <pre>/* Message flashing */&#x000A;    .flash {&#x000A;      background-color: #FBB0B0;&#x000A;      padding: 10px;&#x000A;      width: 400px;&#x000A;    }&#x000A;    </pre>
    <p>Open your browser and visit <a href="http://localhost:5000/contact" rel="nofollow external" class="bo">http://localhost:5000/contact</a>. Leave all the fields blank and click “Send” to test whether form validation and error message flashing work.</p>
    <div> <img src="http://cdn.tutsplus.com/net.tutsplus.com/authors/lalith-polepeddi/intro-to-flask-p2-contact4.png" style="max-width: 100%; height: auto;">
    </div>
    <p>This is sweet! We have successfully sent an error message to our contact form if a validation check fails.</p>
    <p>— <strong>Checkpoint: 08_error_message_flashing</strong> —</p>
    <p>But we’re not done; we can actually do a little better. Instead of having one generic error message for all failed validation checks, it would be better to have a specific error message for each failed validation check. For example, if the user forgets to fill in the subject field, a specific error message that says <code>Please enter a subject</code> would be flashed. Likewise, if the user forgets to fill in their name, we’d flash a specific error message that says <code>Please enter your name</code>. We can accomplish this pretty easily, so let’s start by writing our specific error messages inside each validator in <code>forms.py</code>.</p>
    <p><strong>app/forms.py</strong></p>
    <pre>from flask.ext.wtf import Form, TextField, TextAreaField, SubmitField, validators, ValidationError&#x000A;    &#x000A;    class ContactForm(Form):&#x000A;      name = TextField("Name",  [validators.Required("Please enter your name.")])&#x000A;      email = TextField("Email",  [validators.Required("Please enter your email address."), validators.Email("Please enter your email address.")])&#x000A;      subject = TextField("Subject",  [validators.Required("Please enter a subject.")])&#x000A;      message = TextAreaField("Message",  [validators.Required("Please enter a message.")])&#x000A;      submit = SubmitField("Send")&#x000A;    </pre>
    <p>We simply write specific error messages inside each validator. Next, let’s modify <code>contact.html</code> to receive and display these specific error messages. Earlier, we relied on the function <code>get_flashed_messages()</code> to pull flashed error messages, and looped over them to display them. Let’s replace that block with this one:</p>
    <pre>{% for message in form.name.errors %}&#x000A;      &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;    {% endfor %}&#x000A;    &#x000A;    {% for message in form.email.errors %}&#x000A;      &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;    {% endfor %}&#x000A;    &#x000A;    {% for message in form.subject.errors %}&#x000A;      &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;    {% endfor %}&#x000A;    &#x000A;    {% for message in form.message.errors %}&#x000A;      &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;    {% endfor %}&#x000A;    </pre>
    <p>Here we use the <code>errors</code> attribute for each form field to pull the specific error messages and loop over them using the Jinja2 <code>for</code> loop to display them.</p>
    <p>Putting it all together, <code>contact.html</code> now look like this:</p>
    <p><strong>app/templates/contact.html</strong></p>
    <pre>{% extends "layout.html" %}&#x000A;    &#x000A;    {% block content %}&#x000A;      &lt;h2&gt;Contact&lt;/h2&gt;&#x000A;    &#x000A;      {% for message in form.name.errors %}&#x000A;        &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;      {% endfor %}&#x000A;    &#x000A;      {% for message in form.email.errors %}&#x000A;        &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;      {% endfor %}&#x000A;    &#x000A;      {% for message in form.subject.errors %}&#x000A;        &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;      {% endfor %}&#x000A;    &#x000A;      {% for message in form.message.errors %}&#x000A;        &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;      {% endfor %}&#x000A;      &#x000A;      &lt;form action="{{ url_for('contact') }}" method=post&gt;&#x000A;        {{ form.hidden_tag() }}&#x000A;    &#x000A;        {{ form.name.label }}&#x000A;        {{ form.name }}&#x000A;    &#x000A;        {{ form.email.label }}&#x000A;        {{ form.email }}&#x000A;    &#x000A;        {{ form.subject.label }}&#x000A;        {{ form.subject }}&#x000A;    &#x000A;        {{ form.message.label }}&#x000A;        {{ form.message }}&#x000A;    &#x000A;        {{ form.submit }}&#x000A;      &lt;/form&gt;&#x000A;    {% endblock %} &#x000A;    </pre>
    <p>Switch back to the browser, go to <a href="http://localhost:5000/contact" rel="nofollow external" class="bo">http://localhost:5000/contact</a>, and click “Send”. Be sure to leave all form fields blank.</p>
    <div> <img src="http://cdn.tutsplus.com/net.tutsplus.com/authors/lalith-polepeddi/intro-to-flask-p2-contact5.png" style="max-width: 100%; height: auto;">
    </div>
    <p>Perfect! The user now has helpful error messages if he makes a mistake.</p>
    <p>— <strong>Checkpoint: 09_specific_message_flashing</strong> —</p>
    <p>We accomplished a lot in this section. We created a contact form from scratch, learned how to protect against CSRF attacks, distinguished between GET and POST requests, enforced form validations, and flashed specific error messages if necessary. We now need to email the message.</p>
    <hr>
    <h2>Flask-Mail</h2>
    <p><a href="http://packages.python.org/flask-mail/" rel="nofollow external" class="bo">Flask-Mail</a> is a Flask exension that enables you to send emails from your Flask app. The steps below are similar to those we took to use Flask-WTF.</p>
    <p>Let’s start by installing Flask-Mail.</p>
    <pre>$ pip install flask-mail&#x000A;    </pre>
    <h3>Configuring Flask-Mail</h3>
    <p>Next, lets import Flask-Mail into <code>routes.py</code> and configure it so that we can start using it.</p>
    <p><strong>app/routes.py</strong></p>
    <pre>from flask import Flask, render_template, request, flash&#x000A;    from forms import ContactForm&#x000A;    from flask.ext.mail import Message, Mail&#x000A;    &#x000A;    mail = Mail()&#x000A;    &#x000A;    app = Flask(__name__)&#x000A;    &#x000A;    app.secret_key = 'development key'&#x000A;    &#x000A;    app.config["MAIL_SERVER"] = "smtp.gmail.com"&#x000A;    app.config["MAIL_PORT"] = 465&#x000A;    app.config["MAIL_USE_SSL"] = True&#x000A;    app.config["MAIL_USERNAME"] = '<a href="mailto:contact@example.com">contact@example.com</a>'&#x000A;    app.config["MAIL_PASSWORD"] = 'your-password'&#x000A;    &#x000A;    mail.init_app(app)&#x000A;    </pre>
    <p>First, we import the <code>Message</code> and <code>Mail</code> classes from Flask-Mail (line three). We’ll use the <code>Message</code> class to compose a new email and the <code>Mail</code> class to send the email. Next, we create the <code>mail</code> variable that contain a usable instance of the <code>Mail</code> class (line five).</p>
    <p>We then configure Flask-Mail with few SMTP server settings (lines 11-15). I used Gmail’s SMTP server settings here, but you can easily use your favorite email provider. Just search for its SMTP settings and you’ll be set.</p>
    <blockquote><p>For example, if you want to use Yahoo! Mail, just search for “yahoo mail smtp server settings” and update the configuration.</p></blockquote>
    <p>Make sure to enter a real email and password in <code>app.config["MAIL_USERNAME"]</code> and <code>app.config["MAIL_PASSWORD"]</code>, respectively. This will be the account from which you’ll send email.</p>
    <p>Finally, we attach <code>mail</code> to our Flask app so that we can start using it (line 17).</p>
    <p>You’ve probably seen groups use contact email addresses like <code><a href="mailto:contact@example.com">contact@example.com</a></code> or <code><a href="mailto:support@example.com">support@example.com</a></code>. If you own your own domain and can create a new contact email address, go ahead and put that email address in <code>app.config["MAIL_USERNAME"]</code>. Otherwise, you can use your personal email address just to see how this works.</p>
    <h3>Sending an Email</h3>
    <p>Now that the configuration is complete, let’s compose a new email containing the contact form data and send it. We should only send an email if the form has been submitted and all validation checks pass. This means we need to work inside the <code>if request.method == 'POST':</code> block again. We’ve already added logic inside the <code>if form.validate() == False:</code> block to handle validation failures. If all validation checks pass, <code>form.validate()</code> will be <code>True</code> and the program will enter the <code>else</code> block. Therefore, let’s go ahead and add logic inside the <code>else:</code> block.</p>
    <p><strong>app/routes.py</strong></p>
    <pre>@app.route('/contact', methods=['GET', 'POST'])&#x000A;    def contact():&#x000A;      form = ContactForm()&#x000A;    &#x000A;      if request.method == 'POST':&#x000A;        if form.validate() == False:&#x000A;          flash('All fields are required.')&#x000A;          return render_template('contact.html', form=form)&#x000A;        else:&#x000A;          msg = Message(form.subject.data, sender='<a href="mailto:contact@example.com">contact@example.com</a>', recipients=['<a href="mailto:your_email@example.com">your_email@example.com</a>'])&#x000A;          msg.body = """&#x000A;          From: %s &lt;%s&gt;&#x000A;          %s&#x000A;          """ % (form.name.data, form.email.data, form.message.data)&#x000A;          mail.send(msg)&#x000A;    &#x000A;          return 'Form posted.'&#x000A;    &#x000A;      elif request.method == 'GET':&#x000A;        return render_template('contact.html', form=form)&#x000A;    </pre>
    <p>We start by composing a new message (line 10). The <code>Message</code> class takes a subject line, a “from” address, and a “to” address. We then collect the contact form’s subject field data with <code>form.subject.data</code> and set it as the new message’s subject line. The email will be sent from the account you configured in <code>app.config["MAIL_USERNAME"]</code>, so that’s what we used here for the from address. The email will be sent to your personal email address so that you can receive and respond to new messages.</p>
    <p>Next, we write the email itself (lines 11-14). We include the user’s name, email and message. I use Python’s string formatting operator <code>%</code> to format the email. And finally, we use <code>mail.send(msg)</code> to send the email (line 15).</p>
    <p>Let’s see if everything works. Visit <a href="http://localhost:5000/contact" rel="nofollow external" class="bo">http://localhost:5000/contact</a>, fill out each field, and click “Send.” If all goes well, you’ll receive a new email from your Flask app.</p>
    <p>— <strong>Checkpoint: 10_send_email</strong> —</p>
    <h3>Tidying Up</h3>
    <p>Our penultimate step is to remove the temporary placeholder string <code>'Form posted.'</code> with a message thanking the user for his feedback. This message should only appear if our application sends the email. Once again, this logic can be expressed in an <code>if...else</code> statement.</p>
    <blockquote><p>When the contact form has been successfully submitted, we’ll send a success flag from <code>routes.py</code> to <code>contact.html</code>.</p></blockquote>
    <p>We’ll place the <code>if...else</code> logic inside <code>contact.html</code>. If the success flag is set to <code>True</code>, we’ll display the thank you message. Otherwise, we’ll display the contact form.</p>
    <p>Let’s start in <code>routes.py</code> inside the <code>contact()</code> function. Replace the temporary placeholder line <code>return 'Form posted.'</code> with <code>return render_template('contact.html', success=True)</code> in order to send a success flag to <code>contact.html</code>. The <code>contact()</code> function now looks like this:</p>
    <p><strong>app/routes.py</strong></p>
    <pre>@app.route('/contact', methods=['GET', 'POST'])&#x000A;    def contact():&#x000A;      form = ContactForm()&#x000A;    &#x000A;      if request.method == 'POST':&#x000A;        if form.validate() == False:&#x000A;          flash('All fields are required.')&#x000A;          return render_template('contact.html', form=form)&#x000A;        else:&#x000A;          msg = Message(form.subject.data, sender='<a href="mailto:contact@example.com">contact@example.com</a>', recipients=['<a href="mailto:your_email@example.com">your_email@example.com</a>'])&#x000A;          msg.body = """&#x000A;          From: %s &amp;lt;%s&amp;gt;&#x000A;          %s&#x000A;          """ % (form.name.data, form.email.data, form.message.data)&#x000A;          mail.send(msg)&#x000A;    &#x000A;          return render_template('contact.html', success=True)&#x000A;    &#x000A;      elif request.method == 'GET':&#x000A;        return render_template('contact.html', form=form)&#x000A;    </pre>
    <p>Next open <code>contact.html</code> and add the <code>if...else</code> logic. We’ll use <a href="http://jinja.pocoo.org/docs/templates/#if" rel="nofollow external" class="bo">Jinja2′s <code>if...else</code> syntax</a> to make this happen.</p>
    <p><strong>app/templates/contact.html</strong></p>
    <pre>{% extends "layout.html" %}&#x000A;    &#x000A;    {% block content %}&#x000A;      &lt;h2&gt;Contact&lt;/h2&gt;&#x000A;    &#x000A;      {% if success %}&#x000A;        &lt;p&gt;Thank you for your message. We'll get back to you shortly.&lt;/p&gt;&#x000A;    &#x000A;      {% else %}&#x000A;    &#x000A;        {% for message in form.name.errors %}&#x000A;          &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;        {% endfor %}&#x000A;    &#x000A;        {% for message in form.email.errors %}&#x000A;          &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;        {% endfor %}&#x000A;    &#x000A;        {% for message in form.subject.errors %}&#x000A;          &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;        {% endfor %}&#x000A;    &#x000A;        {% for message in form.message.errors %}&#x000A;          &lt;div class="flash"&gt;{{ message }}&lt;/div&gt;&#x000A;        {% endfor %}&#x000A;    &#x000A;        &lt;form action="{{ url_for('contact') }}" method=post&gt;&#x000A;          {{ form.hidden_tag() }}&#x000A;    &#x000A;          {{ form.name.label }}&#x000A;          {{ form.name }}&#x000A;    &#x000A;          {{ form.email.label }}&#x000A;          {{ form.email }}&#x000A;    &#x000A;          {{ form.subject.label }}&#x000A;          {{ form.subject }}&#x000A;    &#x000A;          {{ form.message.label }}&#x000A;          {{ form.message }}&#x000A;    &#x000A;          {{ form.submit }}&#x000A;        &lt;/form&gt;&#x000A;    &#x000A;      {% endif %}&#x000A;    {% endblock %} &#x000A;    </pre>
    <p>Starting in line six, <code>{% if success %}</code> means that if the success flag we sent from <code>routes.py</code> is set to <code>True</code>, then display <code>&lt;p&gt;Thank you for your message. We'll get back to you shortly.&lt;/p&gt;</code>. Otherwise, follow the <code>{% else %}</code> branch and display the contact form. Jinja2 syntax asks that we close the <code>if...else</code> statement with <code>{% endif %}</code>, so we include that at the end (line 45).</p>
    <p>— <strong>Checkpoint: 11_success_message</strong> —</p>
    <p>Finally, let’s visit <a href="http://localhost:5000/contact" rel="nofollow external" class="bo">http://localhost:5000/contact</a> one more time. Fill in each field and click “Send”.</p>
    <div> <img src="http://cdn.tutsplus.com/net.tutsplus.com/authors/lalith-polepeddi/intro-to-flask-p2-contact6.png" style="max-width: 100%; height: auto;">
    </div>
    <p>Our last step is to add a navigation link to the contact page. In the <a href="http://net.tutsplus.com/tutorials/python-tutorials/an-introduction-to-pythons-flask-framework" rel="nofollow external" class="bo">previous article</a>, we added these links to <code>layout.html</code> inside the <code>&lt;header&gt;</code> element. Let’s also do that for the contact page (line eight).</p>
    <p><strong>app/templates/layout.html</strong></p>
    <pre>&lt;header&gt;&#x000A;      &lt;div class="container"&gt;&#x000A;        &lt;h1 class="logo"&gt;Flask App&lt;/h1&gt;&#x000A;        &lt;nav&gt;&#x000A;          &lt;ul class="menu"&gt;&#x000A;            &lt;li&gt;&lt;a href="{{ url_for('home') }}"&gt;Home&lt;/a&gt;&lt;/li&gt;&#x000A;            &lt;li&gt;&lt;a href="{{ url_for('about') }}"&gt;About&lt;/a&gt;&lt;/li&gt;&#x000A;            &lt;li&gt;&lt;a href="{{ url_for('contact') }}"&gt;Contact&lt;/a&gt;&lt;/li&gt;&#x000A;          &lt;/ul&gt;&#x000A;        &lt;/nav&gt;&#x000A;      &lt;/div&gt;&#x000A;    &lt;/header&gt;&#x000A;    </pre>
    <p>— <strong>Checkpoint: 12_contact_nav_link</strong> —</p>
    <p>Open up the browser and refresh <a href="http://localhost:5000/" rel="nofollow external" class="bo">http://localhost:5000/</a> to see the newly added navigation link.</p>
    <div> <img src="http://cdn.tutsplus.com/net.tutsplus.com/authors/lalith-polepeddi/intro-to-flask-p2-contact7.png" style="max-width: 100%; height: auto;">
    </div>
    <hr>
    <h2>Conclusion</h2>
    <p>In article, we added a contact page that contains a form to our Flask app. Forms appear in several places in web applications, most notably during sign up and login. This workflow can be adapted to meet those needs. In creating a contact page, we learned how to use Flask extensions.</p>
    <blockquote><p>Flask extensions are simple, powerful tools that extend the functionality of your Flask-based app.</p></blockquote>
    <p>Check out the <a href="http://flask.pocoo.org/extensions/" rel="nofollow external" class="bo">Flask Extension Registry</a> to explore many more extensions that you can integrate into your app.</p>
    </div>
]]>
</Body>
<Summary>In the previous article in this mini-series, we leveraged Flask to build a simple website that contains “Home” and “About” pages using a generalized workflow that we can apply to other Flask-based...</Summary>
<Website>http://feedproxy.google.com/~r/nettuts/~3/6lEqpByIGTI/</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/26599/guest@my.umbc.edu/3cbc0633d6fb6358a21d67f9a4db7696/api/pixel</TrackingUrl>
<Tag>css</Tag>
<Tag>development</Tag>
<Tag>flask</Tag>
<Tag>html</Tag>
<Tag>javascript</Tag>
<Tag>mysql</Tag>
<Tag>php</Tag>
<Tag>python</Tag>
<Tag>sql</Tag>
<Tag>wed</Tag>
<Group token="retired-583">Web Developer - Build Group</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/retired-583</GroupUrl>
<AvatarUrl>https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xsmall.png?1363101197</AvatarUrl>
<AvatarUrl size="original">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/original.jpg?1363101197</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xxlarge.png?1363101197</AvatarUrl>
<AvatarUrl size="xlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xlarge.png?1363101197</AvatarUrl>
<AvatarUrl size="large">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/large.png?1363101197</AvatarUrl>
<AvatarUrl size="medium">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/medium.png?1363101197</AvatarUrl>
<AvatarUrl size="small">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/small.png?1363101197</AvatarUrl>
<AvatarUrl size="xsmall">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xsmall.png?1363101197</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xxsmall.png?1363101197</AvatarUrl>
<Sponsor>Web Developer - Build Group</Sponsor>
<PawCount>0</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>true</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 16:12:11 -0400</PostedAt>
<EditAt>Fri, 22 Mar 2013 16:12:11 -0400</EditAt>
</NewsItem>

<NewsItem contentIssues="true" id="26598" important="false" status="posted" url="https://my3.my.umbc.edu/posts/26598">
<Title>Maintaining Your Startup&#8217;s Focus</Title>
<Body>
<![CDATA[
    <div class="html-content">Too many passions can derail you. Find one that sticks.</div>
]]>
</Body>
<Summary>Too many passions can derail you. Find one that sticks.</Summary>
<Website>http://feedproxy.google.com/~r/YoungentrepreneurcomBlog/~3/hGxxsggyHNQ/</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/26598/guest@my.umbc.edu/4f807505d26196619b7a1a1da117989d/api/pixel</TrackingUrl>
<Tag>business-growth-strategies</Tag>
<Tag>focus</Tag>
<Tag>motivation</Tag>
<Tag>passion</Tag>
<Tag>productivity</Tag>
<Tag>startup-basics</Tag>
<Group token="entrepreneurship">Alex. Brown Center for Entrepreneurship</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/entrepreneurship</GroupUrl>
<AvatarUrl>https://assets2-my.umbc.edu/system/shared/avatars/groups/000/000/092/53c03b106bdc6e19e4bf0a41b5a37add/xsmall.png?1771000363</AvatarUrl>
<AvatarUrl size="original">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/092/53c03b106bdc6e19e4bf0a41b5a37add/original.jpg?1771000363</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets2-my.umbc.edu/system/shared/avatars/groups/000/000/092/53c03b106bdc6e19e4bf0a41b5a37add/xxlarge.png?1771000363</AvatarUrl>
<AvatarUrl size="xlarge">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/000/092/53c03b106bdc6e19e4bf0a41b5a37add/xlarge.png?1771000363</AvatarUrl>
<AvatarUrl size="large">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/092/53c03b106bdc6e19e4bf0a41b5a37add/large.png?1771000363</AvatarUrl>
<AvatarUrl size="medium">https://assets1-my.umbc.edu/system/shared/avatars/groups/000/000/092/53c03b106bdc6e19e4bf0a41b5a37add/medium.png?1771000363</AvatarUrl>
<AvatarUrl size="small">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/092/53c03b106bdc6e19e4bf0a41b5a37add/small.png?1771000363</AvatarUrl>
<AvatarUrl size="xsmall">https://assets2-my.umbc.edu/system/shared/avatars/groups/000/000/092/53c03b106bdc6e19e4bf0a41b5a37add/xsmall.png?1771000363</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/092/53c03b106bdc6e19e4bf0a41b5a37add/xxsmall.png?1771000363</AvatarUrl>
<Sponsor>The Alex. Brown Center for Entrepreneurship</Sponsor>
<PawCount>0</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>true</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 16:00:13 -0400</PostedAt>
</NewsItem>

<NewsItem contentIssues="false" id="30086" important="false" status="posted" url="https://my3.my.umbc.edu/posts/30086">
<Title>HBO GO-It-Alone?</Title>
<Body>
<![CDATA[
    <div class="html-content">
    <p>HBO mulls breaking apart from the bundle. Will its broadband partners acquiesce?</p>
    <p>Earlier this week, I <a href="http://www.technologyreview.com/view/512676/the-television-will-not-be-revolutionized/" rel="nofollow external" class="bo">mentioned</a> what Aereo’s CEO had told me would be a metric for progress in TV innovation: à la carte pricing for individual networks, rather than a compulsory bundle of countless channels we don’t watch. Many people had their eyes on HBO, the strongest brand in cable right now, as the maverick that might make a move towards separating its content from cable subscriptions. After all, it was making just this <a href="http://variety.com/2012/tv/news/hbo-cuts-the-cord-for-international-launch-1118058484/" rel="nofollow external" class="bo">happen in Scandinavia</a>, going directly head-to-head with the likes of Netflix there.</p>
    </div>
]]>
</Body>
<Summary>HBO mulls breaking apart from the bundle. Will its broadband partners acquiesce?  Earlier this week, I mentioned what Aereo’s CEO had told me would be a metric for progress in TV innovation: à la...</Summary>
<Website>http://www.technologyreview.com/view/512836/hbo-go-it-alone/</Website>
<TrackingUrl>https://my3.my.umbc.edu/api/v0/pixel/news/30086/guest@my.umbc.edu/ae8067405362a86f106bb3cbbc6cd65b/api/pixel</TrackingUrl>
<Tag>development</Tag>
<Tag>internet</Tag>
<Tag>mit</Tag>
<Tag>technology</Tag>
<Tag>web</Tag>
<Group token="retired-583">Web Developer - Build Group</Group>
<GroupUrl>https://my3.my.umbc.edu/groups/retired-583</GroupUrl>
<AvatarUrl>https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xsmall.png?1363101197</AvatarUrl>
<AvatarUrl size="original">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/original.jpg?1363101197</AvatarUrl>
<AvatarUrl size="xxlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xxlarge.png?1363101197</AvatarUrl>
<AvatarUrl size="xlarge">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xlarge.png?1363101197</AvatarUrl>
<AvatarUrl size="large">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/large.png?1363101197</AvatarUrl>
<AvatarUrl size="medium">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/medium.png?1363101197</AvatarUrl>
<AvatarUrl size="small">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/small.png?1363101197</AvatarUrl>
<AvatarUrl size="xsmall">https://assets3-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xsmall.png?1363101197</AvatarUrl>
<AvatarUrl size="xxsmall">https://assets4-my.umbc.edu/system/shared/avatars/groups/000/000/583/fc60f5d7abc2e080599bb6dc465db54d/xxsmall.png?1363101197</AvatarUrl>
<Sponsor>Web Developer - Build Group</Sponsor>
<PawCount>0</PawCount>
<CommentCount>0</CommentCount>
<CommentsAllowed>true</CommentsAllowed>
<PostedAt>Fri, 22 Mar 2013 14:56:04 -0400</PostedAt>
</NewsItem>

</News>
