Re: Do queries made instantiating a form not show up in db.connection.queries?

2018-11-01 Thread Jonathan Berger
Thank you!

I was looking at the value of 'connection.queries' before rendering the
form.

On Thu, Nov 1, 2018 at 6:12 PM Karen Tracey  wrote:

> On Thu, Nov 1, 2018 at 8:14 PM Jonathan Berger 
> wrote:
>
>>
>> Per the db and model FAQ
>> :
>> expected behavior is that 'connection.queries' should contain a list of all
>> SQL queries made by an app.
>>
>> I'm finding actual behavior for a Form subclass that has a
>> ModelMultipleChoiceField with a default queryset, does not add that query
>> to 'connection.queries'. This violates expected behavior.
>>
>>
>
> https://docs.djangoproject.com/en/2.1/ref/forms/fields/#django.forms.ModelChoiceField.queryset
> notes the queryset is "evaluated when the form is rendered." ...are you
> rendering the form or just instantiating it (per the subject)?
>
> Karen
>
>
> --
> 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/CACS9racCtAAgPLwv7-SBw-40Sddge_r9hpBS5eDBqE_1GGJbqA%40mail.gmail.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN1jqrL%2B8z5hbKVGx1Hnw6S5C8FCX75s2myQjAEYUxJwbWmUWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: foreign key is not working

2018-11-01 Thread amit pant
i used all method which is on docs but still it's not working properly.
 i am using django 2 with pyhton 3


On Wed, Oct 31, 2018 at 5:28 PM Paras Patidar 
wrote:

> Use:
> on_delete = models.CASCADE
> In Foreign Key
>
> On Wed 31 Oct, 2018, 5:15 PM amit pant,  wrote:
>
>> i used foreign key for make relationship between two model class but it
>> does not work properly, i used this for make subscription and on first
>> model their is choices for subscription.
>> help me why it is not working
>>
>> --
>> 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/ccb94b40-2c2d-4202-bfb9-37459770b99a%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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK-hKekN4hsqHexxoWww2Y%3DzsJukwx2PfH02D%2B%3DAF_qqfYQYyg%40mail.gmail.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF2Ah_HxAmfDAVnJdFDRz548ouD-FiFOH7iXDKbCK%2Bh-C%2BKEOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error when I use python manage.py makemigrations polls

2018-11-01 Thread amit pant
It's seems you could not add app on settings.py INSTALLED APPS list.
you should firstly add there then you can do makemigrations


On Fri, Nov 2, 2018 at 6:57 AM ALLAN NJOROGE 
wrote:

> Hey, I am a newbie in Django and am trying to learn by following the
> official documentation, I am stuck on writing your first code part 2, I
> have followed every step but keeps getting this error when I use python
> manage.py makemigrations polls, below is my code attached, please 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/438e8bb9-f71f-4df2-936e-2444cf4b8e4f%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF2Ah_F4c%3DA%3DLre6Mn3MkNYT3eMhPJxWLO7waOagLuW6G5%3DyGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error : MultiValueDictKeyError

2018-11-01 Thread amit pant
hey,
you can use request.POST.get('username')

-- 
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/CAF2Ah_HdpoX7DysJyVvty0susfqA6%3DZPSHmxYW68ZW%2BBmyAotg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error : MultiValueDictKeyError

2018-11-01 Thread Vivek Jha
We can create whatsapp group.Sharing of information will be more convenient

-- 
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/155c3031-8001-4d1a-9a18-20a31c112563%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error when I use python manage.py makemigrations polls

2018-11-01 Thread ALLAN NJOROGE
Thanks let me do that

On Thu, Nov 1, 2018 at 6:58 PM Dewansh Rawat 
wrote:

> Hey there!
> Can you please host you're code on GitHub or gist? It becomes quite easier
> to debug then.
>
> --
> 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/0085fc2e-9d89-4a80-b2b8-5e642def5501%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
*Allan Njoroge Kinyanjui*
*Email*: *njorogeall...@gmail.com* 



**God is Great!**

-- 
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/CANSz-dksF__4b-6a1Lx-CpAMg5dUvpDCcAWRGC9yNCidoRGL%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Error when I use python manage.py makemigrations polls

