Django-tastypie checking of csrf token in requests

2015-08-14 Thread Rene Zelaya
Hi everyone, We have a REST API built using django-tastypie, which most of our users access through our web application. However, we do have users that make requests to the API programmatically (using the python 'requests' library, for example) and use an OAuth token to do so (we have already

Re: Can u tell me how to build restful api project in django

2015-08-14 Thread Rene Zelaya
I have found django-tastypie very useful to create a REST API: https://github.com/django-tastypie/django-tastypie Here are the docs: http://django-tastypie.readthedocs.org/en/latest/index.html#quick-start Best, Rene On Friday, August 14, 2015 at 10:22:40 AM UTC-4, HARSHIT GARG wrote: > > I am

Re: I can't run django server nor activate the virtualenv

2014-04-29 Thread Rene Zelaya
Hi Fred, Yes, definitely, I think you should run it on a Ubuntu terminal - I'm not that familiar with the Windows terminal On Monday, April 28, 2014 10:10:29 AM UTC-4, Fred DJar wrote: > > Thanks Rene > The virtualenv was created in Ubuntu but now i'm running windows, should i > run it in

Re: I can't run django server nor activate the virtualenv

2014-04-28 Thread Rene Zelaya
Hi Fred - So if you can't activate your virtualenv, and you installed Django in that virtualenv, that is likely the root of your problem, because without it, none of the modules will appear as installed and you will not be able to run the server (or access the python manage.py shell, etc). I

Re: IndentationError :Unexpected Indent

2014-04-28 Thread Rene Zelaya
Ditto from what Andreas said - Python is very sensitive to indentation. If the method 'was_published_recently' is part of the Poll model, then there should be the same amount of indentations before 'def was_published...' as for the 'def __unicode__' method. Then, for uniformity's sake (even

Re: django model(s) silently fails to sync to the DB ( for no apparent reason )

2013-10-08 Thread Rene Zelaya
Hey Doug, Any chance you haven't included those models in the INSTALLED_APPS in your settings.py file? Best, Rene On Monday, October 7, 2013 9:40:33 PM UTC-4, Doug S wrote: > > I don't think I'm making a rookie mistake, I've looked over my code > several times. > I've got two pretty simple

Re: Django Tastypie: Getting MultipleObjects returned

2013-07-15 Thread Rene Zelaya
Hey everyone, So I figured out what was going on in my code - apparently, when adding items to a ToManyField through the API, this requires a specific format, namely: ["api/v1/exampleResource/1/","api/v1/exampleResource/2/","api/v1/exampleResource/3/"] Note the lack of any spacing, the

Django Tastypie: Getting MultipleObjects returned

2013-07-10 Thread Rene Zelaya
Hey everyone, While using the Tastypie API, I have been getting a MultipleObjectsReturned error somehow when obj_get gets called. I feed a Resource URI to a ToManyField for one of the resources and somehow I get this error. This has me really frustrated, since I thought that by giving it a

dictionary update sequence

2013-06-07 Thread Rene Zelaya
Hi, I am getting the following error when the server tries to load one of my templates and I am not sure what the problem is: dictionary update sequence element #0 has length 1; 2 is required The error occurs at the following line in my template: However, I thought I was already passing it