SQL Join in Django

2008-11-07 Thread Hossein

Hi,

I am a newbie and am trying to select fields from two table related to
each other using a foreign key:

class Reporter()
 id  primary key
 name
 e-mail
 ...

class Article()
reporter = model.ForeignKey(reporter)
date
...

Now I want to implement the following SQL statement in Django:

select name,e-mail,date from Reporter,Article where reporter = 10

I tried filter, select_related, etc. but I could not get what I want.

Any help will be greatly appreciated

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: SQL Join in Django

2008-11-07 Thread Hossein

Many thanks tim for your quick reply. You are right I meant inner join
not cart product.
I tried your suggested solution and instead of printing the result I
use Django serializer to create an XML file. But it seems that
something is taking too
long and my browser just stalls. Is it because of select_related()
method? I have about 200 articles per each reporter.


On Nov 7, 2:16 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > class Reporter()
> >  id  primary key
> >  name
> >  e-mail
> >  ...
>
> > class Article()
> > reporter = model.ForeignKey(reporter)
> > date
> > ...
>
> > Now I want to implement the following SQL statement in Django:
>
> > select name,e-mail,date from Reporter,Article where reporter = 10
>
> Are you sure this is the query you want?  It's a cartesian join
> that will return *all* reporters associated with *every* article
> written by reporter=10.  I suspect you _mean_
>
>   select
>name, email, date
>   from reporter r
>inner join article a  -- use an inner join, not cart' join
>on r.id = a.reporter_id
>   where r.id = 10
>
> which can be done with something like
>
>arts = Article.objects.filter(reporter_id=10).select_related()
>for article in arts:
>  print article.reporter.name, str(article)
>
> -tim
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: SQL Join in Django

2008-11-07 Thread Hossein

Thanks for your help. I am so close to what I want.

The output that I want is an XML file. So I try:
  reporter = Reporter.objects.get(id=10)
  arts = reporter.article_set.all()
  xmlout = serialize('xml',arts,fields=('date','reporter.name'))

However, it writes date but it does not write reporter.name into the
XML file.

Any help in this regard?

On Nov 7, 2:33 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I tried your suggested solution and instead of printing the result I
> > use Django serializer to create an XML file. But it seems that
> > something is taking too
> > long and my browser just stalls. Is it because of select_related()
> > method? I have about 200 articles per each reporter.
>
> Another possibility might be (since you're only looking at one
> author)
>
>reporter = Reporter.objects.get(id=10)
>arts = reporter.article_set
>for art in arts:
>  print reporter, art
>
> Even that considered, 200 articles/reporter is still pretty
> chump-change.  I've worked with data-sets several orders of
> magnitude larger than that and haven't had performance problems.
>   Alternatively, your templating output might be your bottleneck
> (but you don't mention how you're creating your output, so it's
> hard to tell).
>
> -tim
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



how to use view function in another function of view in django

2016-06-15 Thread hossein


def base(request):
j=Job.objects.all()
a=Ab.objects.all()
return render(request,'base.html',{'j':j, 'a':a})

def index(request):
base(request)
x=X.objects.all()
return render(request, 'index.html',{'x':x})

def list(request):
base(request)
z=Z.objects.all()
return render(request, 'list.html',{'z':z})

-- 
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/3cc2651c-35df-4eaf-bab6-b1ae936f73d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to use view function in another function of view in django

2016-06-15 Thread hossein
More Explain Please

On Thursday, June 16, 2016 at 3:13:38 AM UTC+4:30, Gergely Polonkai wrote:
>
> Just like this. Unless you have a specific use case you forgot to share in 
> your mail.
>
> Views are mere functions that get called with a request az a parameter. 
> You shouldn’t treat them as special/holy/uncallable.
>
> Best,
> Gergely
> On Jun 15, 2016 19:56, "hossein"  wrote:
>
>> def base(request):
>> j=Job.objects.all()
>> a=Ab.objects.all()
>> return render(request,'base.html',{'j':j, 'a':a})
>>
>> def index(request):
>> base(request)
>> x=X.objects.all()
>> return render(request, 'index.html',{'x':x})
>>
>> def list(request):
>> base(request)
>> z=Z.objects.all()
>> return render(request, 'list.html',{'z':z})
>>
>> -- 
>> 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/3cc2651c-35df-4eaf-bab6-b1ae936f73d4%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/3cc2651c-35df-4eaf-bab6-b1ae936f73d4%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/72d16e93-10b7-4465-b116-68bf054a89d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