2018-11-01 Thread Dewansh Rawat
PS, also try this out, if it works out for you...

https://stackoverflow.com/questions/17931380/attributeerror-tuple-object-has-no-attribute-startswith

-- 
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/69e87f29-e9b5-465a-aae1-f7bab94adceb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error when I use python manage.py makemigrations polls

2018-11-01 Thread Dewansh Rawat
Hey there!
Can you please host you're code on GitHub or gist? It becomes quite easier to 
debug then.

-- 
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/0085fc2e-9d89-4a80-b2b8-5e642def5501%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error when I use python manage.py makemigrations polls

2018-11-01 Thread Dewansh Rawat
PS, also try this link, if it works out for you...

https://stackoverflow.com/questions/17931380/attributeerror-tuple-object-has-no-attribute-startswith

-- 
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/20999372-207e-4e6c-970f-020424c496a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error when I use python manage.py makemigrations polls

2018-11-01 Thread M Hashmi
Share Installed App snapshot again. Its not showing "polls" in installed
apps.

On Thu, Nov 1, 2018 at 6:27 PM ALLAN NJOROGE 
wrote:

> Hey, I am a newbie in Django and am trying to learn by following the
> official documentation, I am stuck on writing your first code part 2, I
> have followed every step but keeps getting this error when I use python
> manage.py makemigrations polls, below is my code attached, please 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/438e8bb9-f71f-4df2-936e-2444cf4b8e4f%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANoUts7uCKswVVqFjqHR3jV68icQO9TFm4MyO6HSfRV2i9XpTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Do queries made instantiating a form not show up in db.connection.queries?

2018-11-01 Thread Karen Tracey
On Thu, Nov 1, 2018 at 8:14 PM Jonathan Berger 
wrote:

>
> Per the db and model FAQ
> :
> expected behavior is that 'connection.queries' should contain a list of all
> SQL queries made by an app.
>
> I'm finding actual behavior for a Form subclass that has a
> ModelMultipleChoiceField with a default queryset, does not add that query
> to 'connection.queries'. This violates expected behavior.
>
>
https://docs.djangoproject.com/en/2.1/ref/forms/fields/#django.forms.ModelChoiceField.queryset
notes the queryset is "evaluated when the form is rendered." ...are you
rendering the form or just instantiating it (per the subject)?

Karen

-- 
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/CACS9racCtAAgPLwv7-SBw-40Sddge_r9hpBS5eDBqE_1GGJbqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django render html template isse

2018-11-01 Thread sidh
Hi,

I am executing script using django form and it provides me below results. 
It's good but i would like to render it to html template.

*return HttpResponse(onsubmit, content_type="text/plain")*

Output:
*URL: https://abc.com*
*Timestamp: Wed, Oct 31, 2018 18:44 GMT*
*HTTP Response Code: 500*

When i use below for render part my output is not showing with newline. 

  try:
  onsubmit = subprocess.check_output(["./xyz.py", abc])
  #return HttpResponse(onsubmit, content_type="text/plain")
  context = {
'onsubmit': onsubmit,
}
  return render_to_response('output.html', context=context, 
content_type="text/html")

Output :
*b'URL: https://abc.com/\nTimestamp: Wed, Oct 31, 2018 18:44 GMT\nHTTP 
Response Code: 500\n*

Any idea how to print this output with newline (like above) ? Any help is 
appreciated.

-- 
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/a10aaa67-c129-478d-861c-a88a6b5a1cd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django render output to template

2018-11-01 Thread sidh
Hi,

I created a form, on submit i am triggering a script

When i use :
  #return HttpResponse(onsubmit, content_type="text/plain")

my results are good but i want to render it to template to get good output. 

*Output:*

*URL: https://abc.com/*
*Timestamp: Wed, Oct 31, 2018 18:44 GMT*
*HTTP Response Code: 500*


Trying with this (to render output to template):
  try:
  onsubmit = subprocess.check_output(["./test.py", abc])
  context = {
'onsubmit': onsubmit,
}
  return render_to_response('output.html', context=context, 
content_type="text/html")

