Re: How to get data from django model to the excel sheet.

2020-07-06 Thread sum abiut
You can try this export data to excel file

Sum,

On Mon, Jul 6, 2020 at 7:00 PM Ashutosh Mishra 
wrote:

> I want to get the data from the django model contans(name,age,photo) on a
> excel sheet.
> How can i do that.
>
> --
> 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/b9ad3b60-2c0a-43dc-bdc6-6a67f8a88826n%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/CAPCf-y6tSDOTUDfWWQV652E6yY7M2FRgJuKA4vnc4nPme_j1Bw%40mail.gmail.com.


Re: How to get data from django model to the excel sheet.

2020-07-06 Thread mohamed khaled
You can serialized your data and then use any tools to export the data as
csv for example.

On Mon, Jul 6, 2020, 9:00 AM Ashutosh Mishra 
wrote:

> I want to get the data from the django model contans(name,age,photo) on a
> excel sheet.
> How can i do that.
>
> --
> 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/b9ad3b60-2c0a-43dc-bdc6-6a67f8a88826n%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/CALvPq4Kyx8LOa7thDQprZPtBUXYYgY%3DjX94-mp65rAL5PbXKiA%40mail.gmail.com.


Re: How to get data from django model to the excel sheet.

2020-07-06 Thread Ashutosh Mishra
What if I have an image field too,how to do that

-- 
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/9bf3cc78-00bd-4a8f-a6b7-90344f0bded7o%40googlegroups.com.


Re: How to get data from django model to the excel sheet.

2020-07-06 Thread Damanjeet Singh
Please see handsontable.com.

I have been using it for my project.

On Mon, Jul 6, 2020 at 9:06 AM Ashutosh Mishra 
wrote:

> What if I have an image field too,how to do that
>
> --
> 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/9bf3cc78-00bd-4a8f-a6b7-90344f0bded7o%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/CAGLHGi5_9zX%2BLkywRH9GB_hKLJTBRRjmGBw1aCrYSW5WGOj-6Q%40mail.gmail.com.


Re: How to get data from django model to the excel sheet.

2020-07-06 Thread Ashutosh Mishra
But It is for js,react,angular, how can I place that in django project
On Jul 6, 2020 1:54 PM, "Damanjeet Singh"  wrote:

> Please see handsontable.com.
>
> I have been using it for my project.
>
> On Mon, Jul 6, 2020 at 9:06 AM Ashutosh Mishra <
> ashutoshmishra...@gmail.com> wrote:
>
>> What if I have an image field too,how to do that
>>
>> --
>> 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/9bf3cc78-00bd-4a8f-a6b7-90344f0bded7o%
>> 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/CAGLHGi5_9zX%2BLkywRH9GB_hKLJTBRRjmGBw1aCrYSW5WGOj-6Q%
> 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/CAGDmY671qKxoEUL%3DjEWQ7Xso4Opn74W3jh3dtD2Zy9jgvEpjtw%40mail.gmail.com.


RE: How to get data from django model to the excel sheet.

2020-07-06 Thread Vishesh Mangla
@Ashutosh Mishra I think reading your sql table with pandas and using to_excel/to_csv would be great in this case. If you are worried about the images. First of all I don’t know how you are storing your images. One method to store an image is to convert it to a very long base64 string and store it in the database. Then whenever you want to show it use can use that base64 string. Web browsers can understand base64 strings. But using base64 allows anyone to just copy your image so be careful. You can otherwise always decode back from base64 to normal image always. Sent from Mail for Windows 10 From: sum abiutSent: 06 July 2020 13:29To: django-users@googlegroups.comSubject: Re: How to get data from django model to the excel sheet. You can try this export data to excel fileSum, On Mon, Jul 6, 2020 at 7:00 PM Ashutosh Mishra  wrote:I want to get the data from the django model contans(name,age,photo) on a excel sheet.How can i do that.-- 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/b9ad3b60-2c0a-43dc-bdc6-6a67f8a88826n%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/CAPCf-y6tSDOTUDfWWQV652E6yY7M2FRgJuKA4vnc4nPme_j1Bw%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/064866A5-4C93-444A-B415-47D01CDFAF54%40hxcore.ol.


Re: How to get data from django model to the excel sheet.

2020-07-06 Thread Luciano Martins
To work with excell within Django projects we use the *openxl  *library, 
but you can't use it directly, you need to build scripts that bring you 
what you want.

