Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Dec. 7, 2010 13:51:12

sami n.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

WEB service using Restify


THANKS FOR NOTIFICATION

I am trying to do webservice with RESTfull web service but i dint create models

my view file looks like this
from django.http import *
import urllib

def current_datetime(request):
word = request.GET

message=urllib.urlopen('http://m.broov.com/wap/di/sub?word='+word+'&type=00submit=Submit',)
return HttpResponse(message)

My url looks like this (r'^wap/di/sub/',current_datetime ),
i want to restify my view but all examples are showing oly models .py
now i need help to do that
THANKS

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Dec. 7, 2010 14:46:17

Tom E.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

WEB service using Restify


On Tue, Dec 7, 2010 at 1:50 PM, sami nathan <itssami.g...@gmail.com> wrote:
> THANKS FOR NOTIFICATION
>
> I am trying to do webservice with RESTfull web service but i dint create
> models
>
> my view file looks like this
> from django.http import *
> import urllib
>
> def current_datetime(request):
>    word = request.GET
>    
> message=urllib.urlopen('http://m.broov.com/wap/di/sub?word='+word+'&type=00submit=Submit',)
>    return HttpResponse(message)
>
> My url looks like this (r'^wap/di/sub/',current_datetime ),
> i want to restify my view but all examples are showing oly models .py
>  now i need help to do that
> THANKS
>

I can't understand what you are trying to do. You have a view called
current_datetime, which then queries a WML service that seems to look
up words in a dictionary (ie nothing to do with dates or times), and
you then say you want to 'restify my view'..

What precisely is it that you want to 'restify' about this view? Do
you want POST requests to the service URL to create new entries in
this dictionary, DELETE requests to remove words? Typically REST
examples only show interaction with models, because REST is usually
used to provide state-less web services for accessing collections of
objects. You aren't doing any of that..

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 21st of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support