I added like following in app.yaml
application: mywebfont
version: 1
runtime: python
api_version: 1
handlers:
- url: /font/.*
script: font.py
- url: /
static_files: html/index.html
upload: static_files
- url: .*
script: main.py
It's working fine in localhost.
After deploy , I can't check my application home page. It's always show 404 not found error.
try with:
application: mywebfont
version: 1
runtime: python
api_version: 1
handlers:
- url: /font/.*
script: font.py
- url: /
static_files: html/index.html
upload: html/index.html
- url: .*
script: main.py
Related
I was working on google Pubsub with App Engine, to get notifications from google play about InApp subscriptions status.
When I deploy my app with the command "gcloud app deploy", error message comes:
ERROR: (gcloud.app.deploy) An error occurred while parsing file: [/home/testaccount/php-docs-samples/pubsub/app/app.yaml]
Unable to assign value 'pubsub.js' to attribute 'url':
Value 'pubsub.js' for url does not match expression '^(?:(?!^)/.|..|((.).*(?!$).)$'
in "/home/testaccount/php-docs-samples/pubsub/app/app.yaml", line 6, column 8
My app.yaml file:
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: pubsub.js
static_files: pubsub.js
- url: /.*
script: index.php
env_variables:
GOOGLE_PROJECT_ID: "testproject"
I have followed the insturctions in the linl:
Writing and Responding to Pub/Sub Messages
I did not modify app.yaml file, I do not know what is going on? I tried to deploy "Hello, World!" for PHP on App Engine" exmaple and it worked.
Please help me to solve it.
url should start with a slash. Try:
- url: /pubsub.js
static_files: pubsub.js
After a week searching about why I get HTTP error 500 (Internal Server Error) when I browse https://testproject.uc.r.appspot.com/, I got the reason, it was from app.yaml file, all errors came from php version.
Old app.yaml:
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /pubsub.js
static_files: pubsub.js
upload: pubsub.js
- url: /.*
script: index.php
env_variables:
GOOGLE_PROJECT_ID: "testproject"
New app.yaml:
runtime: php72
handlers:
- url: /pubsub.js
static_files: pubsub.js
upload: pubsub.js
- url: /.*
script: auto
env_variables:
GOOGLE_PROJECT_ID: "testproject"
Thank God.
Built a personal blog using jekyll. Everything works well on local host. I do not want to deploy it on github. I prefer hosting on google app engine for some reasons.
I followed some instructions online and copied _site folder generated to my google app engine project.
this is how app.yaml looks like:
application: myblog
version: 1
runtime: python27
api_version: 1
threadsafe: yes
error_handlers:
- file: /404.html
handlers:
- url: /
static_files: _site/index.html
upload: _site/index.html
- url: /(.*)
static_files: _site/\1
upload: _site/(.*)
libraries:
- name: webapp2
version: "2.5.2"
when i run it locally on google app engine, only the index.html and some other files displays. others shows page not found. Is there anything I am not implementing properly ?
Well, I finally figure it out. It is a little trick anyway.
First in your _config.yaml file add:
permalink: /posts/:title/index.html
after that, run jekyll serve to generate the static file in _site folder. Copy the the post folder to _site/ in your app engine project.
Then, in your _config.yaml file change permalink to:
permalink: /posts/:title
run jekyll serve to generate the static file in _site. Copy the entire files generated excluding posts folder into _site/ into your app engine project.
then, make your appengine app.yaml look somewhat like this:
application: myblog
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /(.*\.js)
mime_type: text/javascript
static_files: _site/\1
upload: _site/(.*\.js)
- url: /(.*\.(jpg|png|ico))
static_files: _site/\1
upload: _site/(.*\.img)
- url: /(.*\.css)
mime_type: text/css
static_files: _site/\1
upload: _site/(.*\.css)
- url: /(.*\.(eot|svg|svgz|otf|ttf|woff|woff2))
static_files: _site/\1
upload: _site/(.*\.fonts)
- url: /
static_files: _site/index.html
upload: _site/index.html
- url: /(.+)/
static_files: _site/\1/index.html
upload: _site/(.+)/index.html
expiration: "15m"
- url: /(.+)
static_files: _site/\1/index.html
upload: _site/(.+)/index.html
expiration: "15m"
- url: /(.*)
static_files: _site/\1
upload: _site/(.*)
#- url: /((tags)|(archive)|(about)|(posts)|(fonts))/
libraries:
- name: webapp2
version: "2.5.2"
see example for clarification
Really simple setup; I just want to access any php file from the api folder (technically would like to specifiy /api/.* or something along that lines to include any subfolders) but this setup only returns 404; I have a feeling it is completely ignoring this line - url: /api/app/(.+\.php)$ because if I type asdfasdf.appspot.com/api/app/main.php (there is a main.php in the root directory) it loads. So this tells me it is staying in the root path the whole time. Any suggestions?
application: fsfhakjsldhf9
version: 1
runtime: php55
api_version: 1
threadsafe: yes
env_variables:
MYSQL_DSN: mysql:unix_socket=/cloudsql/fudfsy9:us-central1:fuasdfe-prod1;dbname=f25dsfss9
MYSQL_USERNAME: fddadfs
MYSQL_PASSWORD: 'asfdasdff'
MYSQL_DATABASE: 'asdfasdf'
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /files
static_dir: files
- url: /api/app/(.+\.php)$
script: \1
secure: always
- url: /.*
script: main.php
The - url: /api/app/(.+\.php)$ also needed script: /api/app/\1 to match
When I was trying to run one of the application on google app engine I keep on getting a yell icon the means error. How can I fix it ,so I can run my application.
The error is one the left end side of hello-udacity
Here is the link of the picture of the error: https://plus.google.com/u/1/115545843446144625696/posts/aoRyoN2r2Sd?pid=6168940381509733874&oid=115545843446144625696
In main.py
import webapp2
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello udacity!')
app = webapp2.WSGIApplication([('/', MainHandler)],
debug=True)
In app.yaml
application: hello-udacity
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
The app.yaml file uses the YAML syntax and so your app.yaml should comply with those. The following is a clearer configuration
application: hello-udacity
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
For more on this see about app.yaml in the developer docs
If i have a url like this www.myurl.com/test#test.com I would like to get the index.html
if I dont have the mail I want the same.
application: myapp
version: 1
runtime: python
api_version: 1
handlers:
- url: /AJAX
script: main.py
- url: /
static_files: static_files/index.html
upload: static_files
- url: /
static_dir: static_files
- url: /*
static_files: static_files/index.html
upload: static_files
If you change the last section in the handler group to
- url: /.*
static_files: static_files/index.html
upload: static_files
it should match any URL.