Em segunda-feira, 6 de julho de 2020 03:59:29 UTC-3, Ashutosh Mishra 
escreveu:
>
> I want to get the data from the django model contans(name,age,photo) on a 
> excel sheet.
> How can i do that.
>

-- 
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/d23bd1a1-982b-4d31-8b3b-c97a3c35341do%40googlegroups.com.


RE: How to get data from django model to the excel sheet.

2020-07-06 Thread Vishesh Mangla
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_sql.html Sent from Mail for Windows 10 From: Ashutosh MishraSent: 06 July 2020 13:56To: django-users@googlegroups.comSubject: Re: How to get data from django model to the excel sheet. But It is for js,react,angular, how can I place that in django projectOn Jul 6, 2020 1:54 PM, "Damanjeet Singh"  wrote:Please see handsontable.com. I have been using it for my project. On Mon, Jul 6, 2020 at 9:06 AM Ashutosh Mishra  wrote:What if I have an image field too,how to do that-- 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/9bf3cc78-00bd-4a8f-a6b7-90344f0bded7o%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/CAGLHGi5_9zX%2BLkywRH9GB_hKLJTBRRjmGBw1aCrYSW5WGOj-6Q%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/CAGDmY671qKxoEUL%3DjEWQ7Xso4Opn74W3jh3dtD2Zy9jgvEpjtw%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/1B445B42-39E1-477E-8CAB-7786C3BB5EB3%40hxcore.ol.


POSTGRES CONNTECTION TIMEOUT WHEN USING AN API

2020-07-06 Thread Sunday Iyanu Ajayi
I have a database sql function that I am running fine when on the database
but once i link the output via an api I created  and test via postman, I
get Nginx 502 error and on my postgresql log I get : Çonnection Timeout
error.

The sql db function link to a foreign table and pulls some data (between
500-2000 rows)

Please how can I fix this?


*AJAYI Sunday *
(+234) 806 771 5394
*sunnexaj...@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/CAKYSAw1K%3DJ3oLBJ0%3DsuObqPJCVMbgAnymPxm-h%3D_9pbFBive6A%40mail.gmail.com.


Re: REUTILISER UN CITE DJANGO

2020-07-06 Thread Karan Sahu
Hi

do you hire contract based python/django freelancer?


I can help you in this and related tasks


Best,

Karan Sahu


On Sunday, July 5, 2020, C L A S S E 1  wrote:

> *BONJOUR A TOUTES   A TOUS*
>
> *si je décharge  un site(une application django)   est ce que je peut l
> utiliser sur mon environnement de développement  qui lui contient déjà
> porte un site  qui existe déjà. ou je dois créer  un environnement appart.
> si possible comment   merci*
>
> --
> 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/a1e9d327-0220-4fce-85e7-dcbb6380c281o%
> 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/CAOWRdhD8ESCntBw2owisYiYfSwg4dfsCbEkiuz6%2BHvtzy%3DQPjA%40mail.gmail.com.


Re: Trouble getting kwargs into filter

2020-07-06 Thread Karan Sahu
Hi,

Do you hire contract based python/django freelancer?


I can help you in this and related tasks


Best,

Karan Sahu

On Monday, July 6, 2020, Clive Bruton  wrote:

> I am struggling with getting kwarg values into a queryset filter:
>
> class UsersItemsView(ListView):
> template_name = 'testapp/user_item_list.html'
>
> def get_queryset(self, **kwargs):
> print('kwargs-userlist')
> print(kwargs)
> #return Item.objects.filter(user__username='clive')
> #return Item.objects.filter(user__id=2)
> return Item.objects.filter(user__id=kwargs['userlist'])
>
> def dispatch(self, *args, **kwargs):
> print('kwargs-userlist')
> print(kwargs['userlist'])
> return super(UsersItemsView, self).dispatch(*args, **kwargs)
>
>
> On dispatch, I can see the value for "kwargs['userlist']" printed in the
> terminal.
>
> But, the queryset returns an error:
>
> Exception Type: KeyError
> Exception Value: 'userlist'
>
> I understand this to mean that the key 'userlist' is not in kwargs, and
> this is confirmed if I "print(kwargs)" inside the get_queryset
>
> If I use the hard-coded filters, commented-out above
> ("user__username='clive'", "user__id=2"), I get the result (from the
> template) that I expect.
>
> So, how do I get the "kwargs['userlist']" passed to the queryset?
>
>
> Thanks
>
>
> -- Clive
>
> --
> 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/ms
> gid/django-users/5BD32BE1-331F-4AE5-BB8A-2E769D728972%40indx.co.uk.
>

