Skip to content

IntroToPython/webapp-next-steps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Web Applications - Next Steps

So we can poke a web app, now what?

Tutorials

http://www.codecademy.com/en/tracks/python

http://chattlibrary.org/treehouse

http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world

Examples

from app import app

@app.route('/')
@app.route('/index')
def index():
    user = {'nickname': 'Miguel'}  # fake user
    return '''
<html>
  <head>
    <title>Home Page</title>
  </head>
  <body>
    <h1>Hello, ''' + user['nickname'] + '''</h1>
  </body>
</html>
'''
<html>
  <head>
    <title>{{ title }} - microblog</title>
  </head>
  <body>
      <h1>Hello, {{ user.nickname }}!</h1>
  </body>
</html>
from flask import render_template
from app import app

@app.route('/')
@app.route('/index')
def index():
    user = {'nickname': 'Miguel'}  # fake user
    return render_template('index.html',
                           title='Home',
                           user=user)

Questions?

anthony@blar.do

About

We can poke a web app, now what?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published