Django bugfix releases issued: 3.0.8 and 2.2.14

2020-06-30 Thread Mariusz Felisiak

Details are available on the Django project weblog:

https://www.djangoproject.com/weblog/2020/jul/01/django-bugfix-releases-308-2214/

--
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/d04ce1ab-9cac-9e28-0791-1bc9ee385115%40gmail.com.


How to display a line graph in Django?

2020-06-30 Thread ratnadeep ray
Hi all, 

I have wrote a python program to display the line graph as follows: 

import matplotlib.pyplot as plt 

x = [1,2,3] 
y = [2,4,1] 
  

plt.plot(x, y) 
  

plt.xlabel('x - axis') 
plt.ylabel('y - axis') 
  

plt.title('My first graph!') 
  
plt.show()


Now I need to display the same via Django. So I think I need to write the 
above code in the view and then redirect the same to the html template 
file. Am I right? 

In that case, how to send the request objects related to the line chart to 
the template? 

Normally, we send in the following format: 

def view1(request)


 return render(request, 'display_report.html', { 'var1': "abc", ...
 ... })

So if we are trying to display the line graph generated by the above code, 
how to do so ? 

Please share your inputs. 

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/827e0d0c-6bbb-4511-af73-9fa379df699do%40googlegroups.com.


Need suggestions-Reg

2020-06-30 Thread Sai Pavan Kumar
Hi ,
I need to integrate the video conferencing in my Django
application.which is the best open source video conferencing tool available
.please suggest me.

Thanks and Regards
Pavan T

-- 
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/CAFJPboZZJmF5Z-nnT6MLui%2BP8AzvMB3i3itzXFNZEUPyiSe%3D_g%40mail.gmail.com.


Re: Can anybody answe how i can access infromation from the parent modell i my HTML template in Django?

2020-06-30 Thread The Sha
Thank you friend, it worked

