how to secure api?

2019-08-24 Thread Mohammad Kokhaee
hi guys ??is that secure the signup user api have no permission and have no authenticate (allow any ) -- 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 djan

Re: how to secure api?

2019-08-24 Thread DANIEL URBANO DE LA RUA
If you are not a member how you do that if not, you have to allow anyone to become a member of your site On Sat, 24 Aug 2019, 09:52 Mohammad Kokhaee hi guys > > > ??is that secure the signup user api have no permission and have > no authenticate > > > (allow any ) > > > -- > You received this me

Re: how to secure api?

2019-08-24 Thread Mohammad Kokhaee
i'm saying if i set allow any permission is it secure? because robots can create user nonstop On Saturday, August 24, 2019 at 1:48:29 PM UTC+4:30, DANIEL URBANO DE LA RUA wrote: > > If you are not a member how you do that if not, you have to allow anyone > to become a member of your site > > O

Different databases depending on request

2019-08-24 Thread Fredrik Gustafsson
I've multiple django sites: customer1.example.com, customer2.example.com, customer3.example.com, etc. I want to use one django instance for all customers. How can I make django to dynamic change it's database depending on the hostname of the webrequest? -- Fredrik Gustafsson CTO fredrik.gustafs..

Django Redirect Not Working

2019-08-24 Thread göktürk sığırtmaç
Hello, my UserCreate class is create user via CreateAPIView. I want to check. if user is auth, auth user directly to 'profile' URI. class UserCreate(generics.CreateAPIView): serializer_class = UserCreateSerializer permission_classes = (~IsAuthenticated,) queryset = User.objects.all(

Re: ResultSet with query on multiple models

2019-08-24 Thread Benoit Dupont
I think I have figured it out. I have to play with models.Prefetch() to restrict the results from the prefetch_related() Can someone confirm this is the right way to do it ? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscri

Re: Django Redirect Not Working

2019-08-24 Thread Aldian Fazrihady
If that API is accessed via AJAX, then your JS code needs translate status 302 and Location header to JS code that sets "location.href" Regards, Aldian Fazrihady http://aldianfazrihady.com On Sat, 24 Aug 2019, 17:49 göktürk sığırtmaç, wrote: > Hello, my UserCreate class is create user via Crea

Re: ResultSet with query on multiple models

2019-08-24 Thread Catalina Popescu
Hey, Benoit You could set up a filter on your admin.py file. Like writing: class Immunization(admin.ModelAdmin): list_filter = ('vaccine', 'recorded') On Friday, August 23, 2019 at 2:19:35 PM UTC+3, Benoit Dupont wrote: > > Hello, > > I've played a lot of time with Django and it's a great to

Re: 3D Object Interaction

2019-08-24 Thread Lim Kai Wey
To Thiago, No I certainly have not. Thank you for the recommendation, I’ll check it out. Regards, Kai Wey -- 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 djang

Unable to display two forms in a view - Django

2019-08-24 Thread chevalier
I have two related models (Sim and Payment - A Sim can have many Payment). On searching of Sim (by ID ) i want its detail to be populated in a form (*which i am able to*). But using the same form i want to save the details of Payment model as well and at the same time want to update the Sim

Unable to display two forms in a view

2019-08-24 Thread chevalier
I have two related models (Sim and Payment - A Sim can have many Payment). On searching of Sim (by ID ) i want its detail to be populated in a form (*which i am able to*). But using the same form i want to save the details of Payment model as well and want to update the Sim model as well.

Re: Unable to display two forms in a view

2019-08-24 Thread Gil Obradors
Of course, you don't have poppulated payment_form ? Only initializated, payment_form = AddPaymentForm() If I'm not helping you, please attach more code good luck! Missatge de chevalier del dia ds., 24 d’ag. 2019 a les 17:37: > I have two related models (Sim and Payment - A Sim can have many

User Register form not validating or returning errors.

2019-08-24 Thread Kean
Hi, New to Django. I've created a user registration form, the issue is it does not run validations or report errors with the data entered. It simply routes to the redirect url. Please can I ensure the user sees the correct error in a post case scenari for both a django form, and customsied djan

Re: Unable to display two forms in a view

2019-08-24 Thread chevalier
Even after adding the instance i am unable to populate my form. However, if i individually populate each form both of them populate. def updatePayment(request, id): > sim = get_object_or_404(Sim, pk=id) > payment = AddPaymentForm(request.POST or None, instance=Payment) > if request.m

Re: Unable to display two forms in a view

2019-08-24 Thread Gil Obradors
Models and forms ? And/Or the output of print(request.POST) ? Where you code take you? - "Data in fields is incorrect, please try again"? - Exceptions? - Or maybe to payment_form.is_valid() as false? Missatge de chevalier del dia ds., 24 d’ag. 2019 a les 18:49: > Even after a

Re: Regarding to getting error registration page

2019-08-24 Thread mohammad mehrani
hello can u get github link project and i star and fork for u On Tue, Aug 20, 2019 at 11:56 PM RONAK JAIN wrote: > Hello Django Users > > > I am trying to redirect my registration page but, I am getting *please > check my attached screenshot* and please let me know where I am doing > wrong... >

Re: form.is_valid() is always return false please help

2019-08-24 Thread mohammad mehrani
awesome!!! and i like it On Fri, Aug 23, 2019 at 12:27 AM Shubham Chauhan < shubham.chauhan...@gmail.com> wrote: > form.is_valid() is always return false please help > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from th

Re: form.is_valid() is always return false please help

2019-08-24 Thread vineeth sagar
What does form.errors show. Just see what print(form.errors) tells you. It should be pretty obvious. On Sun, 25 Aug 2019, 00:30 mohammad mehrani, wrote: > awesome!!! and i like it > > On Fri, Aug 23, 2019 at 12:27 AM Shubham Chauhan < > shubham.chauhan...@gmail.com> wrote: > >> form.is_valid() i

reload the page and the logged in user converted to the admin

2019-08-24 Thread ayoub ELMAJJODI
The problem that I have, when I logged with normal user in the request.user there is a current user, but if I reload the page, the currennt user converted to the admin ? Enter code here... def countries_rate(request): auth_user = request.user if request.user.is_authenticated: auth_user = request

Knowing when cache expires or DurationField is done

2019-08-24 Thread Yoo
1. Using celery to make a replacement cache when that specific expires, but not sure how to do it. 2. Along the same lines, I need to also know when a DurationField is at "zero." Not sure how a DurationField works though. Again, need celery to be able to execute something when a specific record

Re: Knowing when cache expires or DurationField is done

2019-08-24 Thread Yoo
Just to clarify the first point: celery is "updating" the cache with new info once the cache expires; hence the need for the cache to expire. I thought about using a DB table, but also thought about how wasteful it would be to keep a DurationField (which I still don't know how to use) to log wh

Re: reload the page and the logged in user converted to the admin

2019-08-24 Thread N'BE SORO
Hello, Use Django login function Le sam. 24 août 2019 à 19:12, ayoub ELMAJJODI a écrit : > The problem that I have, when I logged with normal user in the > request.user there is a current user, but if I reload the page, the > currennt user converted to the admin ? > Enter code here... > def co

B2 and Whole Home

2019-08-24 Thread John Presland
I'm in Spain but using BT Whole Home mesh WiFi. I've had to reinstall that - and an unexpected issue has arisen with my B2. Previously when I entered 192.168.1.nn, "nn" being the latest element given by Whole Home, I was taken immediately to the Brennan B2 IU. Now I'm taken to a Whole Home page

Re: reload the page and the logged in user converted to the admin

2019-08-24 Thread James Schneider
> request.user there is a current user, but if I reload the page, the > currennt user converted to the admin ? > Enter code here... > def countries_rate(request): > auth_user = request.user > if request.user.is_authenticated: > auth_user = request.user > if (user_rate.objects.filter(user_id=auth_us

Re: form.is_valid() is always return false please help

2019-08-24 Thread Abu Yusuf
Some of the input fields aren't valid. We need to show the forms.py and the template code. Then it will be more clear. On Sun, Aug 25, 2019 at 1:02 AM vineeth sagar wrote: > What does form.errors show. Just see what print(form.errors) tells you. It > should be pretty obvious. > > On Sun, 25 Aug

Re: Regarding to getting error registration page

2019-08-24 Thread Abu Yusuf
Just hit: localhost:8000/register On Sun, Aug 25, 2019 at 1:01 AM mohammad mehrani wrote: > hello > can u get github link project and i star and fork for u > > > On Tue, Aug 20, 2019 at 11:56 PM RONAK JAIN > wrote: > >> Hello Django Users >> >> >> I am trying to redirect my registration page bu

Re: User Register form not validating or returning errors.

2019-08-24 Thread Abu Yusuf
Wher is the form action? If you don't provide the form action then how can it recognize which views should be called? Set the action here: Like this. On Sat, Aug 24, 2019 at 10:34 PM Kean wrote: > Hi, > > New to Django. > I've created a user registration form, the issue is it does not run > va

Re: How can I host my application in web hosting?

2019-08-24 Thread Abu Yusuf
You are most welcome! On Thu, Aug 22, 2019 at 11:49 PM Wasim Rana wrote: > Thank you so much for your response. > *Wasim Rana* > > CEO and Director > *SiteFor99* > www.sitefor99.com > Cell: +880 173 406 4296 > Ring Road, Shyamoli, > Dhaka - 1207 > > > On Thu, Aug 22, 2019 at 5:55 PM Abu Yusuf >

Re: How can I host my application in web hosting?

2019-08-24 Thread Abu Yusuf
You people are working on django projects? Is that a startup? On Sun, Aug 25, 2019 at 11:25 AM Abu Yusuf wrote: > You are most welcome! > > On Thu, Aug 22, 2019 at 11:49 PM Wasim Rana wrote: > >> Thank you so much for your response. >> *Wasim Rana* >> >> CEO and Director >> *SiteFor99* >> www.s

Rest API

2019-08-24 Thread Soumen Khatua
Hi Folks, I already implemented serach query parameter in my Django Rest API app,But I anto to show something like exact query parameter should be appear first then all the should be on the sequence of character like: *?search=the* *the* *thea* *theabc* *thebac* *thebca* *thecab* *thecba* Thank