Hello JR,

Can you try the following items:

1. Deploy into AppEngine production (use another app ID) and see if your 
application works there. Sometimes the dev environment doesn't quite match 
with appengine-prod. Also, are you using the new python dev appserver 
(released in patch 1.7.6) or the old dev appserver (previous to 1.7.6)?

2. Which directory is your application's root directory? Is it 
/vagrant/test or /vagrant/test/application? I don't know how your dev 
environment is set up, but traditionally /application (or some synonym) is 
the root directory for an app. Try this app.yaml change:

- url: /test
  static_dir: static/test
  application_readable: true


3. Try declaring paths as relative paths from your python script. For 
instance, if your script is at /application/python/script.py and your 
static asset is at /application/static/staticimage.jpg, try referring to 
the image by saying "*../static/staticimage.jpg*".



-----------------
-Vinny P
Technology & Media Advisor
Chicago, IL

My Go side project: http://invalidmail.com/



On Monday, May 13, 2013 4:02:32 PM UTC-5, JR wrote:
>
> I've been trying to understand how the application_readable static url 
> handler field works. I've set this to true on an application in my dev 
> environment, but I can't seem to actually read the file:
>
> # app.yaml
>
> - url: /test
>   static_dir: application/static/test
>   application_readable: true
>
> # app.py
>
> path = os.path.join(os.path.split(__file__)[0], 'static/test/test.png')
> self.response.out.write('Looking for %s...' % path)
> self.response.out.write(os.path.exists(path))
> self.response.out.write("\n")
> path = '/application/static/test/test.png'
> self.response.out.write('Looking for %s...' % path)
> self.response.out.write(os.path.exists(path))
> self.response.out.write("\n")
> path = 'application/static/test/test.png'
> self.response.out.write('Looking for %s...' % path)
> self.response.out.write(os.path.exists(path))
> self.response.out.write("\n")
> path = '/static/test/test.png'
> self.response.out.write('Looking for %s...' % path)
> self.response.out.write(os.path.exists(path))
> self.response.out.write("\n")
> path = 'static/test/test.png'
> self.response.out.write('Looking for %s...' % path)
> self.response.out.write(os.path.exists(path))
> self.response.out.write("\n")
> path = '/test/test.png'
> self.response.out.write('Looking for %s...' % path)
> self.response.out.write(os.path.exists(path))
> self.response.out.write("\n")
> path = 'test/test.png'
> self.response.out.write('Looking for %s...' % path)
> self.response.out.write(os.path.exists(path))
> self.response.out.write("\n")
> path = '/test.png'
> self.response.out.write('Looking for %s...' % path)
> self.response.out.write(os.path.exists(path))
> self.response.out.write("\n")
> path = 'test.png'
> self.response.out.write('Looking for %s...' % path)
> self.response.out.write(os.path.exists(path))
>
> But none of those work:
>
> Looking for /vagrant/test/application/static/test/test.png...False
> Looking for /application/static/test/test.png...False
> Looking for application/static/test/test.png...False
> Looking for /static/test/test.png...False
> Looking for static/test/test.png...False
> Looking for /test/test.png...False
> Looking for test/test.png...False
> Looking for /test.png...False
> Looking for test.png...False
>
> Though the file definitely exists:
>
> vagrant@precise64:/vagrant/kissyface$ ls -l 
> /vagrant/test/application/static/test/test.png
> -rwxrwxrwx 1 vagrant vagrant 9920 May  3 18:13 
> /vagrant/test/application/static/test/test.png
>
> Can anyone tell me what I'm doing wrong? I haven't been able to find any 
> documentation or example code for this beyond the brief description in the 
> statis url handler docs and a mention in the appengine sdk 1.7.6 changelog. 
> Is there a utility class that provides access to these files, or am I 
> completely misinterpreting what application_readable is actually supposed 
> to do?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to