Den tisdag 30 juni 2020 kl. 13:22:11 UTC+2 skrev Andréas Kühne:
>
> All you need to do is update the render call a dictionary with the 
> customuser variable in it:
>
> return render(request, 'members/member_contact_form.html', 
> {'ContactFormset':ContactFormset, 'Address Formset':AddressFormset, 
> 'customuser': 
> customuser })
>
> Regards,
>
> Andréas
>
>
> Den tis 30 juni 2020 kl 11:06 skrev The Sha  >:
>
>> Ok i understand, how du i put the CustomUser in the render method so i 
>> cant get {{ CustomUser.first_name }} in this case?
>>
>> Den tisdag 30 juni 2020 kl. 11:00:53 UTC+2 skrev Andréas Kühne:
>>>
>>> Hi,
>>>
>>> You need to pass the variables that you want to use in the template to 
>>> the template itself. You do this here:
>>>
>>> return render(request, 'members/member_contact_form.html', 
>>> {'ContactFormset':ContactFormset, 'AddressFormset':AddressFormset })
>>>
>>> The dictionary you add to the render method there contains all the 
>>> objects that you can get in the template itself. So if you want to add 
>>> something called object you need to add that to the dictionary.
>>>
>>> Med vänliga hälsningar,
>>>
>>> Andréas
>>>
>>> Den tis 30 juni 2020 kl 10:38 skrev The Sha :
>>>




 

 I have a two formsets rendered in a view called ContactIndex, the 
 parent model for this view is the CustomUser model. I want to present the 
 first_name of the user object in my html template. I've tried these tags 
 without success any advise?

 This is the tags in my HTML template:

 {{ customuser.first_name }} - does not work

 {{ object.first_name }} - does not work


 *This is my view:*

 def ContactIndex(request, CustomUser_id):
 customuser = CustomUser.objects.get(pk=CustomUser_id)
 if request.method == "POST":
 ContactFormset = ContactInlineFormSet(request.POST, 
 request.FILES, instance=customuser)
 AddressFormset = AddressInlineFormSet(request.POST, 
 request.FILES, instance=customuser)
 if ContactFormset.is_valid() or AddressFormset.is_valid():
 AddressFormset.save()
 ContactFormset.save()
 # Do something. Should generally end with a redirect. For 
 example:
 return redirect ('ContactIndex', 
 CustomUser_id=customuser.id)
 else:
 ContactFormset = ContactInlineFormSet(instance=customuser)
 AddressFormset = AddressInlineFormSet(instance=customuser)
 return render(request, 'members/member_contact_form.html', 
 {'ContactFormset':ContactFormset, 'Address

 Formset':AddressFormset })

 -- 
 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/865ff205-9a1d-4f62-bbe4-d2d12da22374o%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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/2ab18788-3a31-4c7f-bba7-890580540153o%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/036bac0e-f999-401e-afd6-7a14f940bf5fo%40googlegroups.com.


Re: Can anybody answe how i can access infromation from the parent modell i my HTML template in Django?

2020-06-30 Thread The Sha
It worked thank you my friend!

Den tisdag 30 juni 2020 kl. 11:00:53 UTC+2 skrev Andréas Kühne:
>
> Hi,
>
> You need to pass the variables that you want to use in the template to the 
> template itself. You do this here:
>
> return render(request, 'members/member_contact_form.html', 
> {'ContactFormset':ContactFormset, 'AddressFormset':AddressFormset })
>
> The dictionary you add to the render method there contains all the objects 
> that you can get in the template itself. So if you want to add something 
> called object you need to add that to the dictionary.
>
> Med vänliga hälsningar,
>
> Andréas
>
> Den tis 30 juni 2020 kl 10:38 skrev The Sha  >:
>
>>
>>
>>
>>
>> 
>>
>> I have a two formsets rendered in a view called ContactIndex, the parent 
>> model for this view is the CustomUser model. I want to present the 
>> first_name of the user object in my html template. I've tried these tags 
>> without success any advise?
>>
>> This is the tags in my HTML template:
>>
>> {{ customuser.first_name }} - does not work
>>
>> {{ object.first_name }} - does not work
>>
>>
>> *This is my view:*
>>
>> def ContactIndex(request, CustomUser_id):
>> customuser = CustomUser.objects.get(pk=CustomUser_id)
>> if request.method == "POST":
>> ContactFormset = ContactInlineFormSet(request.POST, 
>> request.FILES, instance=customuser)
>> AddressFormset = AddressInlineFormSet(request.POST, 
>> request.FILES, instance=customuser)
>> if ContactFormset.is_valid() or AddressFormset.is_valid():
>> AddressFormset.save()
>> ContactFormset.save()
>> # Do something. Should generally end with a redirect. For 
>> example:
>> return redirect ('ContactIndex', CustomUser_id=customuser.id)
>> else:
>> ContactFormset = ContactInlineFormSet(instance=customuser)
>> AddressFormset = AddressInlineFormSet(instance=customuser)
>> return render(request, 'members/member_contact_form.html', 
>> {'ContactFormset':ContactFormset, 'Address
>>
>> Formset':AddressFormset })
>>
>> -- 
>> 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/865ff205-9a1d-4f62-bbe4-d2d12da22374o%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/0e80aec7-2a58-41d8-8125-425db2231313o%40googlegroups.com.


Re: Is there a package that enables one Django project to authenticate via a second Django project?

2020-06-30 Thread David Rashty
That's exactly what I was thinking, but I need to test it.  Thanks!



On Tue, Jun 30, 2020 at 12:54 PM Julio Cojom 
wrote:

> What about using DRF with token login?
>
>
>
> El jue., 25 jun. 2020 a las 13:26, Dave R () escribió:
>
>> I keep running into this problem and started working on a custom
>> solution... but before I spend hours on this, I want to confirm that such a
>> package/solution doesn't already exist.
>>
>> I was working on a large project last year that involved a single set of
>> users and many small applications.  I made each application a Django app
>> and had them all tied together in one database.  There was only one
>> database dependency between the applications: the User table.
>>
>> This became almost impossible to maintain for  multiple reasons:
>> * I had two apps that required different values in settings.py
>> * The test suite took forever to run
>> * One of the apps was developed originally using Postgres and I had to
>> spend hours hacking through code getting it to work with MySQL
>> * I had to share my entire code base to employ freelancers
>> * I had to deprecate one of the apps and this became a project in itself
>> (i.e., remove references in settings.py, dropping database tables, etc.)
>>
>> Next time I'm in this situation, I'd like to develop each application as
>> a separate Django project and have them authenticate (via OpenID Connect)
>> to a project dedicated to this (e.g., accounts.mysite.com).
>>
>> Has anyone seen an out-of-the-box solution for this?  The question is
>> very open-ended.
>>
>> --
>> 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/0050a73c-fc46-449b-b087-a9f99508fadeo%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/TJQ_2Kx4O2U/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAHRQUHmRr_PFJpGA2sq%2B7bp4ci0pGo4es%2BxMP_CNdwM-NyTgwg%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/CALGYj_1q2bsEeXOhY9MONh%3DU6sMjtxyrxFG0TFDCnB%3DHQ9JOUA%40mail.gmail.com.


Re: Is there a package that enables one Django project to authenticate via a second Django project?

2020-06-30 Thread Julio Cojom
What about using DRF with token login?



El jue., 25 jun. 2020 a las 13:26, Dave R () escribió:

> I keep running into this problem and started working on a custom
> solution... but before I spend hours on this, I want to confirm that such a
> package/solution doesn't already exist.
>
> I was working on a large project last year that involved a single set of
> users and many small applications.  I made each application a Django app
> and had them all tied together in one database.  There was only one
> database dependency between the applications: the User table.
>
> This became almost impossible to maintain for  multiple reasons:
> * I had two apps that required different values in settings.py
> * The test suite took forever to run
> * One of the apps was developed originally using Postgres and I had to
> spend hours hacking through code getting it to work with MySQL
> * I had to share my entire code base to employ freelancers
> * I had to deprecate one of the apps and this became a project in itself
> (i.e., remove references in settings.py, dropping database tables, etc.)
>
> Next time I'm in this situation, I'd like to develop each application as a
> separate Django project and have them authenticate (via OpenID Connect) to
> a project dedicated to this (e.g., accounts.mysite.com).
>
> Has anyone seen an out-of-the-box solution for this?  The question is very
> open-ended.
>
> --
> 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/0050a73c-fc46-449b-b087-a9f99508fadeo%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/CAHRQUHmRr_PFJpGA2sq%2B7bp4ci0pGo4es%2BxMP_CNdwM-NyTgwg%40mail.gmail.com.


Re: Is there a package that enables one Django project to authenticate via a second Django project?

2020-06-30 Thread David Rashty
Thanks!

1. Yes.  djangito_server and djangito_client are regular Django apps that
are optimized to work together but can be used separately.  However, I
haven't specifically tested it using djangito_server with social_django.
I'll add "testing with social_django" as an item on the github issues list.
2. I looked at social_django and allauth, but didn't use them for a few
reasons.  The biggest is that I wanted to pull foreign key data in addition
to regular User data.  (djangito_client assumes that nested JSON
represents foreign key data.)  Also, I just didn't see enough value in
these 3rd party packages to create another dependency for djangito.  I did
leverage django-oauth-toolkit on the server side, however.   If there is
something I'm missing, please let me know.
3. 90% of the plumbing is there to support this.  I'll add it as an
enhancement in github issues.

In general, there are 4 advantages to using djangito vs other solutions:
1) It works out of the box
2) It handles foreign key fields on the User table
3) The server pushes changes to the user data to all the related
djangito_client applications
4) client data can be automatically merged into djangito_server.  (Note:
This isn't implemented yet.)  So if you have two projects with separate
user data, you can merge them all together to have a single source of
truth.  I'll probably add this as a button on the Django admin page.


On Tue, Jun 30, 2020 at 4:00 AM Andréas Kühne 
wrote:

> Hi,
>
> I saw your other post - great work with the oauth server and client apps.
> I think the solution looks very promising.
>
> I like the way you can configure everything. A few questions though:
> 1. Would it be possible to use another SSO package to login to the
> Djangito server? We currently use social_django to do the login which the
> client fixes.
> 2. Why not base it on other already existing products (like social_django)
> and not need to add your own code for everything?
> 3. Because it's based on oauth it should be possible to authenticate with
> an angular app for example - or?
>
> Regards,
>
> Andréas
>
>
> Den mån 29 juni 2020 kl 11:29 skrev David Rashty :
>
>> Got it.  Thanks for following up.
>>
>> I ended up rolling out my own solution based on django-oauth-toolkit:
>> https://github.com/pandichef/djangito
>>
>>
>> I'd love to get some feedback if you get a chance.  Thanks!
>>
>>
>>
>> On Mon, Jun 29, 2020 at 5:10 AM Andréas Kühne 
>> wrote:
>>
>>> The remote user functionality is still valid - however it is rarely
>>> used. I heard about it myself from one of the Django fellows - who are
>>> responsible for handling ticket triage on the django project itself. He
>>> said exactly what you are saying - that there isn't that much information
>>> about it and that the usage is not wide spread. However for your use case I
>>> would look into it?
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>>
>>> Den tors 25 juni 2020 kl 22:52 skrev Dave R :
>>>
 Is REMOTE_USER a technology that's still used?  Aside from the one page
 of documentation, I don't see a lot of other references to it on Stack
 Overflow, etc.

 In my implementation, the client authenticates to the server, pulls the
 latest-and-greatest user data, then saves it on the client database.

 Philosophically, I guess it's a personal preference.  But, as a startup
 person, I tend to build a lot of throwaway apps that I don't want
 cluttering up the core tried-and-tested apps.

 On Thursday, June 25, 2020 at 3:55:40 PM UTC-4 andrea...@hypercode.se
 wrote:

> First of all - why separate the django apps into various projects?
> That seems a bit strange because you are depending on one user account and
> one database? There isn't really any benefit of doing it like that - why
> not use a single django project?
>
> But on the other hand - if you want to continue doing it like that -
> what I would do is setup a "user" project - that only handles the users.
> Then you can use the remote user functionality of django in the other
> projects. That way you have the user object centralized and all of the
> projects can use the user interface from the remote user.
>
> https://docs.djangoproject.com/en/3.0/howto/auth-remote-user/
>
> The reason I wouldn't use open id connect is because you still need a
> local user object for each project in that case.
>
> Regards,
>
> Andréas
>
>
> Den tors 25 juni 2020 kl 21:26 skrev Dave R :
>
>> I keep running into this problem and started working on a custom
>> solution... but before I spend hours on this, I want to confirm that 
>> such a
>> package/solution doesn't already exist.
>>
>> I was working on a large project last year that involved a single set
>> of users and many small applications.  I made each application a Django 
>> app
>> and had them all tied together in one database.  There was 

call the model of the secondary database in djnago using Multiple Databases

2020-06-30 Thread Pradyum Gupta
https://stackoverflow.com/q/62658396/7999665

-- 
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/5a9e3323-bc2d-47af-b971-b54df2524057n%40googlegroups.com.


Re: Live updates of Admin's list_display data

2020-06-30 Thread Suraj Thapa FC
Use channels

On Tue, 30 Jun, 2020, 4:36 pm Olivier,  wrote:

> Hello,
>
> Django Admin implements list_display settings with which you can create
> columns of database-extracted or computed values.
>
> Is there to update these values without requiring Django Admin users to
> reload or refresh current page ?
>
> Best regards
>
> --
> 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/447f4c0e-b751-4730-bc51-5c87c5ae64e3o%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/CAPjsHcESNxUCFr38CQknM9Dkyi5ZrCWmhOXduN1ZyU5JYJg_hA%40mail.gmail.com.


Re: Can anybody answe how i can access infromation from the parent modell i my HTML template in Django?

2020-06-30 Thread Andréas Kühne
All you need to do is update the render call a dictionary with the
customuser variable in it:

return render(request, 'members/member_contact_form.html',
{'ContactFormset':ContactFormset, 'Address Formset':AddressFormset,
'customuser':
customuser })

Regards,

Andréas


Den tis 30 juni 2020 kl 11:06 skrev The Sha :

> Ok i understand, how du i put the CustomUser in the render method so i
> cant get {{ CustomUser.first_name }} in this case?
>
> Den tisdag 30 juni 2020 kl. 11:00:53 UTC+2 skrev Andréas Kühne:
>>
>> Hi,
>>
>> You need to pass the variables that you want to use in the template to
>> the template itself. You do this here:
>>
>> return render(request, 'members/member_contact_form.html', 
>> {'ContactFormset':ContactFormset, 'AddressFormset':AddressFormset })
>>
>> The dictionary you add to the render method there contains all the
>> objects that you can get in the template itself. So if you want to add
>> something called object you need to add that to the dictionary.
>>
>> Med vänliga hälsningar,
>>
>> Andréas
>>
>> Den tis 30 juni 2020 kl 10:38 skrev The Sha :
>>
>>>
>>>
>>>
>>>
>>> 
>>>
>>> I have a two formsets rendered in a view called ContactIndex, the parent
>>> model for this view is the CustomUser model. I want to present the
>>> first_name of the user object in my html template. I've tried these tags
>>> without success any advise?
>>>
>>> This is the tags in my HTML template:
>>>
>>> {{ customuser.first_name }} - does not work
>>>
>>> {{ object.first_name }} - does not work
>>>
>>>
>>> *This is my view:*
>>>
>>> def ContactIndex(request, CustomUser_id):
>>> customuser = CustomUser.objects.get(pk=CustomUser_id)
>>> if request.method == "POST":
>>> ContactFormset = ContactInlineFormSet(request.POST, 
>>> request.FILES, instance=customuser)
>>> AddressFormset = AddressInlineFormSet(request.POST, 
>>> request.FILES, instance=customuser)
>>> if ContactFormset.is_valid() or AddressFormset.is_valid():
>>> AddressFormset.save()
>>> ContactFormset.save()
>>> # Do something. Should generally end with a redirect. For 
>>> example:
>>> return redirect ('ContactIndex', 
>>> CustomUser_id=customuser.id)
>>> else:
>>> ContactFormset = ContactInlineFormSet(instance=customuser)
>>> AddressFormset = AddressInlineFormSet(instance=customuser)
>>> return render(request, 'members/member_contact_form.html', 
>>> {'ContactFormset':ContactFormset, 'Address
>>>
>>> Formset':AddressFormset })
>>>
>>> --
>>> 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/865ff205-9a1d-4f62-bbe4-d2d12da22374o%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/2ab18788-3a31-4c7f-bba7-890580540153o%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/CAK4qSCcSzENGO0ySEHawYL9Es7Yq%3D99UtPBHRijO2UGHNt2Pfw%40mail.gmail.com.


Live updates of Admin's list_display data

2020-06-30 Thread Olivier
Hello,

Django Admin implements list_display settings with which you can create 
columns of database-extracted or computed values.

Is there to update these values without requiring Django Admin users to 
reload or refresh current page ?

Best regards

-- 
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/447f4c0e-b751-4730-bc51-5c87c5ae64e3o%40googlegroups.com.


Re: Can anybody answe how i can access infromation from the parent modell i my HTML template in Django?

2020-06-30 Thread The Sha
Ok i understand, how du i put the CustomUser in the render method so i cant 
get {{ CustomUser.first_name }} in this case?

Den tisdag 30 juni 2020 kl. 11:00:53 UTC+2 skrev Andréas Kühne:
>
> Hi,
>
> You need to pass the variables that you want to use in the template to the 
> template itself. You do this here:
>
> return render(request, 'members/member_contact_form.html', 
> {'ContactFormset':ContactFormset, 'AddressFormset':AddressFormset })
>
> The dictionary you add to the render method there contains all the objects 
> that you can get in the template itself. So if you want to add something 
> called object you need to add that to the dictionary.
>
> Med vänliga hälsningar,
>
> Andréas
>
> Den tis 30 juni 2020 kl 10:38 skrev The Sha  >:
>
>>
>>
>>
>>
>> 
>>
>> I have a two formsets rendered in a view called ContactIndex, the parent 
>> model for this view is the CustomUser model. I want to present the 
>> first_name of the user object in my html template. I've tried these tags 
>> without success any advise?
>>
>> This is the tags in my HTML template:
>>
>> {{ customuser.first_name }} - does not work
>>
>> {{ object.first_name }} - does not work
>>
>>
>> *This is my view:*
>>
>> def ContactIndex(request, CustomUser_id):
>> customuser = CustomUser.objects.get(pk=CustomUser_id)
>> if request.method == "POST":
>> ContactFormset = ContactInlineFormSet(request.POST, 
>> request.FILES, instance=customuser)
>> AddressFormset = AddressInlineFormSet(request.POST, 
>> request.FILES, instance=customuser)
>> if ContactFormset.is_valid() or AddressFormset.is_valid():
>> AddressFormset.save()
>> ContactFormset.save()
>> # Do something. Should generally end with a redirect. For 
>> example:
>> return redirect ('ContactIndex', CustomUser_id=customuser.id)
>> else:
>> ContactFormset = ContactInlineFormSet(instance=customuser)
>> AddressFormset = AddressInlineFormSet(instance=customuser)
>> return render(request, 'members/member_contact_form.html', 
>> {'ContactFormset':ContactFormset, 'Address
>>
>> Formset':AddressFormset })
>>
>> -- 
>> 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/865ff205-9a1d-4f62-bbe4-d2d12da22374o%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/2ab18788-3a31-4c7f-bba7-890580540153o%40googlegroups.com.


Re: Can anybody answe how i can access infromation from the parent modell i my HTML template in Django?

2020-06-30 Thread Andréas Kühne
Hi,

You need to pass the variables that you want to use in the template to the
template itself. You do this here:

return render(request, 'members/member_contact_form.html',
{'ContactFormset':ContactFormset, 'AddressFormset':AddressFormset })

The dictionary you add to the render method there contains all the objects
that you can get in the template itself. So if you want to add something
called object you need to add that to the dictionary.

Med vänliga hälsningar,

Andréas

Den tis 30 juni 2020 kl 10:38 skrev The Sha :

>
>
>
>
> 
>
> I have a two formsets rendered in a view called ContactIndex, the parent
> model for this view is the CustomUser model. I want to present the
> first_name of the user object in my html template. I've tried these tags
> without success any advise?
>
> This is the tags in my HTML template:
>
> {{ customuser.first_name }} - does not work
>
> {{ object.first_name }} - does not work
>
>
> *This is my view:*
>
> def ContactIndex(request, CustomUser_id):
> customuser = CustomUser.objects.get(pk=CustomUser_id)
> if request.method == "POST":
> ContactFormset = ContactInlineFormSet(request.POST, 
> request.FILES, instance=customuser)
> AddressFormset = AddressInlineFormSet(request.POST, 
> request.FILES, instance=customuser)
> if ContactFormset.is_valid() or AddressFormset.is_valid():
> AddressFormset.save()
> ContactFormset.save()
> # Do something. Should generally end with a redirect. For 
> example:
> return redirect ('ContactIndex', CustomUser_id=customuser.id)
> else:
> ContactFormset = ContactInlineFormSet(instance=customuser)
> AddressFormset = AddressInlineFormSet(instance=customuser)
> return render(request, 'members/member_contact_form.html', 
> {'ContactFormset':ContactFormset, 'Address
>
> Formset':AddressFormset })
>
> --
> 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/865ff205-9a1d-4f62-bbe4-d2d12da22374o%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/CAK4qSCdofy7c--ZH9Gt%2BG_sDUGcTBdDZ%2BCbKqmtTOZ8e-eOw2Q%40mail.gmail.com.


Re: Is there a package that enables one Django project to authenticate via a second Django project?

2020-06-30 Thread Andréas Kühne
Hi,

I saw your other post - great work with the oauth server and client apps. I
think the solution looks very promising.

I like the way you can configure everything. A few questions though:
1. Would it be possible to use another SSO package to login to the Djangito
server? We currently use social_django to do the login which the client
fixes.
2. Why not base it on other already existing products (like social_django)
and not need to add your own code for everything?
3. Because it's based on oauth it should be possible to authenticate with
an angular app for example - or?

Regards,

Andréas


Den mån 29 juni 2020 kl 11:29 skrev David Rashty :

> Got it.  Thanks for following up.
>
> I ended up rolling out my own solution based on django-oauth-toolkit:
> https://github.com/pandichef/djangito
>
>
> I'd love to get some feedback if you get a chance.  Thanks!
>
>
>
> On Mon, Jun 29, 2020 at 5:10 AM Andréas Kühne 
> wrote:
>
>> The remote user functionality is still valid - however it is rarely used.
>> I heard about it myself from one of the Django fellows - who are
>> responsible for handling ticket triage on the django project itself. He
>> said exactly what you are saying - that there isn't that much information
>> about it and that the usage is not wide spread. However for your use case I
>> would look into it?
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den tors 25 juni 2020 kl 22:52 skrev Dave R :
>>
>>> Is REMOTE_USER a technology that's still used?  Aside from the one page
>>> of documentation, I don't see a lot of other references to it on Stack
>>> Overflow, etc.
>>>
>>> In my implementation, the client authenticates to the server, pulls the
>>> latest-and-greatest user data, then saves it on the client database.
>>>
>>> Philosophically, I guess it's a personal preference.  But, as a startup
>>> person, I tend to build a lot of throwaway apps that I don't want
>>> cluttering up the core tried-and-tested apps.
>>>
>>> On Thursday, June 25, 2020 at 3:55:40 PM UTC-4 andrea...@hypercode.se
>>> wrote:
>>>
 First of all - why separate the django apps into various projects? That
 seems a bit strange because you are depending on one user account and one
 database? There isn't really any benefit of doing it like that - why not
 use a single django project?

 But on the other hand - if you want to continue doing it like that -
 what I would do is setup a "user" project - that only handles the users.
 Then you can use the remote user functionality of django in the other
 projects. That way you have the user object centralized and all of the
 projects can use the user interface from the remote user.

 https://docs.djangoproject.com/en/3.0/howto/auth-remote-user/

 The reason I wouldn't use open id connect is because you still need a
 local user object for each project in that case.

 Regards,

 Andréas


 Den tors 25 juni 2020 kl 21:26 skrev Dave R :

> I keep running into this problem and started working on a custom
> solution... but before I spend hours on this, I want to confirm that such 
> a
> package/solution doesn't already exist.
>
> I was working on a large project last year that involved a single set
> of users and many small applications.  I made each application a Django 
> app
> and had them all tied together in one database.  There was only one
> database dependency between the applications: the User table.
>
> This became almost impossible to maintain for  multiple reasons:
> * I had two apps that required different values in settings.py
> * The test suite took forever to run
> * One of the apps was developed originally using Postgres and I had to
> spend hours hacking through code getting it to work with MySQL
> * I had to share my entire code base to employ freelancers
> * I had to deprecate one of the apps and this became a project in
> itself (i.e., remove references in settings.py, dropping database tables,
> etc.)
>
> Next time I'm in this situation, I'd like to develop each application
> as a separate Django project and have them authenticate (via OpenID
> Connect) to a project dedicated to this (e.g., accounts.mysite.com).
>
> Has anyone seen an out-of-the-box solution for this?  The question is
> very open-ended.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0050a73c-fc46-449b-b087-a9f99508fadeo%40googlegroups.com
> 
> .
>
 --
>>> You received this 

Re: How to add domain from GoDaddy to Heroku

2020-06-30 Thread Akinfolarin Stephen
at what point where you stuck can you share may be i can be of help

On Tue, Jun 30, 2020 at 12:16 PM John McClain 
wrote:

> I was able to do so Micah
>
> it took almost a day to propagate though. How long has it been since you
> did the redirects
>
>
> On Mon, 29 Jun 2020 at 22:39, Micah Beckman 
> wrote:
>
>> I'm having the exact same issue. The helpline folks weren't able to sort
>> it out either.
>>
>> On Monday, June 22, 2020 at 4:44:51 PM UTC-4, sunday honesty wrote:
>>>
>>> Has anyone here added a custom domain from GoDaddy to Heroku?
>>>
>>> I have not been able to configure my DNS correctly after following tons
>>> of articles online... GoDaddy don't seem to have good customer care for my
>>> country and no live support available?
>>>
>>> The issue is, I have bought the domain and added it to Heroku and
>>> generated the target for DNS.
>>> On Heroku, I entered manage DNS to add the target url generated from
>>> Heroku and got a bad request (400) error if I set CNAME to www and value to
>>> the target from Heroku. I have followed the exact step I got from online
>>> and non is working for me.
>>> Anyone who can help me will be 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/7b7f8c5c-8da5-4c77-a271-3d51190b5d7ao%40googlegroups.com
>> 
>> .
>>
>
>
> --
> John McClain
>
> Cell: 085-1977-823
> Skype: jmcclain0129
> Email: jmcclain0...@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/CAN-hv_rnzKkmaixiQb%3D_SZxvGH4FFOy07hgs6-ijTgbfb%3DTK%2Bg%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/CAFujGLxbV5kL47xJsZ2CBuTRiSF%3DEB33hy4MPj-4JUqvmyz9ww%40mail.gmail.com.