NoReverseMatch error in django 1.8

2015-09-27 Thread hossein
this is my views and url.py
as long as use  tag in my template show error

url

urlpatterns = [
url(r'^bookee/$', views.index, name='index'),
url(r'^bookee/user/(?P[a-z0-9-._@+]\w+)/$', views.uprofile, 
name='userprofile'),
url(r'^bookee/user/(?P[a-z0-9-._@+]\w+)/book/(?P\d)/$', 
views.bookprof, name='bookp'),

url(r'^bookee/user/(?P[a-z0-9-._@+]\w+)/publisher/(?P\d)/$', 
views.publishprof, name='publishep'),
]

 

view

def uprofile(request, user):
usr = User.objects.get(username=user)
book = Book.objects.filter(user=usr)
return render(request, 'u/uprof.html', {'usr': usr, 'book': book})

def bookprof(request, user, bookid):
usr = User.objects.get(username=user)
bookid = Book.objects.get(id=bookid)
# bookd = Book.objects.filter(id=bookid)
return render(request, 'u/uprof.html', {'usr':usr,'bookid': bookid})

def publishprof(request, user, publishid):
usr = User.objects.get(username=user)
pubid = Publisher.objects.get(id=publishid)
publisher = Publisher.objects.filter(id=pubid)
return render(request, 'u/uprof.html', {'usr':usr,'publisher': publisher})

template



list of books



NoReverseMatch at /bookee/user/admin/
Reverse for 'bookp' with arguments '()' and keyword arguments '{}' not found. 1 
pattern(s) tried: 
['bookee/user/(?P[a-z0-9-._@+]\\w+)/book/(?P\\d)/$']


thanks for your help 

-- 
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/a9092ae0-ff31-467c-ab25-e8418d82270d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


os.system not working for me!

2011-08-02 Thread dR Hossein
Hi every body!
I want to get backup from my db with os.system command. but it's not work 
for me. \
this is the code that I'm using:

* os.system("mysqldump --user root password=123 test_db > d:/test.sql")
*

any body know about this issue? 

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



why get_object_or_404 error is not using translation?

2024-05-18 Thread Hossein Mahdavipour
Hi.
I am using DRF with django. In views  I use get_object_or_404. When I get a 
404, the exception detail is "No %s matches the given query."
You can see the code here: 
https://github.com/django/django/blob/8f205acea94e93a463109e08814f78c09307f2b9/django/shortcuts.py#L88
My question is why it does not use translation? I searched the web but I 
found nothing on why it does not use translation.
Also I like to know, how can I use a workaround to get a translated error 
when getting 404 without try except in all views.

Thanks in advanced.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d1b93300-9f52-4c24-9ab9-dcfc5038200bn%40googlegroups.com.


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.core.mail import send_mail
send_mail('test', 'hello', 'xx...@xxx.ir', ['myem...@gmail.com'])

And its successfully sent But when i use that two line code in view, i got 
this error:
gaierror at /userforget/ 

[Errno -3] Temporary failure in name resolution


Please help me.

-- 
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/6aaaeaac-dc68-477a-b2d7-7b2821097c36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-01-08 Thread Hossein Rashnoo
Thank you for your reply, it seems that every thing is ok:
$ nslookup mail.pep.co.ir <http://mail.xx.ir/>

Server: 10.252.84.50
Address:10.252.84.50#53

Non-authoritative answer:
Name:   mail.pep.co.ir
Address: 79.175.161.174


and:

$ python manage.py shell

>>> import socket
>>> socket.gethostbyname("mail.pep.co.ir")
'79.175.161.174'

I attach the whole traceback with this reply.thank you.


