locally generic views works because in your models (if you used the scaffolding app it's in db.py) you have
response.generic_patterns = ['*'] if request.is_local else [] On Saturday, December 29, 2012 5:47:55 AM UTC+1, Alec Taylor wrote: > > Thanks, that did the trick. > > Strange that it had different results locally though… > > On Sat, Dec 29, 2012 at 3:42 PM, Bruno Rocha > <[email protected]<javascript:>> > wrote: > > add > > > > response.generic_patterns = ["*.json"] to your models or even to your > > controller > > > > > > [appname/controllers/api.py] > > > > response.generic_patterns = ['*.json'] > > > > @service.json > > def v1(): > > return dict(version=0.5) > > > > > > On Sat, Dec 29, 2012 at 2:34 AM, Alec Taylor > > <[email protected]<javascript:>> > wrote: > >> > >> [appname/controllers/api.py] > >> @service.json > >> def v1(): > >> return dict(version=0.5) > >> > >> curl -X GET http://localhost/api/v1.json > >> {"version": 0.5} > >> > >> curl -X GET http://appname.herokuapp.com/api/v1.json > >> <html><body><h1>invalid view (api/v1.json)</h1></body></html><!-- > >> > >> > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > > > >> //--> > >> > >> ---------- > >> > >> The application itself is identical; to be specific I created a hard > >> link from my heroku app to my local web2py folder. > >> > >> How do I get JSON services working remotely? > >> > >> Thanks for all suggestions, > >> > >> Alec Taylor > >> > >> -- > >> > >> > >> > > > > -- > > > > > > > --

