Re: Protect Django media files per user basis and also under NGINX

2021-04-20 Thread Stats Student
You should not map the URLs directly to your qrcode paths in Nginx, and instead use Django URLs to control the access. You can use Nginx’s X-Accel header functionality to redirect the user to the actual file without showing the real link. Google for “Using NGINX’s X-Accel with Remote URLs” on how

Pg Full Text search in the ORM

2021-02-24 Thread Stats Student
Hi, does anyone know how to translate the following query to the ORM? select * from company where to_tsvector(name) @@ to_tsquery('gold:*') So far I have the following, but cannot seem to integrate the [:*] piece. Company.objects.annotate(search = SearchVector('name')).filter(search =

Re: capture client side location in Django

2020-09-24 Thread Stats Student
You can read the client's IP address with - request.META['REMOTE_ADDR'] -- ( not sure how it handles proxies, etc ) then use GeoIP2 to get the location info - https://docs.djangoproject.com/en/3.1/ref/contrib/gis/geoip2/ On Thu, Sep 24, 2020 at 6:42 PM Salima Begum wrote: > > Hi all, > >

Primary keys using sequences

2020-07-01 Thread Stats Student
Hi, I am using a Postgres database and have been populating the primary key from a sequence. Is there any way to define this behavior through Django's ORM? Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Module recommendation for social authentication

2020-06-22 Thread Stats Student
Hi, I am trying to decide between python-social-auth and django-allauth - any insight would be appreciated. Or if there is a better alternative module for integrating Django with Google, Facebook and LinkedIn authentication, I'd love to know. Thanks in advance. -- You received this message