*Getting response :*

*b'URL: https://abc.com/\nTimestamp: Wed, Oct 31, 2018 18:44 GMT\nHTTP 
Response Code: 500\n*

Any idea how do i get output with newline ? Any help is appreciated.

-- 
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/4811eb48-8645-4238-9379-191cea04c749%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Do queries made instantiating a form not show up in db.connection.queries?

2018-11-01 Thread Jonathan Berger
Hi Django Users,

I'm a moderate-level user of Django and trying to determine if I've found a
bug.

Per the db and model FAQ
:
expected behavior is that 'connection.queries' should contain a list of all
SQL queries made by an app.

I'm finding actual behavior for a Form subclass that has a
ModelMultipleChoiceField with a default queryset, does not add that query
to 'connection.queries'. This violates expected behavior.

Am I misunderstanding something or is this a bug?

Thanks,
Jonathan

-- 
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/CAN1jqrL3WnSr6uWgUPBiowKd9VNpBFsR%2BeXkxERvTtSPcXH8fQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use Email to Login With Django Auth

2018-11-01 Thread Timothy Cook
I use this and it works great.
https://django-allauth.readthedocs.io/en/latest/installation.html



On Thu, Nov 1, 2018 at 9:08 AM Ryan Shepard  wrote:

> How could i go about allowing people to also use their email to sign into
> Django instead of a username? I have done research my self and tried
> creating my own backend for it. But it doesn'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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6046362-5149-4edf-adc8-273547213748%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Timothy W. Cook, CEO
Data Insights, Inc.

-- 
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/CAENjPc-GrHNi578a23XF6EUZa8-wc3eF4nZNd-3OwOZLYZ1aVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use Email to Login With Django Auth

2018-11-01 Thread Ryan Shepard
That helps a bunch, thank you!

On Thursday, November 1, 2018 at 12:44:20 PM UTC-5, Andrew Pinkham wrote:
>
> You may be interested in django-improved-user, as it provides an 
> email-based User model. 
>
> https://pypi.org/project/django-improved-user/ 
>
> Full disclosure: I am one of the original authors. If you have any trouble 
> with the package or documentation, please open an issue! 
>
> Andrew 
> https://jambonsw.com 
> https://django-unleashed.com 
>
>

-- 
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/36d40de6-234a-461a-bd95-0a80dca83493%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using django on kubernetes

2018-11-01 Thread Dan Davis
Thanks, would you say that running Minikube is the best way to learn 
Kubernetes at a significant level, or would you recommend a small 
Virtualbox/vagrant setup that really is a multi-node Kubernetes?   I don't 
really have enough cores and memory for the later anyway, but I could just 
start-up workloads on Amazon KCS or GCP to learn, if Minikube is not enough.

