Re: ASP .NET web service and Django

2014-05-28 Thread shar100101
Thanks everyone. I will try using suds but if suds use C libs, like soaplib 
does (lxml ), than this wont work too.

@Vernon

I don't know for IronPython3. I didn't managed to set up Django 1.5, there 
was errors in Django six.py lib ("""Utilities for writing code that runs on 
Python 2 and 3""") exec_ function. There was problems with  -X:Frames and 
namespaces so I gave up on this.

I use this 'hacks':

IronPython 2.7.3
Django 1.4
IIS 7.5
.NET Framewok 4.0
NWSGI [http://nwsgi.codeplex.com]

I
* AttributeError: 'module' object has no attribute '_getframe'
Use startproject  and startproject with -X:Frames

II
*
STATIC_URL = 'static/' # not  '/static/'

III
To use nice Django URL, use wildcard mapping

 

   


   
  
 

  

While using wildcard mappings you will have some limitations in urls.py 
with regular expressions.
If you use named groups in mapping whole expression is got to be in the 
named group.
 And every expression is got to start with ^ and end with $.
e.g.
url(r'^(?Pnotify).*$', 'helloworld.views.reset_cache'), - this 
wan't work
url(r'^(?Pnotify)(?P.*)$', 
'helloworld.views.reset_cache'), - this will work

IV
If you get something like this error wen loading images:
"Unable to translate bytes [FF] at index 0 from specified code page to 
Unicode."

then in Django static.py change
C:\Program Files (x86)\IronPython 
2.7\Lib\site-packages\django\views\static.py
63 "response = HttpResponse(f.read(), mimetype=mimetype)" with
63 "response = HttpResponse(bytes(f.read()), mimetype=mimetype)"

V
If you use non-ascii caracters. 
* 'Unicode Decode Error:' then change:
C:\Program Files (x86)\IronPython 
2.7\Lib\site-packages\django\http\__init__.py
717 def next(self):
chunk = self._iterator.next()
if isinstance(chunk, unicode):
chunk = chunk.encode(self._charset)
return str(chunk)
to:  
def next(self):
chunk = self._iterator.next()
if isinstance(chunk, unicode):
chunk = chunk.encode('utf8').encode('utf8')
return str(chunk, 'utf8')

VI
To use filebased cache, remove pickle.HIGEST_PROTOCOL in 
C:\Program Files (x86)\IronPython 
2.7\Lib\site-packages\django\core\cache\backends\filebased.py
try:  
now = time.time()   
pickle.dump(now + timeout, f, pickle.HIGHEST_PROTOCOL)
pickle.dump(value, f, pickle.HIGHEST_PROTOCOL)
finally:

try:  
now = time.time()   
pickle.dump(now + timeout, f)
pickle.dump(value, f)
finally:

VII
I do not use database. In order to create sqlite3 db use python

VIII
django/utils/functional.py

django 1.4:

#assert not (cls._delegate_str and cls._delegate_unicode), "Cannot call 
lazy() with both str and unicode return types."
assert (str is unicode) or not (cls._delegate_str and 
cls._delegate_unicode), "Cannot call lazy() with both str and unicode 
return types."
# This solve: 
# AssertionError: Cannot call lazy() with both str and unicode return 
types.
# https://bitbucket.org/jdhardy/django-ironpython/commits/b70eeacda60c




-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20ae092c-6b2b-4bb7-b93d-f921f0a6cf35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ASP .NET web service and Django

2014-05-27 Thread Vernon D. Cole
Jani:

   Can you please provide a link to the "hacks" you mention for 
IronPython?  I am preparing to run django with IronPython3 and any 
information on what people did to make IronPython work would be helpful.
--
Vernon Cole

On Monday, May 26, 2014 12:21:00 PM UTC+1, Jani Tiainen wrote:
>
> You might be interested in suds library, it's basically lightweight SOAP 
> stuff, it may work or it may not. 
> All depends quality of WSDL you do have. 
>
> And to my knowledge getting Django to run on IronPython requires some 
> hacks... 
>
> On Mon, 26 May 2014 04:09:19 -0700 (PDT) 
> shar100101  wrote: 
>
> > Unfortunately Tastypie is not solution for me, because it uses Rest. I 
> am 
> > using IronPython to run website and I still have not found solution to 
> read 
> > Soap/Rest requests with IronPython. 
> > 
> > I was hoping that output form .Net service, sent using HTTP, can be used 
> in 
> > Django. I tried using WebRequest class but it didn't work. 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/091eda56-74a2-4b41-aa15-4f9a0c465daa%40googlegroups.com.
>  
>
> > 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b2c0f746-3e89-4193-8252-75fad068e2c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: ASP .NET web service and Django

2014-05-26 Thread Ilya Kazakevich
Hello,

For web services (I believe you speak about SOAP web services) check:
* https://wiki.python.org/moin/WebServices (SOAP section). It has info about 
Python SOAP client and server libraries.
* For .NET (client) : 
http://stackoverflow.com/questions/1302525/how-to-use-a-wsdl

Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"

>-Original Message-
>From: django-users@googlegroups.com
>[mailto:django-users@googlegroups.com] On Behalf Of Ariel Calzada
>Sent: Sunday, May 25, 2014 1:48 AM
>To: django-users@googlegroups.com
>Subject: ASP .NET web service and Django
>
>hi
>
>.net -> django you should look tastypie
>
>django -> asp you should use python library named request
>
>regards fron colombia
>
>El sábado, 24 de mayo de 2014, shar100101  > escribió:
>
>
>   Hi,
>
>   How to create and send HTTP request from ASP .NET web service with POST
>data in it, to Django, and get HTTP responce from Django to web service ? Does
>anyone have a simple example of this?
>
>   Regards,
>   Dušan
>
>
>
>
>   --
>   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 http://groups.google.com/group/django-users.
>   To view this discussion on the web visit
>https://groups.google.com/d/msgid/django-users/a1c1aaf2-6dd9-4cf8-9131-b45
>4d8dcf548%40googlegroups.com
>54d8dcf548%40googlegroups.com?utm_medium=email_source=footer> .
>   For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>--
>
>Ariel Calzada
>Homepage: http://www.000paradox000.co
>Blog: http://blog.000paradox000.co
>
>
>La Salvaje Esperanza
>
>Éramos dioses y nos volvieron esclavos.
>Éramos hijos del sol y nos consolaron
>con medallas de lata.
>Éramos poetas y nos pusieron a recitar
>oraciones pordioseras.
>Éramos felices y nos civilizaron.
>Quién refrescará la memoria de la tribu.
>Quién revivirá nuestros dioses.
>Que la salvaje esperanza siempre sea tuya, querida alma inamansable.
>
>-Gonzalo Arango-
>
>
>--
>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 http://groups.google.com/group/django-users.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/django-users/CACVFg4vgj1jqLUKdqqjwnA3A
>t8DS-KkEptu2ceZMufjpRhuyXA%40mail.gmail.com
>At8DS-KkEptu2ceZMufjpRhuyXA%40mail.gmail.com?utm_medium=email_
>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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/00a201cf78d6%2451691790%24f43b46b0%24%40JetBrains.com.
For more options, visit https://groups.google.com/d/optout.


Re: ASP .NET web service and Django

2014-05-26 Thread Jani Tiainen
You might be interested in suds library, it's basically lightweight SOAP stuff, 
it may work or it may not.
All depends quality of WSDL you do have.

And to my knowledge getting Django to run on IronPython requires some
hacks...

On Mon, 26 May 2014 04:09:19 -0700 (PDT)
shar100101  wrote:

> Unfortunately Tastypie is not solution for me, because it uses Rest. I am 
> using IronPython to run website and I still have not found solution to read 
> Soap/Rest requests with IronPython.
> 
> I was hoping that output form .Net service, sent using HTTP, can be used in 
> Django. I tried using WebRequest class but it didn't work.
> 
> -- 
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/091eda56-74a2-4b41-aa15-4f9a0c465daa%40googlegroups.com.
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20140526141936.7140a546%40jns42-l.w2k.keypro.fi.
For more options, visit https://groups.google.com/d/optout.


Re: ASP .NET web service and Django

2014-05-26 Thread shar100101
Unfortunately Tastypie is not solution for me, because it uses Rest. I am 
using IronPython to run website and I still have not found solution to read 
Soap/Rest requests with IronPython.

I was hoping that output form .Net service, sent using HTTP, can be used in 
Django. I tried using WebRequest class but it didn't work.

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/091eda56-74a2-4b41-aa15-4f9a0c465daa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.