Re: [URGENT] HOW TO DISPLAY IN HTML A PANDAS PLOTTING IN A DJANGO APPLICATION

2019-12-17 Thread Guy NANA
Thanks! I'll take a look at  your proposal.

Le lundi 16 décembre 2019 17:18:51 UTC+1, Integr@te System a écrit :
>
> Hi Gana,
>
> Try implement Django Panda module, 
> # Create DataFrameManager instance in model
> # Query data and then export to Panda dataframe by to_dataframe() method, 
> # After that convert to JSON data via to_json() method
> # Final render on context in any template of html file
>
> On Mon, Dec 16, 2019, 20:55 Guy NANA > 
> wrote:
>
>> Thanks for your answers
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/fe86faf3-829f-4854-907f-fd22966886f0%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/70cba688-7fa0-4536-9adb-467a5855b890%40googlegroups.com.


Embed an image in email Django

2019-12-17 Thread Santhosh sridhar
Hi,
I am using Django's Email message module to trigger an email with an embed 
image from my static folder. Could someone help? Below is the code that I 
have used.

Code :

recipient_list = ['a...@gmail.com']
from_email = 'a...@gmail.com'
message = ''
path = "{% static 'images/Welcome_image.jpg' %}" //*Using this image in 
the below html*
message += "\
\
\
\
\
\
\
\
\//*Using this 
image here but it is not rendered properly.*
\
\
\
\
\
\
\
Hi User,\
Welcome to the world.\
\
\
\
\
\
\
\
\
\
\
\
"%(path)

subject = "Welcome to the place!"
try:
msg = EmailMessage(subject, message, from_email, recipient_list)
msg.content_subtype = "html"  # Main content is now text/html
if any(recipient_list):
msg.send()
except Exception:
print("Exception while sending mail")

-- 
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/f72cbde4-66f5-47f6-b133-dad3787f33b8%40googlegroups.com.


manage.py can't run any commands

2019-12-17 Thread Phil Yang
Hi, 
The manage.py script for all my projects has suddenly stopped working. It 
can't run any commands, such as runserver or startapp.

Python is installed correctly; I have tested this with other scripts. I 
deleted Django and reinstalled, the problem still persists. 

Basically, whenever I run manage.py, there is no output.

-- 
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/c0c868e0-f780-43c0-aced-a7d2bfffdaf0%40googlegroups.com.


Greeting, introduce myself & wondering if one read all documentation.

2019-12-17 Thread Jack Lin
Hi all. I'm a new self-taught developer. Just decided to make backend 
development especially Django to be my full time career. 
I'm new to programming.. at least i just create my own ugly website and 
never involve in big projects or open-sources. I read a lot of tutorial and 
got the basic ideas through year but i didn't really acquire the ability of 
programming. I think I just don't spend enough time and always switching 
from field to field. I learn RoR, python, C, Unity, Security yeah, I 
know. too much and too naive. 

I know my passion is to create tools that utilize life and analyzing. 
ok, enough self introducing. 


I'm going through   
from 37 signals recently and starting to read Django's documentation.
The details in the documentation makes me exciting and happy. so i think 
i'm okay to read through it all.
However, I'll like some share of experience which is any one go through the 
whole documentation before?
does it change you or improve your skills in significant way? not limited 
in Django. if anyone used to read all the basic and have some thought, may 
you share that with 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a7d703e7-9d57-40f5-b464-31b1167a4534%40googlegroups.com.


Embed an image in email Django

2019-12-17 Thread Santhosh sridhar
Hi,
I am using Django's EmailMessage module to trigger an email with embedded 
image from the static directory path. Somehow the image is not rendering 
properly in the triggered email. Please find the below code and 
appreciating your help.

Thanks,
Santhosh

*Code:*
recipient_list = ['a...@gmail.com']
from_email = 'a...@gmail.com'
message = ''
path = "{% static 'images/Welcome_image.jpg' %}" //*Using this image in 
the below html*
message += "\
\
\
\
\
\
\
\
\  #*Using this 
static path here*
\
\
\
\
\
\
\
Hi User,\
Welcome to the world.\
\
\
\
\
\
\
\
\
\
\
\
"%(path)

subject = "Welcome to the place!"
try:
msg = EmailMessage(subject, message, from_email, recipient_list)
msg.content_subtype = "html"  # Main content is now text/html
if any(recipient_list):
msg.send()
except Exception:
print("Exception while sending mail")

-- 
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/0ebc6368-bc16-4d6b-9f4b-77af1f5fe377%40googlegroups.com.


manage.py not able to run any commands