On Tuesday, October 30, 2018 at 5:59:18 PM UTC-4, Eric Pascual wrote:
>
> I'm not even sure those are the same as Docker containers even though 
> Kubernetes can run Docker images.
>
>
> Kubernetes is an orchestrator for Docker containers, not a container 
> engine. You can run the same images in K8S managed containers or on your 
> local Docker engine, using docker-compose for instance. I currently work on 
> a project related to a services platform based on micro-services deployed 
> in Docker containers. I test the images locally on my machine either in 
> docker-compose assemblies or in Minikube *(for validating the K8S 
> descriptors involved in deployment, configuration,...)* and then I deploy 
> the stuff on GCP.
>
>
> As already mentioned, K8S provides tools * (indicators, graphs,...)* to 
> monitor the resources used by pods. I would not use Linux metrics, if ever 
> they were representative when collected from inside a pod, since the 
> containers are running on VMs and they can be spread over different nodes 
> if your configuration involves multi-nodes load balancing.
>
>
> Eric
> --
> *From:* django...@googlegroups.com  <
> django...@googlegroups.com > on behalf of Dan Davis <
> dans...@gmail.com >
> *Sent:* Tuesday, October 30, 2018 6:56:32 PM
> *To:* Django users
> *Subject:* Re: Using django on kubernetes 
>  
> Andreas, 
>
> I don't know terribly much about Kubernetes, only Docker, however it seems 
> that Kubernetes must natively provide some metrics collection, i.e 
> https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/.
>   
>  It would be nice to correlate particular views and their arguments with 
> resource use.   If you are using a process model, not a threading model, 
> then I think the Linux system call getrusage() could do that, providing 
> that it is supported in Kubernetes containers.I'm not even sure those 
> are the same as Docker containers even though Kubernetes can run Docker 
> images.  Maybe you can educate me!
>
> Anyway, the package django-statsd might provide some help collecting APM 
> data without something like NewRelic, but if you can use a real APM, do it.
>
> On Tuesday, October 30, 2018 at 4:28:29 AM UTC-4, Andréas Kühne wrote:
>
> Hi all, 
>
> I have created a SPA with angular on the frontend and django rest 
> framework on the backend. It also has celery to do background tasks. 
> Everything is working as intended and it is running pretty smoothly.
>
> We have deployed it on kubernetes - so the frontend (with nginx) is 
> running in one pod, the backend is running in another and celery is running 
> on a third. Everything is connected and works. My question is more about 
> the resources settings for django. Does anyone have any experience in 
> setting up this? Currently I am running without resource limitations - 
> which means that the kubernetes master doesn't know how much resources the 
> django pod needs.
>
> There has to be someone more who has done this and has setup the resource 
> limits correctly - I would like some inspiration. I don't know how much 
> django requires
>
> Andréas
>
> -- 
> 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 djang...@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/f9691131-cb97-4286-a248-73aa65750efb%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d5383ce9-387d-4c41-91e2-f11ba452b9a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use Email to Login With Django Auth

2018-11-01 Thread maunish dave
Do not use django login authentication instead make your own authentication
page

On Fri 2 Nov, 2018, 12:12 AM Deb Das,  wrote:

> You can query for the given email and get the username, then getting the
> username do normal Django authentication.
>
> On Thu 1 Nov, 2018, 5:39 PM Ryan Shepard 
>> How could i go about allowing people to also use their email to sign into
>> Django instead of a username? I have done research my self and tried
>> creating my own backend for it. But it doesn'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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d6046362-5149-4edf-adc8-273547213748%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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADkC3UNVYaoHQj%2BztQK4R7XYW2SW1w1W9NtcSjnUmvg7asiEhA%40mail.gmail.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALpJ3uJQ6Km8JRJDq%2BpBJ_GVa9NaE%2Bnn8WOVSxRBgQwYiawMKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use Email to Login With Django Auth

2018-11-01 Thread Deb Das
You can query for the given email and get the username, then getting the
username do normal Django authentication.

On Thu 1 Nov, 2018, 5:39 PM Ryan Shepard  How could i go about allowing people to also use their email to sign into
> Django instead of a username? I have done research my self and tried
> creating my own backend for it. But it doesn'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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6046362-5149-4edf-adc8-273547213748%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADkC3UNVYaoHQj%2BztQK4R7XYW2SW1w1W9NtcSjnUmvg7asiEhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use Email to Login With Django Auth

2018-11-01 Thread Andrew Pinkham
You may be interested in django-improved-user, as it provides an email-based 
User model.

https://pypi.org/project/django-improved-user/

Full disclosure: I am one of the original authors. If you have any trouble with 
the package or documentation, please open an issue!

Andrew
https://jambonsw.com
https://django-unleashed.com

-- 
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/D94CF79F-E8D0-48B8-9203-033C715EF0FC%40andrewsforge.com.
For more options, visit https://groups.google.com/d/optout.


Django bugfix release: 2.1.3

2018-11-01 Thread Carlton Gibson
Details are available on the Django project weblog:

https://www.djangoproject.com/weblog/2018/nov/01/bugfix-release/

-- 
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/A5A49193-088D-46F6-86D8-07FD83A37F23%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: race condition on post multiple files to the same folder

2018-11-01 Thread Simon Charette
Hello there,

I think you just hit #29890[0], a bug present in Django in 2.0+ and fixed 
in Django 2.1.3
which should be released today[1].

Simply updating to 2.1.3 when it's released should address your issue.

Cheers,
Simon

