vinoth
hi guys, im new to django. i cannot save anydata at poll>urls file. if i enter anydata in urls file. i cannot close it. kindly help me guys
Mirco
!paste
Doragonsureiyā
To share code or error tracebacks please use an online pasting service, here is a list of suggested sites: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev
Rangarajan
vinoth
https://del.dog/ulirranull
M
@LAbef My CMD-command "django-admin startproject ..." doesn't work
This is also problem when I install python from app store instead of msi .. make sure paython path and then install the django
Rangarajan
Always try to install python from python.org
Rangarajan
garrip91 did you set the variable PATH?
garrip91
garrip91 did you set the variable PATH?
I looked it (it's no problem)
Rangarajan
Can you send the error message?
Rangarajan
https://del.dog/ulirranull
Send your code it will be more helpful
PP
Hello everyone, I have one question how I get out of the loop after clicking stop button if loop is running already Please help me
Anonymous
Hi, I am using django-background-task for scheduled jobs. In mysql background-task table, duplicate task names are coming..did any one face this type of issue ? How did you sort this issue ?
Anonymous
Guys can you pls tell me the best resource to learn django
cj
Guys can you pls tell me the best resource to learn django
did your read the pinned message of the group?
Anonymous
Diffrwnce between Model inheritance vs Model Relationship?
Doragonsureiyā
Diffrwnce between Model inheritance vs Model Relationship?
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box, write down the same words you asked here Step 4: Read the first results
Anonymous
Anyone ....worked on django viwset method overriding
Anonymous
Fuck
Anonymous
I forgot to see correct server error
Gk
Anyone working with crispy forms
Doragonsureiyā
Anyone working with crispy forms
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z" Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high. How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Werner
ah nice
Oleg
Guys, could you please point this out. Is it a correct way to write such business logic in django models.py (just get model class from instance) def db_marked_as_dr(self): return self.class.objects.filter(is_db_dr=True) or should I just dont bother my head and to simply import model in views and to transfer filtered data like: data= Model.objects.filter(is_db_dr=True) in template through context?
Oleg
What's the correct way to handle such things? Where should I write business logic?
Oleg
I have such misunderstanding because of Django rules (Django recommend to write business logic in models.py and to not combine it with views.py) So should I take this advice and to strive to write such things in models.py?
Mirco
What's the correct way to handle such things? Where should I write business logic?
One best practice is to make models fat so try to write as much as u can logic into models but as always it depends on use cases, sometimes it's much easier to just handle logic inside views or forms/serializers
Mirco
Try to keep views small
Oleg
Oke, got you. But how you recommend to handle that case I listed above? Is it a correct way to access model through its instance?
Oleg
Do I need to just simply write a method in model Database and to write a specific method in which I just simply use manager of Model and dont interacting with its instance (through self.class) So like: Database.ojbects.filter(....) instead of self.class.objects.filter(is_db_dr=True)
Mirco
The only improvement you can do is that if it's a common query, use a Custom Manager or a custom queryset if you wanna chain it
Oleg
But query to db is a business logic, right? So at this case why should i write it in views.py?
Heigler Rocha
But query to db is a business logic, right? So at this case why should i write it in views.py?
I think you're trying to follow the layered pattern and looking to that query as a repository thing, right? Django by default is MTV, that means its ok to make your queries in View, CBV itself has properties and methods like "get_queryset" and so on. Use the model for operations that need a database instance like get_absolute_url, and if you want an abstraction for complex or common queries use CustomManagers instead.
Mirco
yep, thank you guys for clarification 👍🏻
Or Custom Querysets, it depends on your use case
Mirco
2 Scoops of Django is a suggested book to improve this kind of skills 😊
Oleg
2 Scoops of Django is a suggested book to improve this kind of skills 😊
Cool. I will try to share some time to read it :) Thanks.
Oleg
Seems like, at this stage, I will look in the direction of custom managers :)
Anonymous
How to use filter functionality in template of django? Someone?
Anonymous
Instead of using that in .py file
Mirco
How to use filter functionality in template of django? Someone?
Templates are not for that goal, they are the representation layer Logic goes into the backend and this means also filtering
Mirco
Instead of using that in .py file
It must go inside py files.
Anonymous
Hello friends, I am using django built-in authentication, I have an app called "bonus" which has a "registration" as sub-folder, I have templates for password reset etc but the problem is that it always redirect me to the admin when I want to reset password.. can someone please help?
Anonymous
Try django-registration-redux
Sadra
SIGNUP_REDIRECT SIGNIN_REDIRECT
Sadra
Not quit sure. You better Google.
Anonymous
SIGNUP_REDIRECT SIGNIN_REDIRECT
If I want to reset password I am always redirected to the admin
nightescapist
nightescapist
Check that urls. Py page
Anonymous
I use path('accounts/', include('django.contrib.auth.urls')
Duncan
Guys, I want to start learning ML.. I am starting from scratch and I need someone that can help me set up my laptop to start everything.. please..
Satish
hello, is there a way to use Django rest api on an already existing database?
Stephen
When designing a mult-tenant project (Saas), when do you implement it? Is it after you have designed the entire project and everything is working as expected or from the start?
Duncan
have you any resources
No please I am starting from scratch, I know nothing at all. I don't even know how to set up my laptop and start writing in the language
Ismail
First of all download Anaconda distrbution
Ismail
Okay? and ?
Choose a resource for learning ML
Ismail
Choose a resource for learning ML
Notice that all resources just are a guide for you and just show you the correct way then your hardwork and consistence needed
Ismail
There is a lot of hard skills and soft skills that you need to learn through the way but for start just find good book or course to teach you the basics....
Shivam
Hello Guys I just started learning django I'm getting a error saying poll.urls don't have any patterns I already checked the spelling of urlpatters... Still getting this error
Ehsan
upload screenshot please
Shivam
Okay wait
Anonymous
I creat hello_world in django and in hello-world I creat an app(app1) and when I m done with all other coding and came to give the path of app1 to hello-world URL throw include(app1.URL)... Its give an error that app1 is not defined
Shivam
Sending Medi isn't allowed?