Re: Problem with Crispy-Forms
I was able to fumble my way through to the solution. What I think was missing from the TEASER example was to add "CRISPY_TEMPLATE_PACK = 'bootstrap3' " to the settings.py file. Once this was added, the radio buttons properly displayed under one another. It was kind of fun picking my way through the users group, which is where I found the necessary option. Thanks much for your assistance. On Monday, September 26, 2016 at 6:21:49 AM UTC-4, Jeff Silverman wrote: > I created an example application using Crispy-Forms. In forms.py I am > using > > radio_buttons = forms.ChoiceField( > choices = (('option_one', 'Option one is this and that be sure to > include why it is great'),('option_two', 'Option two can is something else > and selecting it will deselect option one')), > widget = forms.RadioSelect, > initial = 'option_two', > ) > > However, when I execute, the two options appear on the same line. can > anyone tell me what I did wrong? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c2e00e9b-7098-4cc7-add5-f14af94bc014%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Problem with Crispy-Forms
Thanks for the explanation. I think I get it. Does that, however, explain why the Radio buttons don't display on separate lines? The "teaser" example on GITHUB shows the output cleanly space on separate lines. That's the part I don't quite understand. On Monday, September 26, 2016 at 6:21:49 AM UTC-4, Jeff Silverman wrote: > > I created an example application using Crispy-Forms. In forms.py I am > using > > radio_buttons = forms.ChoiceField( > choices = (('option_one', 'Option one is this and that be sure to > include why it is great'),('option_two', 'Option two can is something else > and selecting it will deselect option one')), > widget = forms.RadioSelect, > initial = 'option_two', > ) > > However, when I execute, the two options appear on the same line. can > anyone tell me what I did wrong? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d22d8604-1c11-4d31-9ddb-76b7ab3edd12%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Problem with Crispy-Forms
Followup. I am playing with the teaser application on GITHUB. One more thing, which may be the problem, and keep in mind I am new to DJANGO and Python... What goes into the base.html file? On Monday, September 26, 2016 at 6:21:49 AM UTC-4, Jeff Silverman wrote: > I created an example application using Crispy-Forms. In forms.py I am > using > > radio_buttons = forms.ChoiceField( > choices = (('option_one', 'Option one is this and that be sure to > include why it is great'),('option_two', 'Option two can is something else > and selecting it will deselect option one')), > widget = forms.RadioSelect, > initial = 'option_two', > ) > > However, when I execute, the two options appear on the same line. can > anyone tell me what I did wrong? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d7b92aa1-6722-44f9-88fd-e562a4d76045%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Problem with Crispy-Forms
I created an example application using Crispy-Forms. In forms.py I am using radio_buttons = forms.ChoiceField( choices = (('option_one', 'Option one is this and that be sure to include why it is great'),('option_two', 'Option two can is something else and selecting it will deselect option one')), widget = forms.RadioSelect, initial = 'option_two', ) However, when I execute, the two options appear on the same line. can anyone tell me what I did wrong? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1b0f6ca4-37f6-4870-9a8e-6030f9436964%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: sqlite3.NotSupportedError: URIs not supported
Well I may have answered my own question. Seems it may be a version incompatibility. I built another virtual environment at Python 2.7 and the error is gone. Also I am using the pycontrol module which is also not work g with Python 3.4. On Wednesday, August 24, 2016, Jeff Silverman wrote: > Can anyone point me in the right direction to solve this? I am running > DJANGO with python3.4 in virtualenv. I get this error running manage.py. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com > > . > To post to this group, send email to django-users@googlegroups.com > . > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-users/0bce8a95-b735-4f45-ad41-13f1e7429ed7%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/0bce8a95-b735-4f45-ad41-13f1e7429ed7%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAG09YoU0SLb-6YbDDaFLZ8f9Ff8L70YigxeHuZh2_SpvF9g1vw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
sqlite3.NotSupportedError: URIs not supported
Can anyone point me in the right direction to solve this? I am running DJANGO with python3.4 in virtualenv. I get this error running manage.py. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0bce8a95-b735-4f45-ad41-13f1e7429ed7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django-registration tutorial + code
I'm new as well, but I have run into similar issues when I don't have the environment settings assigned properly. On Mon, Jul 9, 2012 at 12:03 AM, scoop wrote: > i installed registration, added registration to installed apps and used > your > templates. > > i nav to accounts/register , enter the info and as i continue it breaks > with > the following: > > DoesNotExist at /accounts/register/ > Site matching query does not exist. > Request Method: POST > Request URL:http://spenv.local/accounts/register/ > Django Version: 1.4 > Exception Type: DoesNotExist > Exception Value: > Site matching query does not exist. > Exception Location: > /usr/lib/python2.7/site-packages/django/db/models/query.py in get, line 366 > > I'm pretty new to django so I'm slightly confused. I looked at the > documentation and there doesn't seem to be anything that I understand to > fix > this. > > -- > View this message in context: > http://python.6.n6.nabble.com/Django-registration-tutorial-code-tp4974793p4981365.html > Sent from the django-users mailing list archive at Nabble.com. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Still need help with the 405....please
Nik I was trying to figure out how to make web services on such a way that I could import the wsdl into an info path form eventually pulling data from f5 ltm devices. Sort of ambitious I think but djamgo is supposed to be easy. Not. On Friday, July 6, 2012, Nikolas Stevenson-Molnar wrote: > Out of curiosity, what is your end-goal with this? > > _Nik > > On 7/6/2012 12:44 PM, Jeff Silverman wrote: > > Nik, I appreciate your help, but I'm about at the end with this. I'm > > throwing in the towel. > > > > On Jul 6, 1:40 pm, Nikolas Stevenson-Molnar > > wrote: > >> I'm not exactly sure, I usually try to avoid SOAP. But perhaps something > >> like this?http://www.w3schools.com/soap/soap_example.asp. You'll have > >> to modify it to match your SOAP app, of course. > >> > >> Depending on what you're trying to accomplish, SOAP may not be your best > >> option. I tend to prefer REST, and there are some good Django-compatible > >> libraries for implementing REST interfaces: > http://django-rest-framework.org/(for example; there are others as well) > >> > >> _Nik > >> > >> On 7/6/2012 10:32 AM, Jeff Silverman wrote: > >> > >> > >> > >>> What should the XML look like? > >>> On Jul 6, 12:03 pm, Nikolas Stevenson-Molnar > >>> wrote: > >>>> Perhaps it's expecting XML in the request and trying to parse your > POST data (which is not XML)? > >>>> _Nik > >>>> On Jul 6, 2012, at 6:03 AM, Jeff Silverman wrote: > >>>>> Ok Nik. I have removed the CSRF middleware and get a brand new > error. > >>>>> XMLSyntaxError at /hello/ > >>>>> error parsing attribute name, line 1, column 6Request Method: POST > >>>>> Request URL:http://piadm42.troweprice.com:/hello/ > >>>>> Django Version: 1.3.1 > >>>>> Exception Type: XMLSyntaxError > >>>>> Exception Value: error parsing attribute name, line 1, column 6 > >>>>> Exception Location: /usr/lib/python2.6/site-packages/ > >>>>> soaplib-2.0.0_beta1-py2.6.egg/soaplib/core/_base.py in > >>>>> _parse_xml_string, line 248 > >>>>> Python Executable: /usr/bin/python > >>>>> Python Version: 2.6.6 > >>>>> The POST in fiddler is something like this -> > http://mysite.com:/hello/ > >>>>> and the request body contains -> > >>>>> On Jul 5, 10:35 pm, Nikolas Stevenson-Molnar > > >>>>> wrote: > >>>>>> Yes, I would expect a 403 when the CSRF middleware is active, the > >>>>>> decorator is not used, and no CSRF token is provided. This is the > >>>>>> intended behavior. You can fix this in a few ways: > >>>>>> 1. Apply the decorator to the __call__ method (rather than to the > class > >>>>>> itself). If I understand how this code works, that should > correctly > >>>>>> disable CSRF for the view. > >>>>>> 2. Provide a CSRF value with the POST data, as you suggested. This > all > >>>>>> depends on how the request is made. Django's CSRF system relies > on a > >>>>>> CSRF value set in a cookie. You have to mimic a browsers cookie > >>>>>> functionality, then use the value of the CSRF cookie with evey > >>>>>> request you make. By default, the cookie name is 'csrftoken'. > For > >>>>>> more info on the CSRF process: > >>>>>>https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/ > >>>>>> 3. Disable CSRF altogether. Simply remove the CsrfViewMiddleware > from > >>>>>> your settings and you're good to go. > >>>>>> _Nik > >>>>>> On 7/5/2012 6:22 PM, Jeff Silverman wrote: > >>>>>>> Nik, if I remove the csrf decorator and leave the middleware in > place, > >>>>>>> I get the 403. Is there a way to add the token on the POST > command, > >>>>>>> or is there another way of leaving th -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Still need help with the 405....please
Nik, I appreciate your help, but I'm about at the end with this. I'm throwing in the towel. On Jul 6, 1:40 pm, Nikolas Stevenson-Molnar wrote: > I'm not exactly sure, I usually try to avoid SOAP. But perhaps something > like this?http://www.w3schools.com/soap/soap_example.asp. You'll have > to modify it to match your SOAP app, of course. > > Depending on what you're trying to accomplish, SOAP may not be your best > option. I tend to prefer REST, and there are some good Django-compatible > libraries for implementing REST > interfaces:http://django-rest-framework.org/(for example; there are others as > well) > > _Nik > > On 7/6/2012 10:32 AM, Jeff Silverman wrote: > > > > > What should the XML look like? > > > On Jul 6, 12:03 pm, Nikolas Stevenson-Molnar > > wrote: > >> Perhaps it's expecting XML in the request and trying to parse your POST > >> data (which is not XML)? > > >> _Nik > > >> On Jul 6, 2012, at 6:03 AM, Jeff Silverman wrote: > > >>> Ok Nik. I have removed the CSRF middleware and get a brand new error. > >>> XMLSyntaxError at /hello/ > >>> error parsing attribute name, line 1, column 6Request Method: POST > >>> Request URL:http://piadm42.troweprice.com:/hello/ > >>> Django Version: 1.3.1 > >>> Exception Type: XMLSyntaxError > >>> Exception Value: error parsing attribute name, line 1, column 6 > >>> Exception Location: /usr/lib/python2.6/site-packages/ > >>> soaplib-2.0.0_beta1-py2.6.egg/soaplib/core/_base.py in > >>> _parse_xml_string, line 248 > >>> Python Executable: /usr/bin/python > >>> Python Version: 2.6.6 > >>> The POST in fiddler is something like this -> > >>> http://mysite.com:/hello/ > >>> and the request body contains -> > >>> On Jul 5, 10:35 pm, Nikolas Stevenson-Molnar > >>> wrote: > >>>> Yes, I would expect a 403 when the CSRF middleware is active, the > >>>> decorator is not used, and no CSRF token is provided. This is the > >>>> intended behavior. You can fix this in a few ways: > >>>> 1. Apply the decorator to the __call__ method (rather than to the class > >>>> itself). If I understand how this code works, that should correctly > >>>> disable CSRF for the view. > >>>> 2. Provide a CSRF value with the POST data, as you suggested. This all > >>>> depends on how the request is made. Django's CSRF system relies on a > >>>> CSRF value set in a cookie. You have to mimic a browsers cookie > >>>> functionality, then use the value of the CSRF cookie with evey > >>>> request you make. By default, the cookie name is 'csrftoken'. For > >>>> more info on the CSRF process: > >>>> https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/ > >>>> 3. Disable CSRF altogether. Simply remove the CsrfViewMiddleware from > >>>> your settings and you're good to go. > >>>> _Nik > >>>> On 7/5/2012 6:22 PM, Jeff Silverman wrote: > >>>>> Nik, if I remove the csrf decorator and leave the middleware in place, > >>>>> I get the 403. Is there a way to add the token on the POST command, > >>>>> or is there another way of leaving the middleware in place, but turn > >>>>> off csrf without using the decorator? > >>>>> On Thursday, July 5, 2012 8:33:51 PM UTC-4, Jeff Silverman wrote: > >>>>> Nik, I will give that a try. The reason for the decorator was > >>>>> that I was getting 403 forbidden, and the decorator made that one > >>>>> go away. If I remove the csrf from the settings file, will that > >>>>> solve that problem? > >>>>> On Tuesday, July 3, 2012 9:32:20 AM UTC-4, Jeff Silverman wrote: > >>>>> Below is the code from the views.py > >>>>> The405is retunred from the 'return super(DjangoSoapApp, > >>>>> self).__init__(Application(services, tns))' statement. I am > >>>>> using > >>>>> python 2.6, soaplib20 and django 1.3. I am struggling to > >>>>> understand > >>>>> what exactly is wrong here. > >>>>> class HelloWorldService(DefinitionBase): > >>>>> @s
Re: Still need help with the 405....please
What should the XML look like? On Jul 6, 12:03 pm, Nikolas Stevenson-Molnar wrote: > Perhaps it's expecting XML in the request and trying to parse your POST data > (which is not XML)? > > _Nik > > On Jul 6, 2012, at 6:03 AM, Jeff Silverman wrote: > > > > > Ok Nik. I have removed the CSRF middleware and get a brand new error. > > > XMLSyntaxError at /hello/ > > error parsing attribute name, line 1, column 6Request Method: POST > > Request URL:http://piadm42.troweprice.com:/hello/ > > Django Version: 1.3.1 > > Exception Type: XMLSyntaxError > > Exception Value: error parsing attribute name, line 1, column 6 > > Exception Location: /usr/lib/python2.6/site-packages/ > > soaplib-2.0.0_beta1-py2.6.egg/soaplib/core/_base.py in > > _parse_xml_string, line 248 > > Python Executable: /usr/bin/python > > Python Version: 2.6.6 > > > The POST in fiddler is something like this -> http://mysite.com:/hello/ > > and the request body contains -> > > > On Jul 5, 10:35 pm, Nikolas Stevenson-Molnar > > wrote: > >> Yes, I would expect a 403 when the CSRF middleware is active, the > >> decorator is not used, and no CSRF token is provided. This is the > >> intended behavior. You can fix this in a few ways: > > >> 1. Apply the decorator to the __call__ method (rather than to the class > >> itself). If I understand how this code works, that should correctly > >> disable CSRF for the view. > >> 2. Provide a CSRF value with the POST data, as you suggested. This all > >> depends on how the request is made. Django's CSRF system relies on a > >> CSRF value set in a cookie. You have to mimic a browsers cookie > >> functionality, then use the value of the CSRF cookie with evey > >> request you make. By default, the cookie name is 'csrftoken'. For > >> more info on the CSRF process: > >> https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/ > >> 3. Disable CSRF altogether. Simply remove the CsrfViewMiddleware from > >> your settings and you're good to go. > > >> _Nik > > >> On 7/5/2012 6:22 PM, Jeff Silverman wrote: > > >>> Nik, if I remove the csrf decorator and leave the middleware in place, > >>> I get the 403. Is there a way to add the token on the POST command, > >>> or is there another way of leaving the middleware in place, but turn > >>> off csrf without using the decorator? > > >>> On Thursday, July 5, 2012 8:33:51 PM UTC-4, Jeff Silverman wrote: > > >>> Nik, I will give that a try. The reason for the decorator was > >>> that I was getting 403 forbidden, and the decorator made that one > >>> go away. If I remove the csrf from the settings file, will that > >>> solve that problem? > > >>> On Tuesday, July 3, 2012 9:32:20 AM UTC-4, Jeff Silverman wrote: > > >>> Below is the code from the views.py > > >>> The405is retunred from the 'return super(DjangoSoapApp, > >>> self).__init__(Application(services, tns))' statement. I am > >>> using > >>> python 2.6, soaplib20 and django 1.3. I am struggling to > >>> understand > >>> what exactly is wrong here. > > >>> class HelloWorldService(DefinitionBase): > >>> @soap(String,Integer,_returns=Array(String)) > >>> def say_smello(self,name,times): > >>> results = [] > >>> for i in range(0,times): > >>> results.append('Hello, %s'%name) > >>> return results > > >>> class DjangoSoapApp(WSGIApplication): > >>> csrf_exempt = True > > >>> def __init__(self, services, tns): > >>> """Create Django view for given SOAP soaplib services and > >>> tns""" > > >>> return super(DjangoSoapApp, > >>> self).__init__(Application(services, tns)) > > >>> def __call__(self, request): > >>> django_response = HttpResponse() > > >>> def start_response(status, headers): > >>> django_response.status_code = int(status.split(' > >>> ', 1)[0]) > >>> for header, value
Re: Still need help with the 405....please
Ok Nik. I have removed the CSRF middleware and get a brand new error. XMLSyntaxError at /hello/ error parsing attribute name, line 1, column 6Request Method: POST Request URL: http://piadm42.troweprice.com:/hello/ Django Version: 1.3.1 Exception Type: XMLSyntaxError Exception Value: error parsing attribute name, line 1, column 6 Exception Location: /usr/lib/python2.6/site-packages/ soaplib-2.0.0_beta1-py2.6.egg/soaplib/core/_base.py in _parse_xml_string, line 248 Python Executable: /usr/bin/python Python Version: 2.6.6 The POST in fiddler is something like this -> http://mysite.com:/hello/ and the request body contains -> On Jul 5, 10:35 pm, Nikolas Stevenson-Molnar wrote: > Yes, I would expect a 403 when the CSRF middleware is active, the > decorator is not used, and no CSRF token is provided. This is the > intended behavior. You can fix this in a few ways: > > 1. Apply the decorator to the __call__ method (rather than to the class > itself). If I understand how this code works, that should correctly > disable CSRF for the view. > 2. Provide a CSRF value with the POST data, as you suggested. This all > depends on how the request is made. Django's CSRF system relies on a > CSRF value set in a cookie. You have to mimic a browsers cookie > functionality, then use the value of the CSRF cookie with evey > request you make. By default, the cookie name is 'csrftoken'. For > more info on the CSRF process: > https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/ > 3. Disable CSRF altogether. Simply remove the CsrfViewMiddleware from > your settings and you're good to go. > > _Nik > > On 7/5/2012 6:22 PM, Jeff Silverman wrote: > > > > > Nik, if I remove the csrf decorator and leave the middleware in place, > > I get the 403. Is there a way to add the token on the POST command, > > or is there another way of leaving the middleware in place, but turn > > off csrf without using the decorator? > > > On Thursday, July 5, 2012 8:33:51 PM UTC-4, Jeff Silverman wrote: > > > Nik, I will give that a try. The reason for the decorator was > > that I was getting 403 forbidden, and the decorator made that one > > go away. If I remove the csrf from the settings file, will that > > solve that problem? > > > On Tuesday, July 3, 2012 9:32:20 AM UTC-4, Jeff Silverman wrote: > > > Below is the code from the views.py > > > The 405 is retunred from the 'return super(DjangoSoapApp, > > self).__init__(Application(services, tns))' statement. I am > > using > > python 2.6, soaplib20 and django 1.3. I am struggling to > > understand > > what exactly is wrong here. > > > class HelloWorldService(DefinitionBase): > > @soap(String,Integer,_returns=Array(String)) > > def say_smello(self,name,times): > > results = [] > > for i in range(0,times): > > results.append('Hello, %s'%name) > > return results > > > class DjangoSoapApp(WSGIApplication): > > csrf_exempt = True > > > def __init__(self, services, tns): > > """Create Django view for given SOAP soaplib services and > > tns""" > > > return super(DjangoSoapApp, > > self).__init__(Application(services, tns)) > > > def __call__(self, request): > > django_response = HttpResponse() > > > def start_response(status, headers): > > django_response.status_code = int(status.split(' > > ', 1)[0]) > > for header, value in headers: > > django_response[header] = value > > > response = super(DjangoSoapApp, > > self).__call__(request.META, > > start_response) > > django_response.content = '\n'.join(response) > > > return django_response > > > # the view to use in urls.py > > hello_world_service = DjangoSoapApp([HelloWorldService], > > '__name__') > > > -- > > You received this message because you are subscribed to the Google > > Groups "Django users" group. > > To view this discussion on the web visit > >https://groups.google.com/d/msg/django-users/-/WpDQ4UjGEQwJ. > > To post to this group, send email to django-users@googlegroups.com. > > To unsubscribe from th
Re: Still need help with the 405....please
Nik, if I remove the csrf decorator and leave the middleware in place, I get the 403. Is there a way to add the token on the POST command, or is there another way of leaving the middleware in place, but turn off csrf without using the decorator? On Thursday, July 5, 2012 8:33:51 PM UTC-4, Jeff Silverman wrote: > > Nik, I will give that a try. The reason for the decorator was that I was > getting 403 forbidden, and the decorator made that one go away. If I > remove the csrf from the settings file, will that solve that problem? > > > On Tuesday, July 3, 2012 9:32:20 AM UTC-4, Jeff Silverman wrote: >> >> Below is the code from the views.py >> >> The 405 is retunred from the 'return super(DjangoSoapApp, >> self).__init__(Application(services, tns))' statement. I am using >> python 2.6, soaplib20 and django 1.3. I am struggling to understand >> what exactly is wrong here. >> >> >> >> class HelloWorldService(DefinitionBase): >> @soap(String,Integer,_returns=Array(String)) >> def say_smello(self,name,times): >> results = [] >> for i in range(0,times): >> results.append('Hello, %s'%name) >> return results >> >> class DjangoSoapApp(WSGIApplication): >> csrf_exempt = True >> >> def __init__(self, services, tns): >> """Create Django view for given SOAP soaplib services and >> tns""" >> >> return super(DjangoSoapApp, >> self).__init__(Application(services, tns)) >> >> def __call__(self, request): >> django_response = HttpResponse() >> >> def start_response(status, headers): >> django_response.status_code = int(status.split(' ', 1)[0]) >> for header, value in headers: >> django_response[header] = value >> >> response = super(DjangoSoapApp, self).__call__(request.META, >> start_response) >> django_response.content = '\n'.join(response) >> >> return django_response >> >> # the view to use in urls.py >> hello_world_service = DjangoSoapApp([HelloWorldService], '__name__') >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/WpDQ4UjGEQwJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Still need help with the 405....please
Nik, I will give that a try. The reason for the decorator was that I was getting 403 forbidden, and the decorator made that one go away. If I remove the csrf from the settings file, will that solve that problem? On Tuesday, July 3, 2012 9:32:20 AM UTC-4, Jeff Silverman wrote: > > Below is the code from the views.py > > The 405 is retunred from the 'return super(DjangoSoapApp, > self).__init__(Application(services, tns))' statement. I am using > python 2.6, soaplib20 and django 1.3. I am struggling to understand > what exactly is wrong here. > > > > class HelloWorldService(DefinitionBase): > @soap(String,Integer,_returns=Array(String)) > def say_smello(self,name,times): > results = [] > for i in range(0,times): > results.append('Hello, %s'%name) > return results > > class DjangoSoapApp(WSGIApplication): > csrf_exempt = True > > def __init__(self, services, tns): > """Create Django view for given SOAP soaplib services and > tns""" > > return super(DjangoSoapApp, > self).__init__(Application(services, tns)) > > def __call__(self, request): > django_response = HttpResponse() > > def start_response(status, headers): > django_response.status_code = int(status.split(' ', 1)[0]) > for header, value in headers: > django_response[header] = value > > response = super(DjangoSoapApp, self).__call__(request.META, > start_response) > django_response.content = '\n'.join(response) > > return django_response > > # the view to use in urls.py > hello_world_service = DjangoSoapApp([HelloWorldService], '__name__') > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Li-smv_nBIgJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Still need help with the 405....please
# soaplib v2.0.0beta2 (from memory) # Django v1.3 (stable) # NOTE: CSRF middleware has been turned off! # For urls.py, see: https://gist.github.com/935812 import soaplib from soaplib.core.service import rpc, DefinitionBase from soaplib.core.model.primitive import String, Integer from soaplib.core.model.clazz import Array from django.views.decorators.csrf import csrf_exempt class HelloWorldService(DefinitionBase): @rpc(String,Integer,_returns=Array(String)) def say_hello(self, name, times): results = [] for i in range(0, times): results.append('Hellow, %s' %name) return results from soaplib.core.server.wsgi import Application from django.http import HttpResponse import StringIO class DumbStringIO(StringIO.StringIO): def read(self, n): return self.getvalue() @csrf_exempt class DjangoSoapApp(Application): def __call__(self, request): django_response = HttpResponse() def start_response(status, headers): status, reason = status.split(' ', 1) django_response.status_code = int(status) for header, value in headers: django_response[header] = value environ = request.META.copy() environ['CONTENT_LENGTH'] = len(request.raw_post_data) environ['wsgi.input'] = DumbStringIO(request.raw_post_data) environ['wsgi.multithread'] = False #print help(DjangoSoapApp) response = super(DjangoSoapApp, self).__call__(environ, start_response) django_response.content = '\n'.join(response) return django_response print type(DjangoSoapApp) soap_application = soaplib.core.Application([HelloWorldService], 'tns') #import pdb; pdb.set_trace() hello_world_service = DjangoSoapApp(soap_application) On Jul 5, 2:54 pm, Nikolas Stevenson-Molnar wrote: > Would you please provide the source for mysite.BDSCheckUser.views? > > _Nik > > On 7/5/2012 11:37 AM, Jeff Silverman wrote: > > > > > Resulting output, > > > Help on function DjangoSoapApp in module mysite.BDSCheckUser.views: > > > DjangoSoapApp(*args, **kwargs) > > > On Jul 5, 2:31 pm, Nikolas Stevenson-Molnar > > wrote: > >> Hmmm, I can't think of what may be happening. One more debug thing to > >> try, print the help of DjangoSoapApp just before the problem line: > > >> print help(DjangoSoapApp) > > >> That way, if the DjangoSoapApp symbol is getting reassigned to a > >> function somewhere along the way, that might clue you in. > > >> _Nik > > >> On 7/5/2012 11:17 AM, Jeff Silverman wrote: > > >>> I've been flip flopping my views.py between that snippet, and > >>>https://gist.github.com/935809, which is a bit different, but easier > >>> to follow. > >>> On Jul 5, 2:03 pm, Nikolas Stevenson-Molnar > >>> wrote: > >>>> Is your code still the same as you posted > >>>> earlier:http://djangosnippets.org/snippets/2638/?Andtheerror is occuring > >>>> on > >>>> ln 28? > >>>> _Nik > >>>> On 7/5/2012 11:01 AM, Jeff Silverman wrote: > >>>>> The print output is: > >>>>> > >>>>> On Jul 5, 1:38 pm, Nikolas Stevenson-Molnar > >>>>> wrote: > >>>>>> Hmmm, not sure about this one. Try printing out the type of > >>>>>> DjangoSoapApp before that line is called: > >>>>>> print type(DjangoSoapApp) > >>>>>> _Nik > >>>>>> On 7/5/2012 5:20 AM, Jeff Silverman wrote: > >>>>>>> Ok, I'm further along, I think. Now I'm getting the following > >>>>>>> response = super(DjangoSoapApp, self).__call__(environ, > >>>>>>> start_response) > >>>>>>> (Pdb) p start_response > >>>>>>> > >>>>>>> (Pdb) super(DjangoSoapApp, self).__call__(environ, start_response) > >>>>>>> *** TypeError: super() argument 1 must be type, not function > >>>>>>> On Jul 3, 3:47 pm, Nikolas Stevenson-Molnar > >>>>>>> wrote: > >>>>>>>> Looking at the soaplib source, it looks like it required requests to > >>>>>>>> be > >>>>>>>> made using POST. If you're loading this in a web browser to test, > >>>>>>>> then > >>>>>>>> you're making a GET request. Try making a POST request (using > >>>>>>>> something > >>>>>>>> like Fiddler) instead. >
Re: Still need help with the 405....please
Resulting output, Help on function DjangoSoapApp in module mysite.BDSCheckUser.views: DjangoSoapApp(*args, **kwargs) On Jul 5, 2:31 pm, Nikolas Stevenson-Molnar wrote: > Hmmm, I can't think of what may be happening. One more debug thing to > try, print the help of DjangoSoapApp just before the problem line: > > print help(DjangoSoapApp) > > That way, if the DjangoSoapApp symbol is getting reassigned to a > function somewhere along the way, that might clue you in. > > _Nik > > On 7/5/2012 11:17 AM, Jeff Silverman wrote: > > > > > I've been flip flopping my views.py between that snippet, and > >https://gist.github.com/935809, which is a bit different, but easier > > to follow. > > > On Jul 5, 2:03 pm, Nikolas Stevenson-Molnar > > wrote: > >> Is your code still the same as you posted > >> earlier:http://djangosnippets.org/snippets/2638/?Andthe error is occuring > >> on > >> ln 28? > > >> _Nik > > >> On 7/5/2012 11:01 AM, Jeff Silverman wrote: > > >>> The print output is: > >>> > >>> On Jul 5, 1:38 pm, Nikolas Stevenson-Molnar > >>> wrote: > >>>> Hmmm, not sure about this one. Try printing out the type of > >>>> DjangoSoapApp before that line is called: > >>>> print type(DjangoSoapApp) > >>>> _Nik > >>>> On 7/5/2012 5:20 AM, Jeff Silverman wrote: > >>>>> Ok, I'm further along, I think. Now I'm getting the following > >>>>> response = super(DjangoSoapApp, self).__call__(environ, > >>>>> start_response) > >>>>> (Pdb) p start_response > >>>>> > >>>>> (Pdb) super(DjangoSoapApp, self).__call__(environ, start_response) > >>>>> *** TypeError: super() argument 1 must be type, not function > >>>>> On Jul 3, 3:47 pm, Nikolas Stevenson-Molnar > >>>>> wrote: > >>>>>> Looking at the soaplib source, it looks like it required requests to be > >>>>>> made using POST. If you're loading this in a web browser to test, then > >>>>>> you're making a GET request. Try making a POST request (using something > >>>>>> like Fiddler) instead. > >>>>>>https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/serve... > >>>>>> (line 84/85) > >>>>>> _Nik > >>>>>> On 7/3/2012 12:20 PM, Jeff Silverman wrote: > >>>>>>>http://djangosnippets.org/snippets/2638/ > >>>>>>> On Jul 3, 2:56 pm, Nikolas Stevenson-Molnar > >>>>>>> wrote: > >>>>>>>> Would you please provide a reference to the snippet or to your > >>>>>>>> complete > >>>>>>>> code? It's hard to understand what's going on from this small bit. > >>>>>>>> _Nik > >>>>>>>> On 7/3/2012 11:33 AM, Jeff Silverman wrote: > >>>>>>>>> Thanks for the reply. Removing that did not change the result. > >>>>>>>>> Just > >>>>>>>>> an FYI, but I copied the code verbatim from the snippet. that's > >>>>>>>>> why I > >>>>>>>>> cannot understand what's going on. I continually get the405method > >>>>>>>>> not allowed error regardless. > >>>>>>>>> On Jul 3, 1:28 pm, Nikolas Stevenson-Molnar > >>>>>>>>> wrote: > >>>>>>>>>> I'm not sure that this is the problem, but typically constructors > >>>>>>>>>> should > >>>>>>>>>> not have a return value. Try removing the "return" from your > >>>>>>>>>> DjangoSoapApp constructor. > >>>>>>>>>> _Nik > >>>>>>>>>> On 7/3/2012 6:32 AM, Jeff Silverman wrote: > >>>>>>>>>>> Below is the code from the views.py > >>>>>>>>>>> The405is retunred from the 'return super(DjangoSoapApp, > >>>>>>>>>>> self).__init__(Application(services, tns))' statement. I am using > >>>>>>>>>>> python 2.6, soaplib20 and django 1.3. I am struggling to > >>>>>>>>>>> understand > >>>>>&
Re: Still need help with the 405....please
I've been flip flopping my views.py between that snippet, and https://gist.github.com/935809, which is a bit different, but easier to follow. On Jul 5, 2:03 pm, Nikolas Stevenson-Molnar wrote: > Is your code still the same as you posted > earlier:http://djangosnippets.org/snippets/2638/?And the error is occuring on > ln 28? > > _Nik > > On 7/5/2012 11:01 AM, Jeff Silverman wrote: > > > > > The print output is: > > > > > > On Jul 5, 1:38 pm, Nikolas Stevenson-Molnar > > wrote: > >> Hmmm, not sure about this one. Try printing out the type of > >> DjangoSoapApp before that line is called: > > >> print type(DjangoSoapApp) > > >> _Nik > > >> On 7/5/2012 5:20 AM, Jeff Silverman wrote: > > >>> Ok, I'm further along, I think. Now I'm getting the following > >>> response = super(DjangoSoapApp, self).__call__(environ, > >>> start_response) > >>> (Pdb) p start_response > >>> > >>> (Pdb) super(DjangoSoapApp, self).__call__(environ, start_response) > >>> *** TypeError: super() argument 1 must be type, not function > >>> On Jul 3, 3:47 pm, Nikolas Stevenson-Molnar > >>> wrote: > >>>> Looking at the soaplib source, it looks like it required requests to be > >>>> made using POST. If you're loading this in a web browser to test, then > >>>> you're making a GET request. Try making a POST request (using something > >>>> like Fiddler) instead. > >>>>https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/serve... > >>>> (line 84/85) > >>>> _Nik > >>>> On 7/3/2012 12:20 PM, Jeff Silverman wrote: > >>>>>http://djangosnippets.org/snippets/2638/ > >>>>> On Jul 3, 2:56 pm, Nikolas Stevenson-Molnar > >>>>> wrote: > >>>>>> Would you please provide a reference to the snippet or to your complete > >>>>>> code? It's hard to understand what's going on from this small bit. > >>>>>> _Nik > >>>>>> On 7/3/2012 11:33 AM, Jeff Silverman wrote: > >>>>>>> Thanks for the reply. Removing that did not change the result. Just > >>>>>>> an FYI, but I copied the code verbatim from the snippet. that's why I > >>>>>>> cannot understand what's going on. I continually get the405method > >>>>>>> not allowed error regardless. > >>>>>>> On Jul 3, 1:28 pm, Nikolas Stevenson-Molnar > >>>>>>> wrote: > >>>>>>>> I'm not sure that this is the problem, but typically constructors > >>>>>>>> should > >>>>>>>> not have a return value. Try removing the "return" from your > >>>>>>>> DjangoSoapApp constructor. > >>>>>>>> _Nik > >>>>>>>> On 7/3/2012 6:32 AM, Jeff Silverman wrote: > >>>>>>>>> Below is the code from the views.py > >>>>>>>>> The405is retunred from the 'return super(DjangoSoapApp, > >>>>>>>>> self).__init__(Application(services, tns))' statement. I am using > >>>>>>>>> python 2.6, soaplib20 and django 1.3. I am struggling to understand > >>>>>>>>> what exactly is wrong here. > >>>>>>>>> class HelloWorldService(DefinitionBase): > >>>>>>>>> @soap(String,Integer,_returns=Array(String)) > >>>>>>>>> def say_smello(self,name,times): > >>>>>>>>> results = [] > >>>>>>>>> for i in range(0,times): > >>>>>>>>> results.append('Hello, %s'%name) > >>>>>>>>> return results > >>>>>>>>> class DjangoSoapApp(WSGIApplication): > >>>>>>>>> csrf_exempt = True > >>>>>>>>> def __init__(self, services, tns): > >>>>>>>>> """Create Django view for given SOAP soaplib services and > >>>>>>>>> tns""" > >>>>>>>>> return super(DjangoSoapApp, > >>>>>>>>> self).__init__(Application(services, tns)) > >>>>>>>>> def __call__(self, request): > >>>>>>>>> django_response = HttpResponse() > >>>>>>>>> def start_response(status, headers): > >>>>>>>>> django_response.status_code = int(status.split(' ', > >>>>>>>>> 1)[0]) > >>>>>>>>> for header, value in headers: > >>>>>>>>> django_response[header] = value > >>>>>>>>> response = super(DjangoSoapApp, self).__call__(request.META, > >>>>>>>>> start_response) > >>>>>>>>> django_response.content = '\n'.join(response) > >>>>>>>>> return django_response > >>>>>>>>> # the view to use in urls.py > >>>>>>>>> hello_world_service = DjangoSoapApp([HelloWorldService], > >>>>>>>>> '__name__')- Hide quoted text - > >>>>>>>> - Show quoted text -- Hide quoted text - > >>>>>> - Show quoted text -- Hide quoted text - > >>>> - Show quoted text -- Hide quoted text - > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Still need help with the 405....please
The print output is: On Jul 5, 1:38 pm, Nikolas Stevenson-Molnar wrote: > Hmmm, not sure about this one. Try printing out the type of > DjangoSoapApp before that line is called: > > print type(DjangoSoapApp) > > _Nik > > On 7/5/2012 5:20 AM, Jeff Silverman wrote: > > > > > Ok, I'm further along, I think. Now I'm getting the following > > > response = super(DjangoSoapApp, self).__call__(environ, > > start_response) > > (Pdb) p start_response > > > > > (Pdb) super(DjangoSoapApp, self).__call__(environ, start_response) > > *** TypeError: super() argument 1 must be type, not function > > > On Jul 3, 3:47 pm, Nikolas Stevenson-Molnar > > wrote: > >> Looking at the soaplib source, it looks like it required requests to be > >> made using POST. If you're loading this in a web browser to test, then > >> you're making a GET request. Try making a POST request (using something > >> like Fiddler) instead. > > >>https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/serve... > >> (line 84/85) > > >> _Nik > > >> On 7/3/2012 12:20 PM, Jeff Silverman wrote: > > >>>http://djangosnippets.org/snippets/2638/ > >>> On Jul 3, 2:56 pm, Nikolas Stevenson-Molnar > >>> wrote: > >>>> Would you please provide a reference to the snippet or to your complete > >>>> code? It's hard to understand what's going on from this small bit. > >>>> _Nik > >>>> On 7/3/2012 11:33 AM, Jeff Silverman wrote: > >>>>> Thanks for the reply. Removing that did not change the result. Just > >>>>> an FYI, but I copied the code verbatim from the snippet. that's why I > >>>>> cannot understand what's going on. I continually get the405method > >>>>> not allowed error regardless. > >>>>> On Jul 3, 1:28 pm, Nikolas Stevenson-Molnar > >>>>> wrote: > >>>>>> I'm not sure that this is the problem, but typically constructors > >>>>>> should > >>>>>> not have a return value. Try removing the "return" from your > >>>>>> DjangoSoapApp constructor. > >>>>>> _Nik > >>>>>> On 7/3/2012 6:32 AM, Jeff Silverman wrote: > >>>>>>> Below is the code from the views.py > >>>>>>> The405is retunred from the 'return super(DjangoSoapApp, > >>>>>>> self).__init__(Application(services, tns))' statement. I am using > >>>>>>> python 2.6, soaplib20 and django 1.3. I am struggling to understand > >>>>>>> what exactly is wrong here. > >>>>>>> class HelloWorldService(DefinitionBase): > >>>>>>> @soap(String,Integer,_returns=Array(String)) > >>>>>>> def say_smello(self,name,times): > >>>>>>> results = [] > >>>>>>> for i in range(0,times): > >>>>>>> results.append('Hello, %s'%name) > >>>>>>> return results > >>>>>>> class DjangoSoapApp(WSGIApplication): > >>>>>>> csrf_exempt = True > >>>>>>> def __init__(self, services, tns): > >>>>>>> """Create Django view for given SOAP soaplib services and > >>>>>>> tns""" > >>>>>>> return super(DjangoSoapApp, > >>>>>>> self).__init__(Application(services, tns)) > >>>>>>> def __call__(self, request): > >>>>>>> django_response = HttpResponse() > >>>>>>> def start_response(status, headers): > >>>>>>> django_response.status_code = int(status.split(' ', 1)[0]) > >>>>>>> for header, value in headers: > >>>>>>> django_response[header] = value > >>>>>>> response = super(DjangoSoapApp, self).__call__(request.META, > >>>>>>> start_response) > >>>>>>> django_response.content = '\n'.join(response) > >>>>>>> return django_response > >>>>>>> # the view to use in urls.py > >>>>>>> hello_world_service = DjangoSoapApp([HelloWorldService], '__name__')- > >>>>>>> Hide quoted text - > >>>>>> - Show quoted text -- Hide quoted text - > >>>> - Show quoted text -- Hide quoted text - > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Still need help with the 405....please
Ok, I'm further along, I think. Now I'm getting the following response = super(DjangoSoapApp, self).__call__(environ, start_response) (Pdb) p start_response (Pdb) super(DjangoSoapApp, self).__call__(environ, start_response) *** TypeError: super() argument 1 must be type, not function On Jul 3, 3:47 pm, Nikolas Stevenson-Molnar wrote: > Looking at the soaplib source, it looks like it required requests to be > made using POST. If you're loading this in a web browser to test, then > you're making a GET request. Try making a POST request (using something > like Fiddler) instead. > > https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/serve... > (line 84/85) > > _Nik > > On 7/3/2012 12:20 PM, Jeff Silverman wrote: > > > > >http://djangosnippets.org/snippets/2638/ > > > On Jul 3, 2:56 pm, Nikolas Stevenson-Molnar > > wrote: > >> Would you please provide a reference to the snippet or to your complete > >> code? It's hard to understand what's going on from this small bit. > > >> _Nik > > >> On 7/3/2012 11:33 AM, Jeff Silverman wrote: > > >>> Thanks for the reply. Removing that did not change the result. Just > >>> an FYI, but I copied the code verbatim from the snippet. that's why I > >>> cannot understand what's going on. I continually get the405method > >>> not allowed error regardless. > >>> On Jul 3, 1:28 pm, Nikolas Stevenson-Molnar > >>> wrote: > >>>> I'm not sure that this is the problem, but typically constructors should > >>>> not have a return value. Try removing the "return" from your > >>>> DjangoSoapApp constructor. > >>>> _Nik > >>>> On 7/3/2012 6:32 AM, Jeff Silverman wrote: > >>>>> Below is the code from the views.py > >>>>> The405is retunred from the 'return super(DjangoSoapApp, > >>>>> self).__init__(Application(services, tns))' statement. I am using > >>>>> python 2.6, soaplib20 and django 1.3. I am struggling to understand > >>>>> what exactly is wrong here. > >>>>> class HelloWorldService(DefinitionBase): > >>>>> @soap(String,Integer,_returns=Array(String)) > >>>>> def say_smello(self,name,times): > >>>>> results = [] > >>>>> for i in range(0,times): > >>>>> results.append('Hello, %s'%name) > >>>>> return results > >>>>> class DjangoSoapApp(WSGIApplication): > >>>>> csrf_exempt = True > >>>>> def __init__(self, services, tns): > >>>>> """Create Django view for given SOAP soaplib services and > >>>>> tns""" > >>>>> return super(DjangoSoapApp, > >>>>> self).__init__(Application(services, tns)) > >>>>> def __call__(self, request): > >>>>> django_response = HttpResponse() > >>>>> def start_response(status, headers): > >>>>> django_response.status_code = int(status.split(' ', 1)[0]) > >>>>> for header, value in headers: > >>>>> django_response[header] = value > >>>>> response = super(DjangoSoapApp, self).__call__(request.META, > >>>>> start_response) > >>>>> django_response.content = '\n'.join(response) > >>>>> return django_response > >>>>> # the view to use in urls.py > >>>>> hello_world_service = DjangoSoapApp([HelloWorldService], '__name__')- > >>>>> Hide quoted text - > >>>> - Show quoted text -- Hide quoted text - > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Still need help with the 405....please
Good call. I used Fiddler to generate the POST string, however, I get no response. It appears to go into the @soap(String, Integer, _returns=Array(string)) statement and hangs at that point, not returning. On Jul 3, 3:47 pm, Nikolas Stevenson-Molnar wrote: > Looking at the soaplib source, it looks like it required requests to be > made using POST. If you're loading this in a web browser to test, then > you're making a GET request. Try making a POST request (using something > like Fiddler) instead. > > https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/serve... > (line 84/85) > > _Nik > > On 7/3/2012 12:20 PM, Jeff Silverman wrote: > > > > >http://djangosnippets.org/snippets/2638/ > > > On Jul 3, 2:56 pm, Nikolas Stevenson-Molnar > > wrote: > >> Would you please provide a reference to the snippet or to your complete > >> code? It's hard to understand what's going on from this small bit. > > >> _Nik > > >> On 7/3/2012 11:33 AM, Jeff Silverman wrote: > > >>> Thanks for the reply. Removing that did not change the result. Just > >>> an FYI, but I copied the code verbatim from the snippet. that's why I > >>> cannot understand what's going on. I continually get the405method > >>> not allowed error regardless. > >>> On Jul 3, 1:28 pm, Nikolas Stevenson-Molnar > >>> wrote: > >>>> I'm not sure that this is the problem, but typically constructors should > >>>> not have a return value. Try removing the "return" from your > >>>> DjangoSoapApp constructor. > >>>> _Nik > >>>> On 7/3/2012 6:32 AM, Jeff Silverman wrote: > >>>>> Below is the code from the views.py > >>>>> The405is retunred from the 'return super(DjangoSoapApp, > >>>>> self).__init__(Application(services, tns))' statement. I am using > >>>>> python 2.6, soaplib20 and django 1.3. I am struggling to understand > >>>>> what exactly is wrong here. > >>>>> class HelloWorldService(DefinitionBase): > >>>>> @soap(String,Integer,_returns=Array(String)) > >>>>> def say_smello(self,name,times): > >>>>> results = [] > >>>>> for i in range(0,times): > >>>>> results.append('Hello, %s'%name) > >>>>> return results > >>>>> class DjangoSoapApp(WSGIApplication): > >>>>> csrf_exempt = True > >>>>> def __init__(self, services, tns): > >>>>> """Create Django view for given SOAP soaplib services and > >>>>> tns""" > >>>>> return super(DjangoSoapApp, > >>>>> self).__init__(Application(services, tns)) > >>>>> def __call__(self, request): > >>>>> django_response = HttpResponse() > >>>>> def start_response(status, headers): > >>>>> django_response.status_code = int(status.split(' ', 1)[0]) > >>>>> for header, value in headers: > >>>>> django_response[header] = value > >>>>> response = super(DjangoSoapApp, self).__call__(request.META, > >>>>> start_response) > >>>>> django_response.content = '\n'.join(response) > >>>>> return django_response > >>>>> # the view to use in urls.py > >>>>> hello_world_service = DjangoSoapApp([HelloWorldService], '__name__')- > >>>>> Hide quoted text - > >>>> - Show quoted text -- Hide quoted text - > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Still need help with the 405....please
http://djangosnippets.org/snippets/2638/ On Jul 3, 2:56 pm, Nikolas Stevenson-Molnar wrote: > Would you please provide a reference to the snippet or to your complete > code? It's hard to understand what's going on from this small bit. > > _Nik > > On 7/3/2012 11:33 AM, Jeff Silverman wrote: > > > > > Thanks for the reply. Removing that did not change the result. Just > > an FYI, but I copied the code verbatim from the snippet. that's why I > > cannot understand what's going on. I continually get the 405 method > > not allowed error regardless. > > > On Jul 3, 1:28 pm, Nikolas Stevenson-Molnar > > wrote: > >> I'm not sure that this is the problem, but typically constructors should > >> not have a return value. Try removing the "return" from your > >> DjangoSoapApp constructor. > > >> _Nik > > >> On 7/3/2012 6:32 AM, Jeff Silverman wrote: > > >>> Below is the code from the views.py > >>> The 405 is retunred from the 'return super(DjangoSoapApp, > >>> self).__init__(Application(services, tns))' statement. I am using > >>> python 2.6, soaplib20 and django 1.3. I am struggling to understand > >>> what exactly is wrong here. > >>> class HelloWorldService(DefinitionBase): > >>> @soap(String,Integer,_returns=Array(String)) > >>> def say_smello(self,name,times): > >>> results = [] > >>> for i in range(0,times): > >>> results.append('Hello, %s'%name) > >>> return results > >>> class DjangoSoapApp(WSGIApplication): > >>> csrf_exempt = True > >>> def __init__(self, services, tns): > >>> """Create Django view for given SOAP soaplib services and > >>> tns""" > >>> return super(DjangoSoapApp, > >>> self).__init__(Application(services, tns)) > >>> def __call__(self, request): > >>> django_response = HttpResponse() > >>> def start_response(status, headers): > >>> django_response.status_code = int(status.split(' ', 1)[0]) > >>> for header, value in headers: > >>> django_response[header] = value > >>> response = super(DjangoSoapApp, self).__call__(request.META, > >>> start_response) > >>> django_response.content = '\n'.join(response) > >>> return django_response > >>> # the view to use in urls.py > >>> hello_world_service = DjangoSoapApp([HelloWorldService], '__name__')- > >>> Hide quoted text - > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Still need help with the 405....please
Thanks for the reply. Removing that did not change the result. Just an FYI, but I copied the code verbatim from the snippet. that's why I cannot understand what's going on. I continually get the 405 method not allowed error regardless. On Jul 3, 1:28 pm, Nikolas Stevenson-Molnar wrote: > I'm not sure that this is the problem, but typically constructors should > not have a return value. Try removing the "return" from your > DjangoSoapApp constructor. > > _Nik > > On 7/3/2012 6:32 AM, Jeff Silverman wrote: > > > > > Below is the code from the views.py > > > The 405 is retunred from the 'return super(DjangoSoapApp, > > self).__init__(Application(services, tns))' statement. I am using > > python 2.6, soaplib20 and django 1.3. I am struggling to understand > > what exactly is wrong here. > > > class HelloWorldService(DefinitionBase): > > @soap(String,Integer,_returns=Array(String)) > > def say_smello(self,name,times): > > results = [] > > for i in range(0,times): > > results.append('Hello, %s'%name) > > return results > > > class DjangoSoapApp(WSGIApplication): > > csrf_exempt = True > > > def __init__(self, services, tns): > > """Create Django view for given SOAP soaplib services and > > tns""" > > > return super(DjangoSoapApp, > > self).__init__(Application(services, tns)) > > > def __call__(self, request): > > django_response = HttpResponse() > > > def start_response(status, headers): > > django_response.status_code = int(status.split(' ', 1)[0]) > > for header, value in headers: > > django_response[header] = value > > > response = super(DjangoSoapApp, self).__call__(request.META, > > start_response) > > django_response.content = '\n'.join(response) > > > return django_response > > > # the view to use in urls.py > > hello_world_service = DjangoSoapApp([HelloWorldService], '__name__')- Hide > > quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Still need help with the 405....please
Below is the code from the views.py The 405 is retunred from the 'return super(DjangoSoapApp, self).__init__(Application(services, tns))' statement. I am using python 2.6, soaplib20 and django 1.3. I am struggling to understand what exactly is wrong here. class HelloWorldService(DefinitionBase): @soap(String,Integer,_returns=Array(String)) def say_smello(self,name,times): results = [] for i in range(0,times): results.append('Hello, %s'%name) return results class DjangoSoapApp(WSGIApplication): csrf_exempt = True def __init__(self, services, tns): """Create Django view for given SOAP soaplib services and tns""" return super(DjangoSoapApp, self).__init__(Application(services, tns)) def __call__(self, request): django_response = HttpResponse() def start_response(status, headers): django_response.status_code = int(status.split(' ', 1)[0]) for header, value in headers: django_response[header] = value response = super(DjangoSoapApp, self).__call__(request.META, start_response) django_response.content = '\n'.join(response) return django_response # the view to use in urls.py hello_world_service = DjangoSoapApp([HelloWorldService], '__name__') -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django 1.3 with soaplib2.0
I'm trying to use the soaplib 2.0 web service snippet example and continue to receive a 405 method not allowed error when trying to access the method. I coded the example as is, with the views.py and urls.py exactly as shown. I'm new to web services, so I know i've missed something, but I cannot seem to determine what? I would sure appreciate any help or understanding of what's missing. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
New to DJANGO
I am new to Django. I am trying to get the Class version of hello_world to work. I cannot find a good full example of the code that works. I have made multiple view.py files and urls.py files trying to get it to work. I cannot seem to come up with the right url to pass the variables name and times in. I am using soaplib among other libraries. Pretty much trying anything I find. Can anyone point out a full urls.py, views.py and url combination that works? Ultimately, I want to use the wsdl to expose the funtions to NINTEX workflows. Any thing will be helpful. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/PwzmG27ruy8J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.