[0] https://code.djangoproject.com/ticket/29890
[1] https://docs.djangoproject.com/en/2.1/releases/2.1.3/

Le jeudi 1 novembre 2018 08:09:13 UTC-4, Han Hu a écrit :
>
> Here is my model definition
>
> class Item(models.Model):
> name = models.CharField(max_length=256)
>
>
> def item_id_path(instance, filename):
> return '{}/{}'.format(instance.item.id, filename)
>
>
> # Create your models here.
> class File(models.Model):
> file = models.FileField(upload_to=item_id_path)
> timestamp = models.DateTimeField(auto_now_add=True)
> item = models.ForeignKey(Item, on_delete=models.CASCADE)
>
> def __str__(self):
> return self.file.name
>
>
> The application posts multiples file that belong to the same item. But I 
> run into race condition in making directories. My server stores all the 
> related files in a separate folder (named by the item id) together.
>
> In django/core/files/storage.py _save method it checks the existence of 
> uploading directory. When multiple files for the same item are uploaded the 
> first request checks the existence of the directory and is going to create 
> one, then it switches to the second file upload. It also finds that the 
> directory doesn't exist yet and it is going to do the same directory 
> creation. The second file upload will fail because the first file upload 
> has already created the folder. It fails at the last line of the following 
> code snippet in storage.py.
>
> def _save(self, name, content):
> full_path = self.path(name)
>
> # Create any intermediate directories that do not exist.
> directory = os.path.dirname(full_path)
> if not os.path.exists(directory):
> try:
> if self.directory_permissions_mode is not None:
> # os.makedirs applies the global umask, so we reset it,
> # for consistency with file_permissions_mode behavior.
> old_umask = os.umask(0)
> try:
> os.makedirs(directory, self.directory_permissions_mode)
> finally:
> os.umask(old_umask)
> else:
> os.makedirs(directory)
>
>
> what approach can I take to avoid this race condition? 
>
> I guess changing the source code from os.makedirs(directory) to 
> os.makedirs(directory, exist_ok=True) could work.
>
>  File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/rest_framework/mixins.py",
>  
> line 21, in create
> self.perform_create(serializer)
>   File "/Users/han/projects/django_maplus_server/rest_api/views.py", line 
> 27, in perform_create
> return super(FileViewSet, self).perform_create(serializer)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/rest_framework/mixins.py",
>  
> line 26, in perform_create
> serializer.save()
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/rest_framework/serializers.py",
>  
> line 214, in save
> self.instance = self.create(validated_data)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/rest_framework/serializers.py",
>  
> line 940, in create
> instance = ModelClass.objects.create(**validated_data)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/manager.py",
>  
> line 82, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/query.py",
>  
> line 413, in create
> obj.save(force_insert=True, using=self.db)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/base.py",
>  
> line 717, in save
> force_update=force_update, update_fields=update_fields)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/base.py",
>  
> line 747, in save_base
> updated = self._save_table(raw, cls, force_insert, force_update, 
> using, update_fields)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/base.py",
>  
> line 830, in _save_table
> result = self._do_insert(cls._base_manager, using, fields, update_pk, 
> raw)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/base.py",
>  
> line 868, in _do_insert
> using=using, raw=raw)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/manager.py",
>  
> line 82, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File 
> "/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/query.py",
>  
> line 1133, in _insert
> return 

Re: There's way to change "model_list" result variable name from ListView?

2018-11-01 Thread Daniel Roseman
On Wednesday, 31 October 2018 12:51:15 UTC, Fellipe Henrique wrote:
>
> Hi,
>
> Normal ListView result a list with "model"_list  as name... there's any 
> way to change these name?
>
>
>
You can set `context_object_name` to whatever name you want. 

This is documented 
here: 
https://docs.djangoproject.com/en/2.1/topics/class-based-views/generic-display/#making-friendly-template-contexts
-- 
DR.
 

-- 
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/abf4b557-63f6-430f-8a35-05a1497c6ab0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use Email to Login With Django Auth

2018-11-01 Thread Mikhailo Keda
use email as username)
check this code 
- 
https://bitbucket.org/voron-raven/chat/src/1073edbed7700a5bea87bf5b9c08297e7db57af6/core/views.py#lines-267:283
and modify POST to set email as username