2019-12-17 Thread Phil Yang
Hi, 
All of a sudden, when I tried to run manage.py runserver, it didn't produce 
any output, and it didn't do anything. In fact, the manage.py script seems 
to not be able to run other commands, such as startapp or createsuperuser.

I've already used the command many times prior, and it has always worked 
perfectly. 

Yes, Python is installed (I can run other scripts), but manage.py seems to 
have an issue.

Thanks.

-- 
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/c4b172e2-15a9-4fbf-96b6-e137086f614e%40googlegroups.com.


django orm filter queryset is returning empty

2019-12-17 Thread vignesh s
django orm filter queryset is returning empty queryset and also checked in 
the db the data is available

-- 
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/47ccb7db-b9d3-4216-b0d1-378aeed8c019%40googlegroups.com.


Django

2019-12-17 Thread Jani Eric
how to send sms from django website to mobile number at time 50 + number on 
one click please anyone here for guiding 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b128ed1e-91e1-47a8-911b-f4715cc2e96c%40googlegroups.com.


Postman API error

2019-12-17 Thread Tosin Ayoola
Hey guys I built an Api with django,  generally for sign up,  it's meant to
b used for Android app development,  but now when trying to sign up wit
postman,  I kip getting csrf_token error anyone wit clue on how I can fix
this

-- 
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/CAHLKn728QgutpcOvniqfe0BLt6RxqaJi4RnOWdQ82q0XuUNUbA%40mail.gmail.com.


how to send to sms to moblie number on one click at time to 25 numbers from django website ,,,,,, please anyone here for guidance

2019-12-17 Thread Jani Eric
how to send to sms to  moblie number on one click at time to 25 numbers 
from django website ,, please anyone  here for guidance

-- 
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/0426b23d-47a5-471f-b135-335346fafac6%40googlegroups.com.


Re: Embed an image in email Django

2019-12-17 Thread Giovanni Natale
The problem with that is that the url of the image does not contain the 
domain of your website. This is ok when you are using a browser to render a 
webpage but there is no way for an email client to understand the domain of 
the url if you do not include it explicitly. 

So, the image url should be something like 
"http://www.yourwebsite.com/images/Welcome_image.png";. 

I suggest you pass both the domain and the protocol ('http' or 'https') as 
a context variables to the template so the url will work both in 
development and production. 

It also looks you are including the html within the python code. Better 
putting that in a template html file 

El dimarts, 17 desembre de 2019 12:36:29 UTC+1, Santhosh sridhar va 
escriure:
>
> Hi,
> I am using Django's Email message module to trigger an email with an embed 
> image from my static folder. Could someone help? Below is the code that I 
> have used.
>
> Code :
>
> recipient_list = ['a...@gmail.com ']
> from_email = 'a...@gmail.com '
> message = ''
> path = "{% static 'images/Welcome_image.jpg' %}" //*Using this image 
> in the below html*
> message += " width='800'>\
> \
> \
> \
> \
> \
> \
> \
> \//*Using this 
> image here but it is not rendered properly.*
> \
> \
> \
> \
> \
> \
> \
>  style='font-family:arial,helvetica,sans-serif;font-size:13px' 
> valign='top'>Hi User,\
> Welcome to the world.\
> \
> \
> \
> \
> \
> \
> \
> \
> \
> \
> \
> "%(path)
>
> subject = "Welcome to the place!"
> try:
> msg = EmailMessage(subject, message, from_email, recipient_list)
> msg.content_subtype = "html"  # Main content is now text/html
> if any(recipient_list):
> msg.send()
> except Exception:
> print("Exception while sending mail")
>

-- 
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/88195d5b-cbff-43e0-ad86-94edf5cca6ed%40googlegroups.com.


Re: how to send to sms to moblie number on one click at time to 25 numbers from django website ,,,,,, please anyone here for guidance

2019-12-17 Thread Gil Obradors
Hi Jani!


First you need a provider able to send SMS via rest-API

Second,write some methods codes to talk to this api, python is good.

Third, make a frontend, to call this methodos via web.  You can start with
static content via django templates and requests , for example


Good luck!


Missatge de Jani Eric  del dia dt., 17 de des. 2019
a les 13:29:

> how to send to sms to  moblie number on one click at time to 25 numbers
> from django website ,, please anyone  here for guidance
>
> --
> 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/0426b23d-47a5-471f-b135-335346fafac6%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTQfwSKXtHgwUyc-VuC22GqhdSM8rHPcriKuSbbVq7yfFg%40mail.gmail.com.


Re: manage.py not able to run any commands

2019-12-17 Thread Integr@te System
Hi Phil,

