This repository was archived by the owner on Oct 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ # [START mod0_baseline]
1516import os
1617import webapp2
1718from google .appengine .ext import ndb
@@ -41,3 +42,4 @@ def get(self):
4142app = webapp2 .WSGIApplication ([
4243 ('/' , MainHandler ),
4344], debug = True )
45+ # [END mod0_baseline]
Original file line number Diff line number Diff line change 2222ds_client = ndb .Client ()
2323HOUR = 3600
2424REDIS_HOST = os .environ .get ('REDIS_HOST' , 'localhost' )
25- REDIS_PORT = os .environ .get ('REDIS_PORT' , ' 6379' )
25+ REDIS_PORT = os .environ .get ('REDIS_PORT' , 6379 )
2626REDIS = redis .Redis (host = REDIS_HOST , port = REDIS_PORT )
2727
2828class Visit (ndb .Model ):
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ # [START mod1b_flask]
1516from flask import Flask , render_template , request
1617from google .appengine .api import wrap_wsgi_app
1718from google .appengine .ext import ndb
@@ -38,3 +39,4 @@ def root():
3839 store_visit (request .remote_addr , request .user_agent )
3940 visits = fetch_visits (10 )
4041 return render_template ('index.html' , visits = visits )
42+ # [END mod1b_flask]
You can’t perform that action at this time.
0 commit comments