Re: Lazy evaluation of django custom context processor in base.html

2019-04-17 Thread BIJAL MANIAR
Hi, Can anyone help on this. I want to pass value of "USERROLE" across all the django templates through "base.html". How to efficiently call custom context processor as it queries database for every page load. Thanks, Bijal On Monday, April 15, 2019 at 6:35:15 PM UTC+5:30, BIJAL MANIAR wrote

Re: File not getting uploaded

2019-04-17 Thread Vijay Khemlani
In your HTML, the form tag should have an enctype ... On Wed, Apr 17, 2019 at 2:36 AM Aakash Baranwal wrote: > Sorry, the image file wasnt uploaded. > > > > On Wed, Apr 17, 2019 at 12:04 PM Aakash Baranwal > wrote: > >> Hi Everybody, >> >> I am trying to upload a file, but it says "No file c

Re: compute model field by related field

2019-04-17 Thread Derek
1. Add a "winner" field to your Match 2. Implement a post_save signal for the Match model that updates the "won" or "lost" fields for each Club in the match (simple if/then logic based on winner). PS I think the default values for "won" and "lost" for a Club should be "0" and not "1". On Tues

Need assistance! I want to create a list box that displays records that can be selected (single or multiple) from a PGSQL table.

2019-04-17 Thread Darryl Dillman
I have tried various methods including MVC, but cannot seem to get it right. I thought the MVC method would work, but it seems the database connection part was missing from the example I followed and only shows the submit button. I am able to create drop down lists from a static choices list in

jango.core.exceptions. error

2019-04-17 Thread fofazu . fz
i am transferring my Django project to another laptop but it appears this error whan i try run server ~~django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings

Re: jango.core.exceptions. error

2019-04-17 Thread Vivek Jha
Can you send me the screenshots On Wed, 17 Apr 2019, 19:20 , wrote: > i am transferring my Django project to another laptop but it appears this > error whan i try run server ~~django.core.exceptions.ImproperlyConfigured: > Requested setting DEBUG, but settings are not configured. You must either

Re: File not getting uploaded

2019-04-17 Thread Ram sundar
Hi Vijay, You are right, but he has mentioned that it gets uploaded when logged in as admin. Will it be a different template for the same view? Just wondering... @Aakaash: can you please check in both cases and confirm please Regards, Ramsundar On Wed 17 Apr, 2019, 6:18 PM Vijay Khemlani, wro

Re: Need assistance! I want to create a list box that displays records that can be selected (single or multiple) from a PGSQL table.

2019-04-17 Thread Joel Mathew
Great to know -- 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@google

Re: File not getting uploaded

2019-04-17 Thread Vijay Khemlani
When he said "uploading it from there" I was not sure whether "there" meant Django's admin page or the same view that's failing now As far as I know the form has to have a multipart enctype to upload files On Wed, Apr 17, 2019 at 9:53 AM Ram sundar wrote: > Hi Vijay, > > You are right, but he h

Re: Need assistance! I want to create a list box that displays records that can be selected (single or multiple) from a PGSQL table.

2019-04-17 Thread Darryl Dillman
??? On Wednesday, April 17, 2019 at 10:02:53 AM UTC-4, Joel Mathew wrote: > > Great to know > -- 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+unsub

RE: Unhashable TypeError when deleted from model, Django 2.2

2019-04-17 Thread Matthew Pava
Hi Sithu, I would still need to a way determine when a record expires. A Boolean wouldn’t help in that regard. But I think this error has something to do with Django’s delete method. The filtering aspect works just fine. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com]

Re: File not getting uploaded

2019-04-17 Thread Aakash Baranwal
Hi, Actually, his solution was correct because when I provided the encryption it worked, however I am not sure about the reason why it did worked at all. Thanks a lot. With Kind Regards Aakash Baranwal On 17 Apr 2019 7:23 p.m., "Ram sundar" wrote: > Hi Vijay, > > You are right, but he has men

Re: File not getting uploaded

2019-04-17 Thread Aakash Baranwal
Thanks a lot. Your solution worked perfectly for me. With Kind Regards Aakash Baranwal On 17 Apr 2019 7:36 p.m., "Vijay Khemlani" wrote: When he said "uploading it from there" I was not sure whether "there" meant Django's admin page or the same view that's failing now As far as I know the form

RE: Unhashable TypeError when deleted from model, Django 2.2

2019-04-17 Thread Matthew Pava
Okay, the model I’m using specifies an __eq__ function without a corresponding __hash__ function. I’ve opened a pull request with the owner of that project. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Matthew Pava Sent: Wednesday, April 17, 2019 11:18

Re: Unhashable TypeError when deleted from model, Django 2.2

2019-04-17 Thread Sithembewena L. Dube
Interesting. Good catch. Kind regards, Sithu *Sent with Shift * On Wed, Apr 17, 2019 at 9:48 PM Matthew Pava wrote: > Okay, the model I

Re: fesherstructural error

2019-04-17 Thread Joseph Jones
Hello fellow Django community members, thank you for the advice I’m applying it to the best of my ability I still believe I am not being as discriptive as far as the problem I am having but I’m gleaning from what I’ve read on the forum that with Django one often works out a solution while discri

Settings file for multiple environments?

2019-04-17 Thread ANi
Hi, I divided my settings into different files, but I think it's not working on Heroku, here are my code: # This is abcd/setting/hk.py from .base import * import dj_database_url DATABASES = { 'default': dj_database_url.config() } ALLOWED_HOSTS.append('abcdmyapp.herokuapps.com') WSGI_APPLICA

Re: Need assistance! I want to create a list box that displays records that can be selected (single or multiple) from a PGSQL table.

2019-04-17 Thread ANi
Can you provide the code you've done so far? Darryl Dillman於 2019年4月17日星期三 UTC+8下午9時51分16秒寫道: > > I have tried various methods including MVC, but cannot seem to get it > right. I thought the MVC method would work, but it seems the database > connection part was missing from the example I followe

Re: Settings file for multiple environments?

2019-04-17 Thread Ayser shuhaib
Are you sure about the directory? I mean is it “ abcd.setting.hk” or “abcd.settings.hk” ? On Thu, 18 Apr 2019 at 06:00, ANi wrote: > > Hi, > I divided my settings into different files, but I think it's not working > on Heroku, here are my code: > > # This is abcd/setting/hk.py > from .base impor

Re: Settings file for multiple environments?

2019-04-17 Thread ANi
yes, it is "abcd.*settings*.hk". And I think it will show error if it's wrong (? Ayser shuhaib於 2019年4月18日星期四 UTC+8下午1時10分04秒寫道: > > Are you sure about the directory? > I mean is it “ abcd.setting.hk” or “abcd.settings.hk” ? > > On Thu, 18 Apr 2019 at 06:00, ANi > wrote: > >> >> Hi, >> I divided