Migrating static contents from Page Creator to App Engine
I used Google Page Creator with Google Apps to host some static files, but it’s going to be closed soon. So, I migrated these contents to Google App Engine.
References
Create Account
- Login to Google App Engine with your Google Account
- Input your SMS account to receive App Engine Code.
- Press Create Application and input Google App Engine Code
- Input Application ID and Title
Set up Application with Google App Engine Launcher (Mac OSX)
- Download Google App Engine SDK
- Put Google App Engine Launcher to Application
- Run Google App Engine Launcher
- Click ‘+’ to Create Application
- Input Application name and specify directory for your application
- Press Create
Create Directory for static contents
-
Create directory under your application directory (*.yaml and main.py have been created when you create application with the above steps.)
yourappdirectory/ +- assets/ | +- archives/ | +- css/ | +- html/ | +- img/ | +- js/ | +- xml/ | +- app.yaml +- index.yaml +- main.py -
Edit app.yaml file in your root directory (application directory, yourappdirectory/app.yaml in the above example.)
application: yourappname version: 1 runtime: python api_version: 1 handlers: - url: /(.*\.zip) static_files: assets/archive/\1 upload: assets/archive/(.*\.zip) - url: /(.*\.css) static_files: assets/css/\1 upload: assets/css/(.*\.css) - url: /(.*\.html) static_files: assets/html/\1 upload: assets/html/(.*\.html) - url: /(.*\.(gif|png|jpg)) static_files: assets/img/\1 upload: assets/img/(.*\.(gif|png|jpg)) - url: /(.*\.js) static_files: assets/js/\1 upload: assets/js/(.*\.js) - url: /(.*\.xml) static_files: assets/xml/\1 upload: assets/xml/(.*\.xml) - url: / static_files: assets/html/index.html upload: assets/html/index.html - url: /index.html static_files: assets/html/index.html upload: assets/html/index.html - url: .* script: main.py
As you may noticed, in the above app.yaml example, all static files are accessible on root directory. This is because I uplaoded these files on root directory by Google Page Creator and I don’t want to change link to my static files.
Testing
- Press Run button on Google App Engine Launcher
- Access to http://localhost:8080/
Deploy
Google App Engine Launcher provides one click deployment. You just need to click Deploy in the toolbar.
Integrate with Google Apps
- Login to Google App Engine dashboard
- Go to ‘Versions’ under Administration menu in the sidebar
- Press ‘Add Domain’ button in ‘Domain Setup’
- Input your Domain Name and press ‘Add Dmain’ button
- In Google Apps Control Panel, check agreement and press ‘Activate This Service’
- You can set up subdomain for your App Engine
- Set up DNS of your domain. Add ‘ghs.google.com.’ for the subdomain to your ‘CNAME’ setting