-- 
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/CAOWRdhDTT_7XxfOzUiQWv5DuAw8GhXkx-qZUWgd2Y%3DBTTEjSyw%40mail.gmail.com.


Re: POSTGRES CONNTECTION TIMEOUT WHEN USING AN API

2020-07-06 Thread Sunday Iyanu Ajayi
I get this error from my postgresql log also : could not send data to
client: Broken pipe
*AJAYI Sunday *
(+234) 806 771 5394
*sunnexaj...@gmail.com *



On Mon, Jul 6, 2020 at 2:06 PM Sunday Iyanu Ajayi 
wrote:

> I have a database sql function that I am running fine when on the database
> but once i link the output via an api I created  and test via postman, I
> get Nginx 502 error and on my postgresql log I get : Çonnection Timeout
> error.
>
> The sql db function link to a foreign table and pulls some data (between
> 500-2000 rows)
>
> Please how can I fix this?
>
>
> *AJAYI Sunday *
> (+234) 806 771 5394
> *sunnexaj...@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/CAKYSAw0erbKyKfVAAHkyS55LtZX_hKy5-9xLo%2BkKPmmq0H-kSw%40mail.gmail.com.


Re: Trouble getting kwargs into filter

2020-07-06 Thread Clive Bruton

Thank you.


On 6 Jul 2020, at 05:24, Stephen J. Butler wrote:


 def get_queryset(self):
 qs = super().get_queryset()
 return qs.filter(user__id=self.kwargs['userlist'])


--
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/06B8D1F3-83B7-4EB0-A44A-0916DF93321A%40indx.co.uk.


Adding an 'or' to filter

2020-07-06 Thread Clive Bruton

I am working into someone else's solution, with this code in forms.py:

***

class SearchForm(forms.Form):
area = forms.ModelChoiceField(label=_('Area'),  
queryset=Area.objects.all(), required=False)
group = forms.ModelChoiceField(label=_('Group'),  
queryset=Group.objects.all(), required=False)

q = forms.CharField(required=False, label=_('Query'),)

def filter_by(self):
# TODO search using more than one field
# TODO split query string and make seaprate search by words
filters = {}
if self.cleaned_data['group']:
filters['group'] = self.cleaned_data['group']

if self.cleaned_data['area']:
filters['area'] = self.cleaned_data['area']

filters['description__icontains'] = self.cleaned_data['q']

return filters

***

I understand that 'filters' is a dictionary.

However, what I would like to do is have the final input ('q') be an  
'or' search on two fields, ie:


filter(Q(description__icontains = self.cleaned_data['q']) | Q 
(title__icontains = self.cleaned_data['q'])]


Not sure how to implement that in this dictionary style.

Thanks


-- Clive

--
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/2525F534-DD0C-48E6-ABFC-D3D1FA29E09C%40indx.co.uk.


Static not working on unix while working on windows

2020-07-06 Thread ashish goyal
Hi All,

I have created a django app on windows and have used bootstrap navbar n other 
functions which are working good on windows.

Same files I have imported on unix server then i am able to get all details but 
getting issue with css and js files saying below error

Refused to apply style from  because its MIME type ('text/html') is not a 
supported stylesheet MIME type, and strict MIME checking is enabled angular

I am using below script in windows which is working in windows but not on unix

{ % load static %}
https://groups.google.com/d/msgid/django-users/D45C33B1-949B-4BBE-8338-8982F2A246BF%40gmail.com.


Django ContentTypes required?

2020-07-06 Thread JJ Zolper
Hello,

I am not using any of the ContentType relations, etc right now in my Django 
2.12 Python 3.6 application, am I able to run the application without 
having django.contrib.contenttypes in the INSTALLED_APPS? Is there a piece 
I am not understanding that Django uses it for in the background?

I thought I had it working with it removed but I am getting:

Model class django.contrib.contenttypes.models.ContentType doesn't declare 
an explicit app_label and isn't in an application in INSTALLED_APPS.

I have nothing in the INSTALLED_APPS except my apps and:

'django.contrib.staticfiles',
'rest_framework',