-- 
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/084509a1-67d7-4758-a987-47c757722c56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use Email to Login With Django Auth

2018-11-01 Thread ansh srivastav
Your question is not clear, please be a bit specific.


[image: Mailtrack]

Sender
notified by
Mailtrack

11/01/18,
6:33:43 PM

On Thu, Nov 1, 2018 at 5:38 PM Ryan Shepard  wrote:

> How could i go about allowing people to also use their email to sign into
> Django instead of a username? I have done research my self and tried
> creating my own backend for it. But it doesn'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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6046362-5149-4edf-adc8-273547213748%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHMQ5337tAKwzT9_yh_4%3DYKP%3DJGkDAW9n8iiU1xZyt2X4KS4%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error in function to return permissions

2018-11-01 Thread Joel Mathew
Thank you!

Sincerely yours,

Joel G Mathew


On Wed, 31 Oct 2018 at 21:36, Stephen J. Butler
 wrote:
>
> @login_required needs "request" as the first parameter.
>
> On Wed, Oct 31, 2018 at 11:58 AM Joel Mathew  wrote:
>>
>> I have a custom function to check if a user is authorized to do
>> certain functions:
>>
>> @login_required
>> def checkpermission(request, permiss):
>> username = request.user.username
>> print(f"username is {username}")
>> print(f"User.objects.filter() is {User.objects.filter()}")
>> userobj = User.objects.get(username=username)
>> print(dir(userobj))
>> print(userobj.user_permissions.all())
>> print(Permission.objects.filter(group__user=userobj))
>> perms = getpermissions(userobj)
>> for perm in perms:
>> p = perm.name.lower().replace(" ", "_")
>> if permiss == p:
>> print("Has permission: %s" % p)
>> return True
>> print("No")
>> return False
>>
>> def getpermissions(userobj):
>> if userobj.is_superuser:
>> return Permission.objects.all()
>> return userobj.user_permissions.all() |
>> Permission.objects.filter(group__user=userobj)
>>
>> The problem arises if I write the previous function with decorator:
>>
>> @login_required
>> def getpermissions(userobj):
>> if userobj.is_superuser:
>> return Permission.objects.all()
>> return userobj.user_permissions.all() |
>> Permission.objects.filter(group__user=userobj)
>>
>> In this case, I get the error:
>>
>> 2018-10-31 21:26:51,239 django.request ERRORInternal Server Error:
>> /clinic/joelent/doctors
>> Traceback (most recent call last):
>>   File 
>> "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/exception.py",
>> line 34, in inner
>> response = get_response(request)
>>   File 
>> "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/base.py",
>> line 126, in _get_response
>> response = self.process_exception_by_middleware(e, request)
>>   File 
>> "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/base.py",
>> line 124, in _get_response
>> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>>   File 
>> "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
>> line 21, in _wrapped_view
>> return view_func(request, *args, **kwargs)
>>   File "/home/joel/myappointments/clinic/views.py", line 2797, in
>> clinicdoctorlist
>> if checkpermission(request, "can_change_doctor") and
>> HasMembership(request, cliniclabel):
>>   File 
>> "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
>> line 21, in _wrapped_view
>> return view_func(request, *args, **kwargs)
>>   File "/home/joel/myappointments/clinic/views.py", line 2970, in
>> checkpermission
>> perms = getpermissions(userobj)
>>   File 
>> "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
>> line 20, in _wrapped_view
>> if test_func(request.user):
>> AttributeError: 'User' object has no attribute 'user'
>>
>> Why would this be happening?
>>
>> Sincerely yours,
>>
>> Joel G Mathew
>>
>> --
>> 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/CAA%3Diw_94fELQWM873_y6w%2B0S8vCA2xtO44sG45dqMp4DSC8qeQ%40mail.gmail.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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAD4ANxVoNhmE78-n0SQFn1QFFz1O9-wXBs9p5G8jfsiXa190Kw%40mail.gmail.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9diL9pWgww7-rsgUDsBXp07jOipi%3DouTqTFZ%2B4M-Cr0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


