Use DropBox to Store Static Files in Django

2021-01-27 Thread Samiddha সমিদ্ধ


*How to use DropBox to use/serve Static Files and Upload Media in django 
project?*

I use the method that mentioned here:  django-storages[dropbox] 

And also try this method:  django-dropbox-storage 


But both method doesn’t work. So what’s the right way?

-- 
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/e001c012-a364-43e5-b5ba-e049d687b013n%40googlegroups.com.


Use DropBox to Store Static Files in Django

2021-01-27 Thread Samiddha সমিদ্ধ
*How to use DropBox to use/serve Static Files and Upload Media in django 
project?*

I use the method that mentioned here: django-storages[dropbox] 

And try this method: django-dropbox-storage 


But both method doesn't work. So what's the right way?

-- 
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/a639598d-e333-4413-9c01-aea033a3c2f1n%40googlegroups.com.


Re: Show FK as input instead of drop down in admin

2021-01-27 Thread Mike Dewhirst

On 28/01/2021 3:28 pm, Jim Illback wrote:

I think Kevin’s issue is that it takes a huge amount of runtime to create the 
FK’s select HTML tag - Django having to go through 1M rows before displaying 
the page. This issue is true in UpdateView CBVs as well.

Changing the situation slightly - I’m talking about just primary keys from here 
on, not all FK’s. Is there some justification for Django forcing UpdateViews 
(and admin pages) to have to have the entire set of primary keys displayed and 
able to be changed? I believe the real world doesn’t operate like that. In SAP 
or Oracle apps or any other business process, you can’t change the primary key 
value willy nilly. For example, should an admin at Amazon be able to take my 
prime order and re-assign it to some other random person? No.

And, even if this is a specific business requirement (for example, one 
subsidiary needs their purchase order transferred to their peer subsidiary), 
that should be done via a unique exception process that checks all the business 
rules and circumstances, such as ensuring both companies belong to the same 
corporation. However, those are exception transactions, not the forced norm.

To make this situation work today in Django updates, all applications using an 
update with a primary key to a large table has to write special form or view 
__init__() methods to limit primary key or keys shown. Otherwise, you have to 
wait for the page to build enormous primary key select tags. Why?


Surely that is because Django cannot know what the developer wants. For 
that reason, Django suggests to write your own get_queryset() and your 
own formfield_for_foreignkey() methods in the admin to fetch relevant 
data from the database.


In my response to Kevin it was formfield_for_foreignkey() that I was 
alluding to in my option #1.


I realise that you have moved on from the Admin in your response above, 
but the principle is the same. I should not retrieve more than I need 
and I'm the only one who knows what I need.


Cheers

Mike



Jim


On Jan 27, 2021, at 7:07 PM, Mike Dewhirst  wrote:

On 28/01/2021 12:33 am, Kevin Olbrich wrote:

Hi!

Is it possible to disable fetching of related models for admin pages?
I have a field that links to a table containing more than 1M rows which django 
tries to fetch and build the drop down. For my purpose, it is sufficient if it 
is a simple input containing the id instead.

Couple of options ...

1. If there is a subset of 1M rows which apply you can filter the drop down 
list to just a few - or

2. Avoid the issue altogether

 - make the fk field in the model null=True and blank=True

 - make the fk field in the admin readonly

 - add a new integer field for the user-entered value of the desired id

 - in the model save() method[1] find the desired instance from the 1M rows 
and put it into the real fk field

Might work but not tested. This is a thought experiment.

Mike

[1]
def save(self, *args, **kwargs):
 # might need some adjusting for safety, business rules etc
 self.onem = OneM.objects.get(id=self.pseudo_fk)
 super().save(*args, **kwargs)


How can I accomplish this?

Thank you!

Kind regards
Kevin
--
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/12a7c928-a960-4c48-b631-93153260adbfn%40googlegroups.com
 
.


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


--
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/24a0de08-f460-5dea-47d4-df77a5d6170d%40dewhirst.com.au.



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


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

Re: Show FK as input instead of drop down in admin

2021-01-27 Thread Jim Illback
I think Kevin’s issue is that it takes a huge amount of runtime to create the 
FK’s select HTML tag - Django having to go through 1M rows before displaying 
the page. This issue is true in UpdateView CBVs as well. 

Changing the situation slightly - I’m talking about just primary keys from here 
on, not all FK’s. Is there some justification for Django forcing UpdateViews 
(and admin pages) to have to have the entire set of primary keys displayed and 
able to be changed? I believe the real world doesn’t operate like that. In SAP 
or Oracle apps or any other business process, you can’t change the primary key 
value willy nilly. For example, should an admin at Amazon be able to take my 
prime order and re-assign it to some other random person? No.

And, even if this is a specific business requirement (for example, one 
subsidiary needs their purchase order transferred to their peer subsidiary), 
that should be done via a unique exception process that checks all the business 
rules and circumstances, such as ensuring both companies belong to the same 
corporation. However, those are exception transactions, not the forced norm. 