On Thursday, January 8, 2015 12:08:26 PM UTC+3:30, James Schneider wrote:
>
> Can you send the whole traceback?
>
> Name resolution errors indicate an issue with DNS reachability, or a 
> domain name incorrectly entered somewhere. I'm assuming that you are 
> running the shell on the same server that is running your Django instance? 
> You should be able to do the following on the server where Django is 
> running:
>
> $ python manage.py shell
> >>> import socket
> >>> # checks if name resolution is working at all
> >>> socket.gethostbyname('www.google.com')
> '74.125.20.105'
> >>> # note you may get a different IP address
> >>>
> >>> # check if your email host value is resolvable
> >>> socket.gethostbyname("mail.xx.ir")
> Traceback (most recent call last):
>   File "", line 1, in 
> gaierror: [Errno -5] No address associated with hostname
> >>> 
>
> Obviously I received an error here since I used the masked value you 
> provided. You should get an IPv4/IPv6 address back, or an error similar to 
> the one you posted.
>
> You can also do a quick check if you have shell or command prompt access 
> available on your server outside of Python:
>
> $ nslookup www.google.com
> Server: 127.0.1.1
> Address: 127.0.1.1#53
>
> Non-authoritative answer:
> Name: www.google.com
> Address: 74.125.239.112
> Name: www.google.com
> Address: 74.125.239.114
> Name: www.google.com
> Address: 74.125.239.113
> Name: www.google.com
> Address: 74.125.239.116
> Name: www.google.com
> Address: 74.125.239.115
>
> $ nslookup mail.xx.ir
> Server: 127.0.1.1
> Address: 127.0.1.1#53
>
> ** server can't find mail.xx.ir: NXDOMAIN
>
> An NXDOMAIN response 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 the 'host' command as an alternative if BIND tools 
> are installed). The output may be formatted differently but should provide 
> similar information.
>
> The full traceback for the error will likely be most helpful, though.
>
>
> -James
>
> On Thu, Jan 8, 2015 at 12:08 AM, Hossein Rashnoo  > wrote:
>
>> 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.core.mail import send_mail
>> send_mail('test', 'hello', 'xx...@xxx.ir ', ['
>> mye...@gmail.com '])
>>
>> And its successfully sent But when i use that two line code in view, i 
>> got this error:
>> gaierror at /userforget/ 
>>
>> [Errno -3] Temporary failure in name resolution
>>
>>
>> Please help me.
>>
>>  -- 
>> 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/6aaaeaac-dc68-477a-b2d7-7b2821097c36%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/6aaaeaac-dc68-477a-b2d7-7b2821097c36%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 dja

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

2015-01-09 Thread Hossein Rashnoo
; Just type quit to exit. If you do test it, as long as you get the "220 CMS5 
>> HighMail 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 this case it would be '79.175.161.174' from your nslookup 
>> command earlier. This 'should' bypass the DNS query to resolve the 
>> EMAIL_HOST to an IP address (since it is already an IP). If that works, 
>> then you definitely have some kind of DNS issue.
>>
>> -James
>>
>>
>>
>> On Thu, Jan 8, 2015 at 1:14 AM, Hossein Rashnoo > > wrote:
>>
>>> Thank you for your reply, it seems that every thing is ok:
>>> $ nslookup mail.pep.co.ir <http://mail.xx.ir/>
>>>
>>> Server: 10.252.84.50
>>> Address:10.252.84.50#53
>>>
>>> Non-authoritative answer:
>>> Name:   mail.pep.co.ir
>>> Address: 79.175.161.174
>>>
>>>
>>> and:
>>>
>>> $ python manage.py shell
>>>
>>> >>> import socket
>>> >>> socket.gethostbyname("mail.pep.co.ir")
>>> '79.175.161.174'
>>>
>>> I attach the whole traceback with this reply.thank you.
>>>
>>>
>>> On Thursday, January 8, 2015 12:08:26 PM UTC+3:30, James Schneider wrote:
>>>
>>>> Can you send the whole traceback?
>>>>
>>>> Name resolution errors indicate an issue with DNS reachability, or a 
>>>> domain name incorrectly entered somewhere. I'm assuming that you are 
>>>> running the shell on the same server that is running your Django instance? 
>>>> You should be able to do the following on the server where Django is 
>>>> running:
>>>>
>>>> $ python manage.py shell
>>>> >>> import socket
>>>> >>> # checks if name resolution is working at all
>>>> >>> socket.gethostbyname('www.google.com')
>>>> '74.125.20.105'
>>>> >>> # note you may get a different IP address
>>>> >>>
>>>> >>> # check if your email host value is resolvable
>>>> >>> socket.gethostbyname("mail.xx.ir")
>>>> Traceback (most recent call last):
>>>>   File "", line 1, in 
>>>> gaierror: [Errno -5] No address associated with hostname
>>>> >>> 
>>>>
>>>> Obviously I received an error here since I used the masked value you 
>>>> provided. You should get an IPv4/IPv6 address back, or an error similar to 
>>>> the one you posted.
>>>>
>>>> You can also do a quick check if you have shell or command prompt 
>>>> access available on your server outside of Python:
>>>>
>>>> $ nslookup www.google.com
>>>> Server: 127.0.1.1
>>>> Address: 127.0.1.1#53
>>>>
>>>> Non-authoritative answer:
>>>> Name: www.google.com
>>>> Address: 74.125.239.112
>>>> Name: www.google.com
>>>> Address: 74.125.239.114
>>>> Name: www.google.com
>>>> Address: 74.125.239.113
>>>> Name: www.google.com
>>>> Address: 74.125.239.116
>>>> Name: www.google.com
>>>> Address: 74.125.239.115
>>>>
>>>> $ nslookup mail.xx.ir
>>>> Server: 127.0.1.1
>>>> Address: 127.0.1.1#53
>>>>
>>>> ** server can't find mail.xx.ir: NXDOMAIN
>>>>
>>>> An NXDOMAIN response 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 the 'host' command as an alternative if BIND tools 
>>>> are installed). The output may be formatted differently but should provide 
>>>> similar information.
>>>>
>>>> The full traceback for the error will likely be most helpful, though.
>>>>
>>>>
>>>> -James
>>>>
>>>> On Thu, Jan 8, 2015 at 12:08 AM, Hossein Rashnoo  
>>>> wrote:
>>>>
>>&g

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) {
$("#resp").html("success");
},
error: function ()
{
$("#resp").html("error");
}
});};