race condition on post multiple files to the same folder

2018-11-01 Thread Han Hu
Here is my model definition

class Item(models.Model):
name = models.CharField(max_length=256)


def item_id_path(instance, filename):
return '{}/{}'.format(instance.item.id, filename)


# Create your models here.
class File(models.Model):
file = models.FileField(upload_to=item_id_path)
timestamp = models.DateTimeField(auto_now_add=True)
item = models.ForeignKey(Item, on_delete=models.CASCADE)

def __str__(self):
return self.file.name


The application posts multiples file that belong to the same item. But I 
run into race condition in making directories. My server stores all the 
related files in a separate folder (named by the item id) together.

In django/core/files/storage.py _save method it checks the existence of 
uploading directory. When multiple files for the same item are uploaded the 
first request checks the existence of the directory and is going to create 
one, then it switches to the second file upload. It also finds that the 
directory doesn't exist yet and it is going to do the same directory 
creation. The second file upload will fail because the first file upload 
has already created the folder. It fails at the last line of the following 
code snippet in storage.py.

def _save(self, name, content):
full_path = self.path(name)

# Create any intermediate directories that do not exist.
directory = os.path.dirname(full_path)
if not os.path.exists(directory):
try:
if self.directory_permissions_mode is not None:
# os.makedirs applies the global umask, so we reset it,
# for consistency with file_permissions_mode behavior.
old_umask = os.umask(0)
try:
os.makedirs(directory, self.directory_permissions_mode)
finally:
os.umask(old_umask)
else:
os.makedirs(directory)


what approach can I take to avoid this race condition? 

I guess changing the source code from os.makedirs(directory) to 
os.makedirs(directory, exist_ok=True) could work.

 File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/rest_framework/mixins.py",
 
line 21, in create
self.perform_create(serializer)
  File "/Users/han/projects/django_maplus_server/rest_api/views.py", line 
27, in perform_create
return super(FileViewSet, self).perform_create(serializer)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/rest_framework/mixins.py",
 
line 26, in perform_create
serializer.save()
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/rest_framework/serializers.py",
 
line 214, in save
self.instance = self.create(validated_data)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/rest_framework/serializers.py",
 
line 940, in create
instance = ModelClass.objects.create(**validated_data)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/manager.py",
 
line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/query.py",
 
line 413, in create
obj.save(force_insert=True, using=self.db)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/base.py",
 
line 717, in save
force_update=force_update, update_fields=update_fields)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/base.py",
 
line 747, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, 
update_fields)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/base.py",
 
line 830, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, 
raw)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/base.py",
 
line 868, in _do_insert
using=using, raw=raw)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/manager.py",
 
line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/query.py",
 
line 1133, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/sql/compiler.py",
 
line 1284, in execute_sql
for sql, params in self.as_sql():
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/sql/compiler.py",
 
line 1237, in as_sql
for obj in self.query.objs
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/sql/compiler.py",
 
line 1237, in 
for obj in self.query.objs
  File 
"/Users/han/anaconda3/envs/django/lib/python3.6/site-packages/django/db/models/sql/compiler.py",
 
line 1236, in 
   

Use Email to Login With Django Auth

2018-11-01 Thread Ryan Shepard
How could i go about allowing people to also use their email to sign into 
Django instead of a username? I have done research my self and tried 
creating my own backend for it. But it doesn'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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6046362-5149-4edf-adc8-273547213748%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: There's way to change "model_list" result variable name from ListView?

2018-11-01 Thread Derek
You question is not very clear; perhaps add some code and/or screenshots to 
show what you mean.

On Wednesday, 31 October 2018 14:51:15 UTC+2, Fellipe Henrique wrote:
>
> Hi,
>
> Normal ListView result a list with "model"_list  as name... there's any 
> way to change these name?
>
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 
> 's/(.)/chr(ord($1)-2*3)/ge'
> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh 
> *
> *Blog: *http:www.fellipeh.eti.br
> *GitHub: https://github.com/fellipeh *
> *Twitter: @fh_bash*
>

-- 
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/4aa47584-941a-426f-8b25-b64ae246b275%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.