To make this situation work today in Django updates, all applications using an 
update with a primary key to a large table has to write special form or view 
__init__() methods to limit primary key or keys shown. Otherwise, you have to 
wait for the page to build enormous primary key select tags. Why?

Jim

> On Jan 27, 2021, at 7:07 PM, Mike Dewhirst  wrote:
> 
> On 28/01/2021 12:33 am, Kevin Olbrich wrote:
>> Hi!
>> 
>> Is it possible to disable fetching of related models for admin pages?
>> I have a field that links to a table containing more than 1M rows which 
>> django tries to fetch and build the drop down. For my purpose, it is 
>> sufficient if it is a simple input containing the id instead.
> 
> Couple of options ...
> 
> 1. If there is a subset of 1M rows which apply you can filter the drop down 
> list to just a few - or
> 
> 2. Avoid the issue altogether
> 
> - make the fk field in the model null=True and blank=True
> 
> - make the fk field in the admin readonly
> 
> - add a new integer field for the user-entered value of the desired id
> 
> - in the model save() method[1] find the desired instance from the 1M 
> rows and put it into the real fk field
> 
> Might work but not tested. This is a thought experiment.
> 
> Mike
> 
> [1]
> def save(self, *args, **kwargs):
> # might need some adjusting for safety, business rules etc
> self.onem = OneM.objects.get(id=self.pseudo_fk)
> super().save(*args, **kwargs)
> 
>> 
>> How can I accomplish this?
>> 
>> Thank you!
>> 
>> Kind regards
>> Kevin
>> -- 
>> 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/12a7c928-a960-4c48-b631-93153260adbfn%40googlegroups.com
>>  
>> .
> 
> 
> -- 
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Just
> ask and I'll send it to you. Your email software can handle signing.
> 
> 
> -- 
> 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/24a0de08-f460-5dea-47d4-df77a5d6170d%40dewhirst.com.au.

-- 
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/9401C7F2-0042-4605-AA9A-E958D2AF0AE5%40hotmail.com.


Re: Show FK as input instead of drop down in admin

2021-01-27 Thread Mike Dewhirst

On 28/01/2021 12:33 am, Kevin Olbrich wrote:

Hi!

Is it possible to disable fetching of related models for admin pages?
I have a field that links to a table containing more than 1M rows 
which django tries to fetch and build the drop down. For my purpose, 
it is sufficient if it is a simple input containing the id instead.


Couple of options ...

1. If there is a subset of 1M rows which apply you can filter the drop 
down list to just a few - or


2. Avoid the issue altogether

    - make the fk field in the model null=True and blank=True

    - make the fk field in the admin readonly

    - add a new integer field for the user-entered value of the desired id

    - in the model save() method[1] find the desired instance from the 
1M rows and put it into the real fk field


Might work but not tested. This is a thought experiment.

Mike

[1]
def save(self, *args, **kwargs):
    # might need some adjusting for safety, business rules etc
    self.onem = OneM.objects.get(id=self.pseudo_fk)
    super().save(*args, **kwargs)



How can I accomplish this?

Thank you!

Kind regards
Kevin
--
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/12a7c928-a960-4c48-b631-93153260adbfn%40googlegroups.com 
.



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


--
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/24a0de08-f460-5dea-47d4-df77a5d6170d%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Conectarme a un AS/400 desde Django

2021-01-27 Thread Miguel Ángel Cumpa Ascuña
Hola, no puedes acceder a un archivo o no puedes acceder a una tabla en DB2
/400 de tu AS/400?

El mié, 27 ene 2021 a las 12:20, EDWARD A. LUGO A. ()
escribió:

> Buenos días, soy nuevo en Django y no he podido conectarme a un archivo
> que tengo dentro de un AS/400. La Librería se llama: RORIVENTAA y el
> archivo se llama: IVARET por favor si me pueden dar una mano, muchas
> gracias de antemano.
>
>
> --
> 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/e5b77eb9-9d79-4ebe-9b67-0a269c008965n%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/CAOZHYKOcKeqV%2BqB8DyZDRA56pmjhWykesiHBDN0b8ndfTSASLg%40mail.gmail.com.


Conectarme a un AS/400 desde Django

2021-01-27 Thread EDWARD A. LUGO A.
Buenos días, soy nuevo en Django y no he podido conectarme a un archivo que 
tengo dentro de un AS/400. La Librería se llama: RORIVENTAA y el archivo se 
llama: IVARET por favor si me pueden dar una mano, muchas gracias de 
antemano.


-- 
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/e5b77eb9-9d79-4ebe-9b67-0a269c008965n%40googlegroups.com.


Re: how create new django project with windows 10 and Python 3.9.1

2021-01-27 Thread Noel Simela
As easy as steps below:

