Luis
Do you think it's a good idea ?
Luis
How come no one responds to this ?
inchidi
Where do you guys put your business logic ?
managers and models, i keep my views, forms/serializer as simple as possible
Anonymous
The forms are not on html?
inchidi
django forms tho
Luis
@Inchidi do you leave the validation work to the form/serializer or put some to the manager function itself ?
Anonymous
How do you include business logic in the models?
inchidi
django forms tho
but i rarely use django form also tbh, last time am using it when am learning django 😐
Luis
But where ? In the manager or in the validate function of the form/serializer ?
Luis
@Inchidi
inchidi
How do you include business logic in the models?
here is some example https://gitlab.com/gitaproject/gita-api/blob/master/relationship/managers/friendship.py
inchidi
like usual, model raise ValidationError and serializer handle it
@isasiluispy serializer handle it means it catch the exception and raise APIException (from rest_framework) with proper errror message for frontend
inchidi
of course "input" validation like (for example) "user can post dict with list of category but only 2" stay on serializer
Luis
I understand
Luis
More deep errors gets handle in the manager itself
Luis
Like say constraint errors, or relations errors
inchidi
yeah basically i prefer to put every logic on model as many as possible
Luis
Like say constraint errors, or relations errors
And they bubble up as exceptions
Luis
Make models fat
More like managers fat
inchidi
More like managers fat
models when its logic for object, manager when its logic for queryset for me
Luis
Cool
Luis
Ty for the knowledge
inchidi
Hello . Does someone have a good booking or scheduling application tutorial ?
that project is about scheduling btw, you can check app named agenda
monxter
Thannk you !
Any other projects idea
John
anyone here tried using nginx in you django project? is it good than heroku?
achilles
yes
achilles
nginx is just reverse proxy server
John
nginx is just reverse proxy server
But I can deploy my django project there? Is it free?. .
achilles
it's freee
John
it's freee
thanks, does it have a storage? i mean can it store files like text file?. .
Alex
thanks, does it have a storage? i mean can it store files like text file?. .
Nginx is no webapp and neither is it a reverse proxy, its a damn web server like apache. You put your Django application listening on localhost on some high-port (8080 e.g.), then you HAVE TO CONFIGURE a reverse proxy virtual host that maps a domain name to the localhost:port
achilles
correctly
Alex
correctly
Yeah thanks, i dont need confirmation from the one i corrected
achilles
you win🤣
Alex
In general: apache is kinda easy to configure with the seperate vhosts but a tad slower than nginx, nginx is a bit faster but a bit 'trickier' to configure (says the guy who started with apache)
Alex
Moral of the story: know your stuff or dont be surprised if you struggle
Alex
Thanks you sir! So technically nginx and heroku are different software?. .
I never used heroku but afaik its a free hosting service, while nginx needs to be installed on a server you own/have access to with a public ip or domain
Alex
it's not free, they have pricing table which is the lower tier was free
Never used it and dont plan on going to since i can actually manage my own servers so thx for the very necessary input
Suresh
Hello guys I am doing project on random generation of question paper I am taking input textbook and giving question paper as output Someone suggest me about frontend to use in python?
Mirco
Create the get absolute url method into the model of the created object and use that as the success url
Gaurav
Guys why should I learn react js even though there is django templating language??
Gaurav
What are the Advantages of react over django templating language for someone who's already using django templating language
Mirco
so two different teams for example can work by their own
Gaurav
Ohh i see...
Mirco
For example you can hire a frontend developer without any python/Django skills and he can work on the frontend part because he needs to know React
Cesar
That's not how objects relations work
Modou-dev
hello can anyone help me on this "The translation infrastructure cannot be initialized before the " django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.
Andrey
Hi guys, does anybody has tutorial for google captcha? need to create a page with captcha if pass -> redirect
Cesar
Hi guys, does anybody has tutorial for google captcha? need to create a page with captcha if pass -> redirect
It's not that hard to search online. A simple search on google, duck.com or whatever with "Django recaptcha" will bring you results as https://blog.bitlabstudio.com/using-recaptcha-with-django-1b7aea786ad6
Andrey
It's not that hard to search online. A simple search on google, duck.com or whatever with "Django recaptcha" will bring you results as https://blog.bitlabstudio.com/using-recaptcha-with-django-1b7aea786ad6
thank you, I saw this article, was trying to replicate, but met some error cause was trying to set captcha w/out any button -> if captcha is confident that user is a human it is just redirecting a user, if not, showing captcha and after success redirect
Lalit
I am using django 3.0.2 my admin is not working .
Mirco
Matthew
I am using django 3.0.2 my admin is not working .
My car won't turn on. Anyone knows why? It's model 2013.
Pedro
Put some gasoil
Cesar
Put some gasoil
Do you have a tutorial? First time here
Doragonsureiyā
Do you have a tutorial? First time here
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Anonymous
Please help me with the interview questions on django
Omair
Please help me with the interview questions on django
Try answering to the doubts people have here
Pedro
Please help me with the interview questions on django
You should pass it by yourself. Otherwise you will confront challenges that will over come you... One should be honest with himself.
Jimmies San
Please help me with the interview questions on django
please help me to win 1 billion dollars
Human
Can I able to control gpio using Django local server ?????