Was trying an attempt where I avoided migrating contenttypes into a legacy 
database.

Best,

JJ

-- 
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/5f21d61e-b2d1-41e9-8e07-b7a1821d68f9o%40googlegroups.com.


RE: Static not working on unix while working on windows

2020-07-06 Thread Vishesh Mangla
Href = "" static appname/something.css %}” Sent from Mail for Windows 10 From: ashish goyalSent: 06 July 2020 23:50To: django-users@googlegroups.comSubject: Static not working on unix while working on windows Hi All, I have created a django app on windows and have used bootstrap navbar n other functions which are working good on windows. Same files I have imported on unix server then i am able to get all details but getting issue with css and js files saying below error Refused to apply style from  because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled angular I am using below script in windows which is working in windows but not on unix { % load static %} Any suggestions, static and static url js defined i. Settings.py already. Since all working fine on windows dont know same code is not working for css and js while data is fetching correctlyThanksAshish-- 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/D45C33B1-949B-4BBE-8338-8982F2A246BF%40gmail.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/2A992212-ECB5-4FBA-BE2A-6775FE777304%40hxcore.ol.


Re: Django ContentTypes required?

2020-07-06 Thread Dan Madere
I agree that it should work. Django uses ContentType in the admin and user 
authentication, but you mention that you have removed these from 
INSTALLED_APPS, so I don't get it. I'd try clearing .PYC files first. Then 
maybe a sanity check.. double check what settings file you're actually 
using, and if INSTALLED_APPS contains what you expect.

Dan

On Monday, July 6, 2020 at 2:33:19 PM UTC-4 jzt...@gmail.com wrote:

> Hello,
>
> I am not using any of the ContentType relations, etc right now in my 
> Django 2.12 Python 3.6 application, am I able to run the application 
> without having django.contrib.contenttypes in the INSTALLED_APPS? Is there 
> a piece I am not understanding that Django uses it for in the background?
>
> I thought I had it working with it removed but I am getting:
>
> Model class django.contrib.contenttypes.models.ContentType doesn't declare 
> an explicit app_label and isn't in an application in INSTALLED_APPS.
>
> I have nothing in the INSTALLED_APPS except my apps and:
>
> 'django.contrib.staticfiles',
> 'rest_framework',
>
> Was trying an attempt where I avoided migrating contenttypes into a legacy 
> database.
>
> Best,
>
> JJ
>

-- 
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/cbce5c34-652a-42ac-84b5-0c881abce893n%40googlegroups.com.


Re: How to get names of columns from QuerySet without executing it

2020-07-06 Thread Eugene Kulak
Michael, this will not work for cases with `values` and `annotations`

On Sunday, July 5, 2020 at 2:23:03 PM UTC-4, michaelfladischer wrote:
>
> What about introspecting the model associated with the QuerySet: 
>
> qs = SomeModel.objects.all() 
> columns = [f.column for f in qs.model._meta.fields] 
>
> Regards, Michael 
>
>
> Am 04.07.2020 um 22:11 schrieb Eugene Kulak: 
> > How to get names of columns from QuerySet without executing it? 
> > If it is not possible what would be the most easier way to execute a 
> > lighter version of the query. 
> > The query itself is unknown, it could be anything. 
>

-- 
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/5d260888-c607-4121-81b2-a18215d38f8do%40googlegroups.com.


Re: POSTGRES CONNTECTION TIMEOUT WHEN USING AN API

2020-07-06 Thread Dan Madere
Sounds like nginx is timing out waiting for Django, due to the slow query. 
You can set proxy_connect_timeout and proxy_read_timeout in your nginx 
config to allow it to wait longer. Another approach would be to optimize 
the SQL query and add indexes, to have the query run faster and not cause 
the timeout.

Dan

On Monday, July 6, 2020 at 9:24:48 AM UTC-4 sunne...@gmail.com wrote:

> I get this error from my postgresql log also : could not send data to 
> client: Broken pipe
> *AJAYI Sunday *
> (+234) 806 771 5394 <+234%20806%20771%205394>
> *sunne...@gmail.com*
>
>
>
> On Mon, Jul 6, 2020 at 2:06 PM Sunday Iyanu Ajayi  
> wrote:
>
>> I have a database sql function that I am running fine when on the 
>> database but once i link the output via an api I created  and test via 
>> postman, I get Nginx 502 error and on my postgresql log I get : Çonnection 
>> Timeout error.
>>
>> The sql db function link to a foreign table and pulls some data (between 
>> 500-2000 rows)
>>
>> Please how can I fix this?
>>
>>
>> *AJAYI Sunday *
>> (+234) 806 771 5394 <+234%20806%20771%205394>
>> *sunne...@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/9a815404-3c51-4a1f-b85d-ba6886dfc9a0n%40googlegroups.com.


