Skip to main content

Posts

Showing posts with the label application

Code for Uploading Static Files to Google App Engine

All the magic behind hosting websites with Google App Engine are two files –  app.yaml and main.py - that are responsible for all the magic.  With app.yaml, Share a list of files with Google App Engine SDK that should be uploaded only while main.py file handles the HTTP requests when serving the website. 1. Source code for app.yaml application: (application name) version: 1 runtime: python api_version: 1 handlers: - url: /(.*\.(gif|png|jpg|ico|js|css))   static_files: \1   upload: (.*\.(gif|png|jpg|ico|js|css)) - url: .*   script: main.py 2. Source code for main.py import os from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.ext.webapp import template class MainHandler(webapp.RequestHandler):   def get (self, q):     if q is None:       q = 'index.html'     path = os.path.join (os.path.dirname (__file__), q)     self.response.headers...

Host website on Google App Engine

Advantages of hosting websites on Google App Engine It is more reliable since site will get served through Google’s own data centers.   For low traffic website, it is highly likely that you won’t need to spend a penny for web hosting. Google App Engine hosting - Step 1: Go to appengine.google.com and create a new application.  For new user need to verify your mobile number before create a new app.  Step 2: Give your application a name – it should be unique and may only include lowercase alphabets and digits. For this example, our app identifier is “dtcrunch”. Step 3: Now you require two files download it and install it. These help you to upload file to Google.                  3a. Download and install Python from python.org .                  3b. Download and install App Engine SDK from this code.google.com . ...

Add Facebook Comments to Your Blog

Add Facebook Comments to Your Blog Want to add Facebook Comments to your blog? Here I will show how you can do that by Facebook Social Plugin. Facebook Social Plugin allow to add Facebook Comments to your blog. This Facebook Commenting System can be added to any webpage or any website. Install Facebook Comments Step 1. Get Application ID by registering your site on Facebook developers to use Facebook Comments Pluging. Step 2. Go to the Facebook Comments Plugin page , and fill up the details to get code instantly.  Then you can also “Administer Comments”. There is also an inbuilt Like button which shows the number of likes on each page. Replace WordPress comments: You can remove WordPress Comment box by editing the single.php file, but that will remove all comments from your site.