3

I'm redirecting everything to a single file in my app.yaml like so

- url: /.*
  script: frontcontroller.application

but I still have to use robots.txt, which causes an error when I do

- url: /robots.txt
  static_files: robots.txt

- url: /.*
  script: frontcontroller.application

the error is " missing "upload" attribute for URL robots.txt, I understand that it requires a third option like so

- url: robots.txt
  static_files: robots.txt
  upload: ??????

what would the proper value be for the upload attribute?

KaekeaSchmear
  • 1,388
  • 4
  • 16
  • 28

2 Answers2

1

You should include the actual path to the file that you want to upload, which in your case is the robots.txt:

- url: robots.txt
  static_files: robots.txt
  upload: robots.txt

For more read the: Python Application Configuration.

Lipis
  • 19,958
  • 18
  • 88
  • 117
  • is there any reason for it working even with a random value? what exactly does it serve for in this context? – KaekeaSchmear Apr 16 '13 at 15:35
  • @CakeSneer what do you mean by random value? `robots.txt` is not exactly random.. for more I included the link to the docs where you can read more on the matter.. – Lipis Apr 16 '13 at 15:38
  • I read that before, what I meant was that it even works fine if you use " upload: whatever ", and there is no example using a static file in there either. I'm simply wondering why the handler has to be aware in this specific case, as its not a dynamic URL – KaekeaSchmear Apr 16 '13 at 15:42
  • @CakeSneer Read this section in particular: https://developers.google.com/appengine/docs/python/config/appconfig#Static_File_Pattern_Handlers and I'm pretty sure that it won't work when you will deploy your app if it has some random value there.. – Lipis Apr 16 '13 at 15:48
  • Still don't get it, I do not see how it works with any value, if it works with any value - why would it require it for static_files in the first place? – KaekeaSchmear Apr 16 '13 at 15:50
  • @CakeSneer In that simple case maybe you think that it might not make any sense.. but read carefully what each field is there for and things are getting more complicated when you have multiple directories with different patterns and URLs.. I'm still not sure what you mean by "any value", because in the documentation is pretty clear on what is what and why.. – Lipis Apr 16 '13 at 15:52
  • Nevermind. The thing that confused me was that it worked with any upload attribute value on the dev server, but I just figured it doesn't in production. Thank you :-) – KaekeaSchmear Apr 16 '13 at 16:28
0

Here's how I understand it:

static_file field let you specify the mapping used to serve the static file request.

upload field is used to distinguish between script file and a static file.

Sam G
  • 473
  • 4
  • 4