In your CMD:

1.Python - m venv yourvirtualenvironment

2 yourvirtualenvironment\scripts\activate

3.Pip install django

4.django-admin start-project yourptojectname

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


Re: how create new django project with windows 10 and Python 3.9.1

2021-01-27 Thread Theresa Taye
Check if this helps: https://www.youtube.com/watch?v=hsrXhYElVdY

Warm regards



Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, 27 Jan 2021 at 15:03, Fabio Fidone 
wrote:

> [image: image.png]
>
> please, Can Someone help me to create a new project with python 3.9.1 and
> windows 10?
> every time, receive same output.
> thanks a lot
>
> --
> 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/CAPOyAVVC8ej_%3DSU2zmeMzjAxTDfitocCdwiD_bFX4eF49xcYuw%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/CAENBRfMDjM1frh3VyvmHkHiBvYetuLLf_dQchZVsDS8A6_F0ZQ%40mail.gmail.com.


Re: how create new django project with windows 10 and Python 3.9.1

2021-01-27 Thread RANGA BHARATH JINKA
Hi,

Don't use py in front. Try with django-admin startproject .
Also create a virtual environment and install modules inside that

All the best

On Wed, Jan 27, 2021 at 7:33 PM Fabio Fidone 
wrote:

> [image: image.png]
>
> please, Can Someone help me to create a new project with python 3.9.1 and
> windows 10?
> every time, receive same output.
> thanks a lot
>
> --
> 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/CAPOyAVVC8ej_%3DSU2zmeMzjAxTDfitocCdwiD_bFX4eF49xcYuw%40mail.gmail.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m314OBmD0U6AXuJp4_8TvQMeB6Z13%3DshfC-ANE2_iMSVUDw%40mail.gmail.com.


Re: How can I use my Company SSO(Single sign On ) for login into my django application ??

2021-01-27 Thread Larry Martell
On Wed, Jan 27, 2021 at 6:02 AM Kumar Gaurav  wrote:
>
> Hii ,
>
> My users come to my django application after authenticated from company SSO.
> Now , I don't want to create my own authentication model. I just want to 
> login the users who come to my page from the requests storing the details.
>
> Anyone know how to implement this ?? I am stuck on it from last week .

What is your company's SSO? Azure? If so you could use
https://pypi.org/project/django-microsoft-auth/

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


Stack Overflow Question

2021-01-27 Thread Vooks Education
Hello kind souls, 

Anyone able to solve this stackoverflow question. Both answers were not 
able to solve the issue :) Any help is appreciated!

https://stackoverflow.com/questions/65879639/how-do-i-include-my-def-clean-slug-function-into-my-views-or-template-so-that-it

-- 
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/f7b4487e-1fbc-432d-aba0-a8f7e6c24111n%40googlegroups.com.


how create new django project with windows 10 and Python 3.9.1

2021-01-27 Thread Fabio Fidone
[image: image.png]

please, Can Someone help me to create a new project with python 3.9.1 and
windows 10?
every time, receive same output.
thanks a lot

-- 
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/CAPOyAVVC8ej_%3DSU2zmeMzjAxTDfitocCdwiD_bFX4eF49xcYuw%40mail.gmail.com.


Stack Overflow Question --- delete function not working

2021-01-27 Thread Vooks Education
Any kind soul: How may I solve this stack overflow question :)

https://stackoverflow.com/questions/65912953/why-cant-i-remove-the-member-from-the-list-and-delete-their-interest

-- 
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/7597f99c-5ba0-402c-95e1-108d7d14130bn%40googlegroups.com.


Getting Error in auth_user table

2021-01-27 Thread Ajit Mourya

django.db.utils.ProgrammingError: there is no unique constraint matching 
given keys for referenced table "auth_user"

please explain why this error is popup while migrations.

-- 
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/0e14e31d-3b16-4795-9333-b00605db96e7n%40googlegroups.com.


How can I use my Company SSO(Single sign On ) for login into my django application ??

2021-01-27 Thread Kumar Gaurav
Hii ,

My users come to my django application after authenticated from company 
SSO. 
Now , I don't want to create my own authentication model. I just want to 
login the users who come to my page from the requests storing the details.

Anyone know how to implement this ?? I am stuck on it from last week .

Thanks in Advance !!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/108fc855-0f31-43e0-b77d-1044fb0a6072n%40googlegroups.com.


Show FK as input instead of drop down in admin

2021-01-27 Thread Kevin Olbrich
Hi!

Is it possible to disable fetching of related models for admin pages?
I have a field that links to a table containing more than 1M rows which 
django tries to fetch and build the drop down. For my purpose, it is 
sufficient if it is a simple input containing the id instead.

How can I accomplish this?

Thank you!

Kind regards
Kevin

-- 
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/12a7c928-a960-4c48-b631-93153260adbfn%40googlegroups.com.