inchidi
exception handling? 🤔 try: # check data except django.ValidationError as e: raise rest_framework.ValidationError(e)
inchidi
share your code, am sure it would help
Someone
share your code, am sure it would help
It solved .. u want to see code ?
inchidi
Someone
yeah let me see it
Okies .. i logged off.. will send after 2 hours ..
inchidi
cool
Django Bot
>> Blogs - Making mistakes >> Links - How to upload multiple images in Django using Dropzone and saving path dyna - Django - File Uploading - How to Upload files With Django
Django Bot
>> Links - Tutorial: Django REST with React (Django 2.0)
Django Bot
>> Links - Tutorial: Django REST with React (Django 2.0) - Time Zones in Pytz & Django
Anonymous
Django Bot
>> Links - Creating a production ready API with Python and Django Rest Framework - par
Someone
cool
https://pastebin.com/QmYJ7Gt4
Someone
Sorry for delay in sending ..
F A H A D
Guys, Does any one knows what is the security level for django websites??
F A H A D
Is it very secure?
F A H A D
I’m a django newbie
F A H A D
☺️
mλdcodez
Is it very secure?
PInterest and Instagram like sites use django. So. I believe it's secure
Anonymous
☺️
Hablani Anazi ✋🏻
F A H A D
High security
Thank you 🙏
Val
Hey guys! I'm working on a project and I need your advice on how I can do two things. I've been racking my brains around all day.. I am building a web app where people can sign up and register their businesses. It's going to have a signUp, signIn, a dashboard, register business and many other stuff. But my challenge is I want to be able to filter businesses by locations and also by category. Please any advice on how to go able it. I'm using postgres + sequelize
Anonymous
you can group people by IP address which links to their location
Someone
you can group people by IP address which links to their location
IP address is not reliable if the user is using vpn ... even without vpn ip address will not map to exact location
Someone
http://django-filter.readthedocs.io/en/latest/index.html
Someone
If this is not what u r looking for, then plz elaborate ur needs/ spec...
Django Bot
>> Jobs - Django Developer
mλdcodez
»> Post.objects.all() [<Post: Share Test>, <Post: Technologies>, <Post: testing>, <Post: Who was Django Reinhardt? >, <Post: Another Post>, <Post: New Title R>] how do i get the id of these object...? Thanks :)
mλdcodez
»> Post.objects.filter(title='New').id() AttributeError: 'QuerySet' object has no attribute 'id' this is what happens when i ask for id
biswaz
Posts = posts.objects.all() For a in posts: print(a.id)
biswaz
Only individual objects have Ids.. object managers dont
mλdcodez
Thanks :)
Anonymous
Is there any website for tutorials on geodjango except the docs?
Someone
Hi, I have two models... Class A(models.Model): name = field() manager = FK(B) Class B(models.Model): name = field() id = FK(self) Now I want to get all objects in A which have a filter from self of model B with that self FK. For ex : Model B :- Instance 1 (FK=null) Instance 2 (Fk=Instance 1) Model A :- Instance 1 (Fk=model A instance 1) Instance 2 (FK= model A instance 2) I need to get object of Model A which got filter of Model B (only with model B instance 1 as FK) How can I do it?
Someone
A.objects.filter(manager=B.objects.filter(id=1))
Someone
A.objects.filter(manager=B.objects.filter(id=1))
I applied this query ... but am getting error ..
Someone
OperationalError: (1242, 'Subquery returns more than 1 row')
Someone
Got it solved 😕
Someone
A.objects.filter(manager__in=B.objects.filter(id=1))
Jonás
/0
Django Bot
>> Blogs - A Multiple Model Django Search Engine
Anonymous
any good open source multivendor marketplace built with Django
Anonymous
?
Django Bot
>> Jobs - Remote Django Developer for exciting projects
Django Bot
>> Jobs - Django Developer
inchidi
I'm want to know how will I structure my models. That will enable filter businesses under a specific location and filter business under a specific category.
just Business models with category and location fields will be enough i think. You can use set choices for category if you want your user pick one category only, or you can create one more table which is Categories to store categories and make many-to-many relationshop
Val
Now in more details this is what I'm talking about..
Val
I'm building a project but I'm presently the backend of the app will run using a dummy data first. Now I've created some API routes and hit them from postman. Example is POST /business/ = this is to register a new business, PUT /business/<businessId> = this is to update a new business. But my question is how do I do this API that is base on filter to get all business under a specific location using this api GET /business?location=<location>
Someone
https://pastebin.com/rMrwkBsZ
Someone
https://pastebin.com/rMrwkBsZ
I am having a problem.. my requirement is I have to send objects of a model and custom calculated value to serializer.. I cannot return 2 variables to serializer .. how can I do this?
inchidi
I am having a problem.. my requirement is I have to send objects of a model and custom calculated value to serializer.. I cannot return 2 variables to serializer .. how can I do this?
do that on your serializer, with SerializerMethodField http://www.django-rest-framework.org/api-guide/fields/#serializermethodfield
Val
using drf?
Please what is drf?
inchidi
django rest framework
Val
I am actually using node.js but I believe its practical the same procedures
inchidi
with django i need to add filter_backends = (filters.SearchFilter, ) to my view to able to do that
Val
with django i need to add filter_backends = (filters.SearchFilter, ) to my view to able to do that
And when you hit this API: /business?location=<location> it's should work?
inchidi
And when you hit this API: /business?location=<location> it's should work?
yeah, actually not only location, but also other column in the same table with location
Django Bot
>> Blogs - Facebook Messenger Bot with Django
Someone
Hi.. I have 2 applications fully independent build on django.. both apps have API endpoints.. these 2 apps will be used to build front end of application in react .. now I dont want my react frontend to interact with both apps.. is there a way to handle one apps url from another itself.. just my front end should not know the existence of 2 apps.. so I need to call 2nd apps API also from only one app. Like services or something. How can we attain this..?
Someone
Like one app have http://helloworld.com/getemployee I dont want react to interact with helloworld.com.. rather than it would need same behaviour from my domain .. http://hello.com/getemployee Same result but from my endpoint
Someone
Is it something like... my app interact with that app fetch info and send the same on my endpoint and vise versa .. get data from client.. hit the other apps endpoint with same payload.. fetch response and forward it to client
inchidi
then i think thats also mean you must make server that passing result from hellowold.com which is mean longer response time
inchidi
am not sure about this, dont know any other option
Someone
We are a team of 3 . One guy react and 2 are django.. another guy is working on one particular requirement and am on another.. we kept it separate bcz to use on any other similar project.. so we made it fully independent...now my boss dont want react guy to talk with both of us and use two separate apps for fetching info and he wants it to call from only one app as it comes from one app ... i thought of importing his views and to configure URL by myself.. but i am just curious to know if what i asked can be done..
Someone
then i think thats also mean you must make server that passing result from hellowold.com which is mean longer response time
Ya .. the reason is only one app will be hosted in client server and another one in our server .. which makes it two different domains ..
inchidi
if possible, you can point subdomain of helloworld to your servers, something like api1.helloworld.com to api you created, and api2.helloworld.com to your friend api