Using jquery ajax POST method with django

2015-01-16 Thread Hossein Rashnoo
I use this code to send a request: function checkuser() { $.ajax({ url: 'http://10.252.84.159/ajaxrecivelogin', //type: 'POST', data: "{'username': 'aa', 'password' : 'bb'}", context: this, dataType: 'json', success: function (data) {

Re: Using jquery ajax POST method with django

2015-01-17 Thread Hossein Rashnoo
dumps(response_data), content_type="application/json") *And i comment out django.middleware.csrf.CsrfViewMiddleware in setting* On Saturday, January 17, 2015 at 9:16:32 AM UTC+3:30, Hossein Rashnoo wrote: > > I use this code to send a request: > > function checkuser() { > $.aj

Create Django token-based Authentication

2015-01-26 Thread Hossein Rashnoo
I have my authentication service on django. I want to role as web-service to gave other website a token and authenticate users with that token. This is my scenario: 1. user visit external website and try to login 2. when hit the login button that website redirect user to my site to u

Redirect to external url with parameters in django

2015-01-26 Thread Hossein Rashnoo
I want when a user do something in my view then i redirect him to another website with some parameters as POST method Like when you submit a form. I think its may be something like this: return HttpResponseRedirect("url","parameters") How can i do that? -- You received this message because

django-users@googlegroups.com

2015-02-24 Thread Hossein Rashnoo
I use below code to authenticate in SharePoint in my view: import sudsimport logging logging.basicConfig(level=logging.INFO) logging.getLogger('suds.client').setLevel(logging.DEBUG) from suds.client import Client url = 'http://portal:8080/rashno/_vti_bin/lists.asmx?WSDL' from suds.transport.ht

Useing non-ascii character in django

2014-11-08 Thread Hossein Rashnoo
When i return Persian characters in view.py (same as Arabic characters) i got an error , So i add this line to top of view.py: # encoding=utf-8 And now my Persian word is like this : � And when i add 'u' before my word again i got error,I run django on Linux with Apache. Please help me and s

Re: Useing non-ascii character in django

2014-11-09 Thread Hossein Rashnoo
Writing my code with linux editor cause the problem,I wrote that with notepad and save it as 'utf8' and my problem solved. On Saturday, November 8, 2014 11:49:10 AM UTC+3:30, Hossein Rashnoo wrote: > > When i return Persian characters in view.py (same as Arabic characters) i >

Re: Django install packages using pip

2014-11-24 Thread Hossein Rashnoo
the problem was i use python2.6 with django 1.7 and when install django 1.6 problem solved -- 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

Connect django project with sharepoint 2013

2014-12-06 Thread Hossein Rashnoo
I need to connect my project to sharepoint. So i installed "sharepoint 0.4.1" package and then use this code in my view : from sharepoint import SharePointSite, basic_auth_opener def userloginres(request): server_url = "http://portal:8080/"; site_url = server_url + "rashno/" opener = basic_auth_

Re: Connect django project with sharepoint 2013

2014-12-06 Thread Hossein Rashnoo
, in do_open raise URLError(err) URLError: On Saturday, December 6, 2014 4:19:45 PM UTC+3:30, François Schiettecatte wrote: > > Ok, but I am not sure what this has to do with Django ? Maybe you should > ask on a SharePoint mailing list ? And did you try running the code in a >

Re: Connect django project with sharepoint 2013

2014-12-06 Thread Hossein Rashnoo
he url http:// portal:8080. I assume that you can't > visit that url from the browser either > On 07/12/2014 3:46 pm, "Hossein Rashnoo" > > wrote: > >> I need this connection for adding list items and save my users data on >> sharepoint database. I ran i

Open a url with user and password

2014-12-07 Thread Hossein Rashnoo
I want to create a web-service for connection to sharepoint that do something like create a list and ... So at first step because we use sharepoint with local ip i want to check if i can connect to our sharepoint portal via my server or not. So i looking for something like : urllib2.urlopen("htt

Using django-nocaptcha-recaptcha problem

2014-12-17 Thread Hossein Rashnoo
Hi, I use *django-nocaptcha-recaptcha* in my site and it worked perfect. But after that i tried several times for fill a form , google not recognize me as human with a click and tried to show me a challenge image. *The problem is **challenge image not appear.*I attached the photo of this pro

problem with using suds and sharepoint

2014-12-19 Thread Hossein Rashnoo
I tried to add attachment to a sharepoint document library with this command: result = client.service.AddAttachment("new doc","2","ab.ds","QUJDREVGR0hJSktMTU5PUA==") but i got this error: DEBUG:suds.client:sending to (http://portal:8080/rashno/_vti_bin/lists.asmx) message: http://schemas.xmls

uni-code error in python : 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

2014-12-28 Thread Hossein Rashnoo
Hi I use django and in my view i need to send a request as XML with some uni-code character that received from html page with post method. I tried these (Note that i save that input in fname variable) : xml = r"""my XML code with uni-code {0} """.format(fname) And fname = u"%s".encod

Re: uni-code error in python : 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

2014-12-28 Thread Hossein Rashnoo
I Solved that with this code: fname = fname.encode('ascii', 'xmlcharrefreplace') xml = r"""my XML code with unicode {0} """.format(fname) On Monday, December 29, 2014 11:03:49 AM UTC+3:30, Hossein Rashnoo wrote: > > Hi > I use djan

Create an OAuth2 Client Application problem

2014-12-30 Thread Hossein Rashnoo
Hi I follow this tutorial and here i got error. when i try to access http://localhost:8000/o/applications/ its redirect to http://localhost:8000

Re: Create an OAuth2 Client Application problem

2014-12-31 Thread Hossein Rashnoo
I did a stupid mistake. I use oauth2 before using django auth and create user. On Wednesday, December 31, 2014 10:33:34 AM UTC+3:30, Hossein Rashnoo wrote: > > Hi > I follow this tutorial and here > <https://django-oauth-toolkit.readthedocs.org/en/0.7.0/tutorial/tutorial_01

I can send mail with shell but can't sent mail via view

2015-01-08 Thread Hossein Rashnoo
Hi I use this settings to send email: settings.py EMAIL_HOST = "mail.xx.ir" EMAIL_PORT = "25" EMAIL_HOST_USER = "xx...@xxx.ir" EMAIL_HOST_PASSWORD = "" EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' DEFAULT_FROM_EMAIL = 'xx...@xxx.ir' and in python shell: from django.c

Re: I can send mail with shell but can't sent mail via view

2015-01-08 Thread Hossein Rashnoo
esponse means that the domain is either typed incorrectly, or > just doesn't exist out on the wild Internet (or wherever your DNS server > recursively looks for you) > > That command should work on Windows and most Linux distributions (some > Linux systems include th

Re: I can send mail with shell but can't sent mail via view

2015-01-09 Thread Hossein Rashnoo
l ESMTP..." line, you should be in good shape. Normally I would >> expect to see "250-STARTTLS" as one of the options (indicating TLS is >> supported). >> >> Another option would be to try using the IP rather than the name for >> EMAIL_HOST. In t