And its worked But when i add type:POST part it cause error.

I use this django code to response that request:

def ajaxrecivelogin(request):
import json
response_data = {}
response_data['status'] = '1'
return HttpResponse(json.dumps(response_data), 
content_type="application/json")

Is it about my django code?

-- 
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/b4e8cb0c-e6cc-4245-9837-4226f2e9fcb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using jquery ajax POST method with django

2015-01-17 Thread Hossein Rashnoo


I correct my code and it's worked. Thank you guys for your help.

Ajax Code:

function checkuser() {
var myObject = new Object();
myObject.username = $('#username').val();
myObject.password = $('#password').val();
$.ajax({
url: 'http://10.252.84.159/ajaxrecivelogin/',
type: 'POST',
data: JSON.stringify(myObject),
context: this,
dataType: 'json',
success: function (data) {
alert( data.status );
},
error: function ()
{
alert( "Error" );
}
});};

Django Code:

def ajaxrecivelogin(request):
import json
import ast
x = ast.literal_eval(request.body)
response_data = {}
response_data['status'] = username
return HttpResponse(json.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() {
> $.ajax({
> url: 'http://10.252.84.159/ajaxrecivelogin',
> //type: 'POST',
> data: "{'username': 'aa', 'password' : 'bb'}",
> context: this,
> dataType: 'json',
> success: function (data) {
> $("#resp").html("success");
> },
> error: function ()
> {
> $("#resp").html("error");
> }
> });};
>
> And its worked But when i add type:POST part it cause error.
>
> I use this django code to response that request:
>
> def ajaxrecivelogin(request):
> import json
> response_data = {}
> response_data['status'] = '1'
> return HttpResponse(json.dumps(response_data), 
> content_type="application/json")
>
> Is it about my django code?
>
>

-- 
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/7c7b115e-73f8-4a8b-bc38-8bf2ec2481ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
   use username and password for login
   3. When successfully logged in users will redirect to external website 
   with a token
   4. And every time that website send me that token, I recognize that user 
   and pass some data to external website I'm try to use REST-Framework 
   authentication but it is too complicated Please help me.

-- 
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/3de99068-f5a2-4759-8be0-8d5e42d5f525%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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/6650db6b-1bd9-4f70-bbee-ed6bca3b95c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.https import WindowsHttpAuthenticated

ntlm = WindowsHttpAuthenticated(username='***', password='***')
client = Client(url, transport=ntlm)

But i got this error:



but when do this with python shell , it authenticate me in sharepoint and 
after that i can use other sharepoint service with view or shell. can any 
one tell me whats the problem?

-- 
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/4425ae16-2624-40ae-aac3-bf687b0f0d1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Djnago User login

2017-03-01 Thread Hossein Torabi
is there any method that i have two kind of users that once log in with 
user name and password and other one login with just with user name?

-- 
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/a4d0763b-0a0f-46c7-a75a-bd7f15ca7761%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 sorry for my terrible English.  

-- 
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/268b9011-1f1a-4f2f-8569-8c975a5ba11a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
> 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 sorry for my terrible English.  
>

-- 
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/2845f768-703c-4568-87ed-9eec6d97bfb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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...@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/02806b34-e930-492a-9a20-77d3ce96b8a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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_opener(server_url, "my username", "my password")
site = SharePointSite(site_url, opener)

htt=r"Sharepoint lists"
for sp_list in site.lists:
htt = htt + r" %s . %s " % (sp_list.id,sp_list.meta['Title'])
htt = htt + r""

t = get_template('userlogin/userloginres.html')
html= t.render(Context({"htt":htt}))
return HttpResponse(html)

But now when i open that url this error appear:

URLError at /test/login/



-- 
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/a982dfcf-6824-441a-ab5f-f68907e1f0d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Connect django project with sharepoint 2013

2014-12-06 Thread Hossein Rashnoo
I need this connection for adding list items and save my users data on 
sharepoint database. I ran it in command line and when i write something 
like """ print site.lists[0] """ this error appear :


  File "", line 1, in 
  File "/usr/lib/python2.6/site-packages/sharepoint/lists/__init__.py", 
line 84, in __getitem__
return self.all_lists[key]
  File "/usr/lib/python2.6/site-packages/sharepoint/lists/__init__.py", 
line 36, in all_lists
result = self.opener.post_soap(LIST_WEBSERVICE, xml)
  File "/usr/lib/python2.6/site-packages/sharepoint/site.py", line 31, in 
post_soap
response = self.opener.open(request)
  File "/usr/lib64/python2.6/urllib2.py", line 391, in open
response = self._open(req, data)
  File "/usr/lib64/python2.6/urllib2.py", line 409, in _open
'_open', req)
  File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 1190, in http_open