Consider other command look like django-admin.
https://docs.djangoproject.com/en/3.0/ref/django-admin/

On Tue, Dec 17, 2019, 18:35 Phil Yang  wrote:

> Hi,
> All of a sudden, when I tried to run manage.py runserver, it didn't
> produce any output, and it didn't do anything. In fact, the manage.py
> script seems to not be able to run other commands, such as startapp or
> createsuperuser.
>
> I've already used the command many times prior, and it has always worked
> perfectly.
>
> Yes, Python is installed (I can run other scripts), but manage.py seems to
> have an issue.
>
> Thanks.
>
> --
> 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/c4b172e2-15a9-4fbf-96b6-e137086f614e%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP5HUWo5bHvrPBXQfHmd4R2MkSg1wecNtuExzSAZCU74d2%3DqLA%40mail.gmail.com.


Re: Django

2019-12-17 Thread Hedrick Godson's
You may use twilio api. Its a 3rd party services. Then make a list of your
phone numbers and do loop

On Tue, 17 Dec 2019, 15:12 Jani Eric  wrote:

> how to send sms from django website to mobile number at time 50 + number
> on one click please anyone here for guiding 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b128ed1e-91e1-47a8-911b-f4715cc2e96c%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJAxQDmqJMAOjQLW8Cj0Q-PmAoSQpkLV4_36GHDtt9yKfeKoNQ%40mail.gmail.com.


Re: Postman API error

2019-12-17 Thread Parth Joshi
You have to pass the csrf token in the header in postman.


Regards, 

Parth Joshi



> On 17-Dec-2019, at 5:54 PM, Tosin Ayoola  wrote:
> 
> Hey guys I built an Api with django,  generally for sign up,  it's meant to b 
> used for Android app development,  but now when trying to sign up wit 
> postman,  I kip getting csrf_token error anyone wit clue on how I can fix this
> 
> -- 
> 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/CAHLKn728QgutpcOvniqfe0BLt6RxqaJi4RnOWdQ82q0XuUNUbA%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CC9B8021-2536-450E-9D09-42B7D5C8E742%40gmail.com.


Re: how to send to sms to moblie number on one click at time to 25 numbers from django website ,,,,,, please anyone here for guidance

2019-12-17 Thread Parth Joshi
May be you can put a background service instead of doing it asynchronously. 
Wait time of 25 SMS responses will be annoying for user experience. 

Regards, 

Parth Joshi



> On 17-Dec-2019, at 7:00 PM, Gil Obradors  wrote:
> 
> Hi Jani!
> 
> 
> First you need a provider able to send SMS via rest-API
> 
> Second,write some methods codes to talk to this api, python is good.
> 
> Third, make a frontend, to call this methodos via web.  You can start with 
> static content via django templates and requests , for example
> 
> 
> Good luck!
> 
> 
> Missatge de Jani Eric mailto:janieric...@gmail.com>> 
> del dia dt., 17 de des. 2019 a les 13:29:
> how to send to sms to  moblie number on one click at time to 25 numbers from 
> django website ,, please anyone  here for guidance
> 
> -- 
> 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/0426b23d-47a5-471f-b135-335346fafac6%40googlegroups.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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAK-JoTQfwSKXtHgwUyc-VuC22GqhdSM8rHPcriKuSbbVq7yfFg%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3B6C4EEC-B6DC-4665-9A57-610E7F430C84%40gmail.com.


Re: invalid syntax in mysite url

2019-12-17 Thread Jorge Gimeno
On Tue, Dec 17, 2019 at 9:09 AM MEGA NATHAN 
wrote:

> Hi.
>
> syntax error how to clear this one.
>
> --
> 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/2f851282-b250-4575-830f-f74a08830a7a%40googlegroups.com
> 
> .
>

I see a missing comma in line 24...

-Jorge

-- 
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/CANfN%3DK_j0-JkgTU4YLCzpSbQPFbPejdD6qkX4rTCoN_Aqwtb9Q%40mail.gmail.com.


Re: invalid syntax in mysite url

2019-12-17 Thread Parvez Khan Pathan
may be you need to put ',' comma at line 24 after close parenthesis.

Try! If not work then
Will see more solution.

Regards
Parvez Khan Pathan
(Beginner DJango Enthusiastic)

On Tue, 17 Dec 2019, 10:39 pm MEGA NATHAN, 
wrote:

> Hi.
>
> syntax error how to clear this one.
>
> --
> 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/2f851282-b250-4575-830f-f74a08830a7a%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADaFQ_LwO3ij0HwszZQ7555cQtSL7nxeWEPkji5RN%2BhJVWhL0g%40mail.gmail.com.


