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-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.


ASP .NET web service and Django

2014-05-24 Thread shar100101
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-b454d8dcf548%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: python

2013-03-11 Thread shar100101
"Python automatically compiles Python source code when you import a 
module". Or you can use compileall module to compile all modules.
see: http://effbot.org/zone/python-compile.htm

понедељак, 11. март 2013. 13.15.25 UTC+1, Harjot Mann је написао/ла:
>
> anyone knows how to compile a python program???
>  im doing it as
> chmod +x filename.py
> ./filename.py???
> Am i right??/
> thanks in advance
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.