return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib64/python2.6/urllib2.py", line 1165, 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 
> script on the command line ? 
>
> François 
>
> > On Dec 6, 2014, at 7:10 AM, Hossein Rashnoo  > wrote: 
> > 
> > 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_opener(server_url, "my username", "my 
> password") 
> > site = SharePointSite(site_url, opener) 
> > 
> > htt=r"Sharepoint lists" 
> > for sp_list in site.lists: 
> > htt = htt + r" %s . %s " % 
> > (sp_list.id,sp_list.meta['Title']) 
>
> > htt = htt + r"" 
> > 
> > t = get_template('userlogin/userloginres.html') 
> > html= t.render(Context({"htt":htt})) 
> > return HttpResponse(html) 
> > 
> > But now when i open that url this error appear: 
> > 
> > URLError at /test/login/ 
> > 
> >  
> > 
> > -- 
> > 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/a982dfcf-6824-441a-ab5f-f68907e1f0d7%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/34b04a5b-0a1e-4405-9a73-a8e3856940a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Connect django project with sharepoint 2013

2014-12-06 Thread Hossein Rashnoo
I can access to http://portal:8080/ in my browser when i set our office 
proxy and port. And my linux server that i run django on it, is local. Do i 
need to set proxy to access sharepoint?

On Sunday, December 7, 2014 8:30:18 AM UTC+3:30, somecallitblues wrote:
>
> Urllib2 can't open the 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 it in command line and when i write something 
>> like """ print site.lists[0] """ this error appear :
>>
>>
>>   File "", line 1, in 
>>   File "/usr/lib/python2.6/site-packages/sharepoint/lists/__init__.py", 
>> line 84, in __getitem__
>> return self.all_lists[key]
>>   File "/usr/lib/python2.6/site-packages/sharepoint/lists/__init__.py", 
>> line 36, in all_lists
>> result = self.opener.post_soap(LIST_WEBSERVICE, xml)
>>   File "/usr/lib/python2.6/site-packages/sharepoint/site.py", line 31, in 
>> post_soap
>> response = self.opener.open(request)
>>   File "/usr/lib64/python2.6/urllib2.py", line 391, in open
>> response = self._open(req, data)
>>   File "/usr/lib64/python2.6/urllib2.py", line 409, in _open
>> '_open', req)
>>   File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
>> result = func(*args)
>>   File "/usr/lib64/python2.6/urllib2.py", line 1190, in http_open
>> return self.do_open(httplib.HTTPConnection, req)
>>   File "/usr/lib64/python2.6/urllib2.py", line 1165, 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 
>>> script on the command line ? 
>>>
>>> François 
>>>
>>> > On Dec 6, 2014, at 7:10 AM, Hossein Rashnoo  wrote: 
>>> > 
>>> > 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_opener(server_url, "my username", "my 
>>> password") 
>>> > site = SharePointSite(site_url, opener) 
>>> > 
>>> > htt=r"Sharepoint lists" 
>>> > for sp_list in site.lists: 
>>> > htt = htt + r" %s . %s " % (sp_list.id
>>> ,sp_list.meta['Title']) 
>>> > htt = htt + r"" 
>>> > 
>>> > t = get_template('userlogin/userloginres.html') 
>>> > html= t.render(Context({"htt":htt})) 
>>> > return HttpResponse(html) 
>>> > 
>>> > But now when i open that url this error appear: 
>>> > 
>>> > URLError at /test/login/ 
>>> > 
>>> >  
>>> > 
>>> > -- 
>>> > 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/a982dfcf-6824-441a-ab5f-f68907e1f0d7%
>>> 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...@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/34b04a5b-0a1e-4405-9a73-a8e3856940a2%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/34b04a5b-0a1e-4405-9a73-a8e3856940a2%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d8d8fd2a-d0e9-4820-9899-b8ba33c2eb17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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("http://portal:8080/";).read()
and i found this code for test:

import urllib.request# Create an OpenerDirector with support for Basic HTTP 
Authentication...auth_handler = 
urllib.request.HTTPBasicAuthHandler()auth_handler.add_password(realm='PDQ 
Application',
  uri='https://portal:8080/',
  user='my username',
  passwd='my password')opener = 
urllib.request.build_opener(auth_handler)# ...and install it globally so it can 
be used with 
urlopen.urllib.request.install_opener(opener)urllib.request.urlopen('http://portal:8080/')

But after last line i got this error:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
  File "/usr/lib64/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
  File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.6/urllib2.py", line 435, in error
return self._call_chain(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 518, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 401: Unauthorized

Please help me.


-- 
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/70d5031a-be70-4c51-b5eb-c75e821a251f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
problem.
Sorry for bad English.



-- 
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/d40c3896-12a9-4e39-93a6-6dda8d6cc121%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";>
   
   
  
 new doc
 2
 ab.ds
 QUJDREVGR0hJSktMTU5PUA==
  
   

DEBUG:suds.client:headers = {'SOAPAction': 
u'"http://schemas.microsoft.com/sharepoint/soap/AddAttachment";', 
'Content-Type': 'text/xml; charset=utf-8'}
DEBUG:suds.client:http succeeded:
http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>soap:ServerException
 
of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was 
thrown.http://schemas.microsoft.com/sharepoint/soap/";>Item does not exist. 
It may have been deleted by another 
user.
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 542, in 
__call__
return client.invoke(args, kwargs)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 602, in 
invoke
result = self.send(soapenv)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 643, in send
result = self.succeeded(binding, reply.message)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 678, in 
succeeded
reply, result = binding.get_reply(self.method, reply)
  File "/usr/lib/python2.6/site-packages/suds/bindings/binding.py", line 
151, in get_reply
self.detect_fault(soapbody)
  File "/usr/lib/python2.6/site-packages/suds/bindings/binding.py", line 
182, in detect_fault
raise WebFault(p, fault)
suds.WebFault: Server raised fault: 'Exception of type 
'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.'

please help me, tnx

-- 
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/ff2f5235-24aa-4f72-a14b-0bb496b9c98d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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".encode('utf8') % (fname)
xml = r"""my XML code with uni-code {0} """.format(fname)

And

fname = fname.encode('ascii', 'ignore').decode('ascii')
xml = r"""my XML code with uni-code {0} """.format(fname)

And every time i got this error:

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

Please help me.

-- 
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/ae41cdad-dc75-49be-8d93-ef308e2fe0f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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".encode('utf8') % (fname)
> xml = r"""my XML code with uni-code {0} """.format(fname)
>
> And
>
> fname = fname.encode('ascii', 'ignore').decode('ascii')
> xml = r"""my XML code with uni-code {0} """.format(fname)
>
> And every time i got this error:
>
> 'ascii' codec can't encode characters in position 0-3: ordinal not in 
> range(128)
>
> Please help me.
>

-- 
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/bc6c1f66-6c1e-49b8-baba-7431cb2e2d4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
/accounts/login/?next=/o/applications/ 
and django 404 error appear that tells:
The current URL, accounts/login/, didn't match any of these.
Please help me.

-- 
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/d1d60238-c0f0-4704-b41d-5d8224ca5da5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.html#create-an-oauth2-client-application>
>  i 
> got error. when i try to access http://localhost:8000/o/applications/ its 
> redirect to  http://localhost:8000 
> <http://localhost:8000/o/applications/>/accounts/login/?next=/o/applications/ 
> and django 404 error appear that tells:
> The current URL, accounts/login/, didn't match any of these.
> Please help me.
>

-- 
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/5d86d539-d9a5-4a81-bfaa-53842b5543d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.