Re: how to send to sms to moblie number on one click at time to 25 numbers from django website ,,,,,, please anyone here for guidance

2019-12-17 Thread Motaz Hejaze
use twilio

On Tue, Dec 17, 2019 at 2:29 PM Jani Eric  wrote:

> how to send to sms to  moblie number on one click at time to 25 numbers
> from django website ,, please anyone  here for guidance
>
> --
> 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/0426b23d-47a5-471f-b135-335346fafac6%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-ek55o5hqetUrSe_WRCjGBzh9XxuO8A88pkq4kJ3g%3D-bg%40mail.gmail.com.


Re: django orm filter queryset is returning empty

2019-12-17 Thread Ahmad Ebrahim
Show me your code.

On Tue, 17 Dec 2019, 14:36 vignesh s,  wrote:

> django orm filter queryset is returning empty queryset and also checked in
> the db the data is available
>
> --
> 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/47ccb7db-b9d3-4216-b0d1-378aeed8c019%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABrrHYrji_tLR59qAyZqa1x%2BX-gsNXhXzTyvHp3keBdi8gqgjA%40mail.gmail.com.


Re: field error in live how to reslove

2019-12-17 Thread Ahmad Ebrahim
Show me your model and view

On Tue, 17 Dec 2019, 20:11 MEGA NATHAN,  wrote:

> Hi all.
>
> field error in live how to reslove
> below i have to attach the screensh please find out and let 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5b3c4129-583f-43d2-baee-8c4d2bcc74ce%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABrrHYo6a57aR0qf6ej8ev5pFgMTLF9gabwYnPc3PNQ0fypV4w%40mail.gmail.com.


Renaming sequences

2019-12-17 Thread Mike Dewhirst
Are there any consequences for renaming sequences to match the tables 
which own them?


In an existing production Django project I have just converted auth.user 
into common.user and company.userprofile into common.userprofile.


Having gone through the migration process more or less unscathed the 
original sequences are owned by the renamed tables. Eg 
public.auth_user_id_seq is owned by public.common_user.id


Everything seems to work fine but my unit tests are playing up and error 
messages are showing the original (and still correct) sequence names. It 
would make much visual sense to me now and especially to the future me 
(or anyone else) if the sequences were renamed as well.


I know how I could do it but I just need to know if I should.

Thanks for any advice

Mike

--
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/f0711339-6268-7894-2480-ead979282422%40dewhirst.com.au.


Should a custom user have meta.swappable

2019-12-17 Thread Mike Dewhirst

Looking at django.contrib.auth.models I see ...

class User(AbstractUser):

    """

    Users within the Django authentication system are represented by this

    model.

    Username and password are required. Other fields are optional.

    """

    class Meta(AbstractUser.Meta):

    swappable = 'AUTH_USER_MODEL'


... and I wonder if my custom user model should have an identical Meta 
attibute?


Thanks

Mike

--
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/5a6ad041-4e01-bc5f-619c-f01719d94422%40dewhirst.com.au.


Re: Should a custom user have meta.swappable

2019-12-17 Thread James Bennett
On Tue, Dec 17, 2019 at 10:47 PM Mike Dewhirst 
wrote:

> ... and I wonder if my custom user model should have an identical Meta
> attibute?
>

No, The 'swappable' Meta attribute is private/undocumented API; if it were
meant to be a thing you needed to set, the documentation would tell you to
set it, rather than it being hidden away in the source code.

It exists to support Django's ability to replace the default User model
with a custom-defined model class; only the model class that is meant to be
replaceable declares the 'swappable' attribute.

-- 
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/CAL13Cg-G7zqWABf_VyZeUO9PtY67d5S-S7gpGdQwQXwR27mSbA%40mail.gmail.com.


Re: Should a custom user have meta.swappable

2019-12-17 Thread Mike Dewhirst

Thank you James

M


On 18/12/2019 5:57 pm, James Bennett wrote:
On Tue, Dec 17, 2019 at 10:47 PM Mike Dewhirst > wrote:


... and I wonder if my custom user model should have an identical
Meta
attibute?


No, The 'swappable' Meta attribute is private/undocumented API; if it 
were meant to be a thing you needed to set, the documentation would 
tell you to set it, rather than it being hidden away in the source code.


It exists to support Django's ability to replace the default User 
model with a custom-defined model class; only the model class that is 
meant to be replaceable declares the 'swappable' attribute.

--
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/CAL13Cg-G7zqWABf_VyZeUO9PtY67d5S-S7gpGdQwQXwR27mSbA%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/75159cc0-aa16-8192-695f-711d8438c273%40dewhirst.com.au.