Re: POSTGRES CONNTECTION TIMEOUT WHEN USING AN API

2020-07-06 Thread Sunday Iyanu Ajayi
Yes. I later figured it out after a lot of research.

Thanks to this link:
https://www.datadoghq.com/blog/nginx-502-bad-gateway-errors-gunicorn/
*AJAYI Sunday *
(+234) 806 771 5394
*sunnexaj...@gmail.com *



On Tue, Jul 7, 2020 at 1:46 AM Dan Madere  wrote:

> Sounds like nginx is timing out waiting for Django, due to the slow query.
> You can set proxy_connect_timeout and proxy_read_timeout in your nginx
> config to allow it to wait longer. Another approach would be to optimize
> the SQL query and add indexes, to have the query run faster and not cause
> the timeout.
>
> Dan
>
> On Monday, July 6, 2020 at 9:24:48 AM UTC-4 sunne...@gmail.com wrote:
>
>> I get this error from my postgresql log also : could not send data to
>> client: Broken pipe
>> *AJAYI Sunday *
>> (+234) 806 771 5394 <+234%20806%20771%205394>
>> *sunne...@gmail.com*
>>
>>
>>
>> On Mon, Jul 6, 2020 at 2:06 PM Sunday Iyanu Ajayi 
>> wrote:
>>
>>> I have a database sql function that I am running fine when on the
>>> database but once i link the output via an api I created  and test via
>>> postman, I get Nginx 502 error and on my postgresql log I get : Çonnection
>>> Timeout error.
>>>
>>> The sql db function link to a foreign table and pulls some data (between
>>> 500-2000 rows)
>>>
>>> Please how can I fix this?
>>>
>>>
>>> *AJAYI Sunday *
>>> (+234) 806 771 5394 <+234%20806%20771%205394>
>>> *sunne...@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/9a815404-3c51-4a1f-b85d-ba6886dfc9a0n%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/CAKYSAw2w16jsuSPt%3D6UxV4GupAPq2HCFWBi%2BvsJYS_kH%3DwQ5WA%40mail.gmail.com.


Re: Static not working on unix while working on windows

2020-07-06 Thread ashish goyal
I am using same but still css is not available when i am clicking on css file 
link from inspect.

Is it because i have not configured nginx as i am just running app from 
runserver on unix machine.

Was working fine on windows. No change

Thanks
Ashish

> On 07-Jul-2020, at 00:11, Vishesh Mangla  wrote:
> 
> 
> Href = “{% static appname/something.css %}”
>  
> Sent from Mail for Windows 10
>  
> From: ashish goyal
> Sent: 06 July 2020 23:50
> To: django-users@googlegroups.com
> Subject: Static not working on unix while working on windows
>  
> Hi All,
>  
> I have created a django app on windows and have used bootstrap navbar n other 
> functions which are working good on windows.
>  
> Same files I have imported on unix server then i am able to get all details 
> but getting issue with css and js files saying below error
>  
> Refused to apply style from  because its MIME type ('text/html') is not 
> a supported stylesheet MIME type, and strict MIME checking is enabled angular
>  
> I am using below script in windows which is working in windows but not on unix
>  
> { % load static %}
>  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/D45C33B1-949B-4BBE-8338-8982F2A246BF%40gmail.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/2A992212-ECB5-4FBA-BE2A-6775FE777304%40hxcore.ol.

-- 
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/9A4AC834-CFD6-477E-BCCB-3829A13D7087%40gmail.com.


Static not working on unix while working on windows

2020-07-06 Thread Exactly musty
Try this https://groups.google.com/d/msgid/django-users/35233aa7-a4c2-4cbf-8d69-54ddc4844045o%40googlegroups.com.


Basic security check

2020-07-06 Thread Exactly musty
Bro you should probably host it before talking about security,I am talking 
about buying a domain name and hosting for yourself 

-- 
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/533a6604-6513-40af-bf92-f11c062a6e86o%40googlegroups.com.