Saadi
Oficial documentation is the best resource
DOC seems very much confusing for me.
Andrej
Oficial documentation is the best resource
This is right. There are so many good examples in the documentation. Additionally, I would read the book "Two scoops of Django".
Anonymous
hey guys, any recommendations of where to put business logic in django apps? I see some core devs saying to put it on models but others say that it could be better to add a new layer, but some core devs say it is against django... so I would to know more about it
Doragonsureiyā
@Andrej1a bro. Can you provide some more recourses from where I can master django. (Mostly I need class based views and Django ORM resources)
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Andrej
hey guys, any recommendations of where to put business logic in django apps? I see some core devs saying to put it on models but others say that it could be better to add a new layer, but some core devs say it is against django... so I would to know more about it
Business logic should be inside the models in Django. This offers a high degree of reusable business logic. For example when you add a Rest-Api on top of your models, the business logic will be taken into account.
Ivan
Hi guys, I’m using Djangochannelsrestframework to establish web sockets connection with React app. I use model observer which sends a message when something changes in model. But stuck with question about security. What is the best practice to secure websocket connection? I mean is there something like jwt tokens or smth.?
Suraj
If I'm using django authenticate() from django documentation..do i need to import "User"?
Al
I Have A Question in Stackoverflow, https://stackoverflow.com/questions/71775812/how-to-create-social-application-tokens-with-django maybe someone can answer that. Thanks.
sina
Hi guys I have a problem in setting cookies in browsers My cookies set in Firefox but Not set in Google chrome!!!!! where is the problem?!!!
Maxim
Hi guys I have a problem in setting cookies in browsers My cookies set in Firefox but Not set in Google chrome!!!!! where is the problem?!!!
probably Chrome settings 1. you didn't provide enough information 2. it looks like it has nothing to do with Django
Narayan
How can run django on live server @all please help me
shubham
why i am getting empty queryDict in request.POST https://www.toptal.com/developers/hastebin/rejavesuwo.sql
Anonymous
Guys, any manipulation in the website (for example deleting a todo etc.) should return an HttpResponseRedirect?
Anonymous
Going to localhost:8000/project/todo/2/delete and then immediately redirected to previous page
Anonymous
Is that right?
Anonymous
short answer: no long answer: it's up to you
Any suggestions on how to delete a thing, then refresh the page?
.
I have User as a foriegn key (author) in a model Blog. How to get all the blog objects in which the current user is an author?
NITIN
I am passing request.Files from one function to another background process functions but it is giving me a error that InMemoryUploadedfile is not json serializable. Can anyone help me how can i pass it ?
Vladimir
Hello, i have server in corporate network, without internet. Need realize file storage for any thousands files. I think how better did it, using server filesystem storage and give away by nginx or setup and to configure s3-compability storage. Search in internet didn't give an answer on this question
Rafał
Imo s3 solution will be easier and pleasant
B
How to send unordered queryset in paginate_queryset ? If I send unordered queryset in to paginate_queryset the it's automatically order by pk. So how to stop sorting ?
shubham
Because you are doing a GET request
can you pls explain, as i am beginner, as i have to input contain data of two different models
Andrej
the problem comes with it gets a bit more complex like using business logic from model A in model B
Yes, that is true. In that case all dependencies and used models should follow just into one direction to keep order in that structure.
Anonymous
tell me, is there a complete article on deploying django to an ubuntu machine? with getting ssh, running correctly. everything is in order. I just found everything separately, well, then it didn’t work out that way
Doragonsureiyā
tell me, is there a complete article on deploying django to an ubuntu machine? with getting ssh, running correctly. everything is in order. I just found everything separately, well, then it didn’t work out that way
These single steps will help you a lot: 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
Suraj
Someone please explain me the meaning of "If user is not None:"
Suraj
I mean I know what's meaning of None. But the meaning of this line in django authenticate and login()
Suraj
Unable to get that
Javokhir
Hi everyone, I have a question, I deployed my project, but I can not upload images via models
Suraj
What i understand from that line if user is not empty/null then it will enter the if block
Suraj
is not returns True for any user value except None
Ohkay, so in this case of authentication is successful it will enter the if block
Suraj
I understood now
Suraj
Thanks for saying it differently, i got it
Maxim
Ohkay, so in this case of authentication is successful it will enter the if block
idk, depend on that what in user may be if there can only be either an entry from the users table or None, then yes
rakshit
Hey, is it a good practise to use the in-built authentication system or should I find another module?
cj
Hey, is it a good practise to use the in-built authentication system or should I find another module?
so, why do you think Django core developers burn their eyes and spent all their time building an authentication system for Django? —that includes following OWASP things and building strong unit tests— for users not to use it???? come on!
cj
what make you think using built-in features are nod a good practice? why do you think then built-in features exist?
rakshit
Because, I thought that there can be some better extension for this stuff
rakshit
Which the market would prefer
cj
🙄
rakshit
God, dude I was just asking for some suggestions. Don't be so rude
Д
God, dude I was just asking for some suggestions. Don't be so rude
the question is 100% legit — often built-in things aren't meant for production
Savic
Yes you can
Mind sharing the logic?
ire
God, dude I was just asking for some suggestions. Don't be so rude
Hi Its depends Half of the time you hve to write your own user model
cj
the question is 100% legit — often built-in things aren't meant for production
so, do you replace Django's ORM with something else? do you replace Django's CSRF protection with something else? do you replace Django's auth with something else? do you replace Django's TL with something else? do you replace Django with something else?
cj
do you use SQLite that comes by default?
that's not a built-in feature ¯\_(ツ)_/¯
cj
that's a default value for easy bootstrapping
Д
just because something comes built into a system doesn't mean you should trust it
Д
ok so don't use Django then ¯\_(ツ)_/¯
how is your Argument School going? failing yet?
cj
because Django is that... a framework ready to use out-of-the-box
cj
we're talking about built-in features... not default values that you SHOULD change, of course... but I guess you don't get the point ¯\_(ツ)_/¯
Д
we're talking about built-in features... not default values that you SHOULD change, of course... but I guess you don't get the point ¯\_(ツ)_/¯
I see good reason to extend Django even at its core functionality. AFAIK the auth packages that come don't come from built-in features but external packages that are widely used.
Д
but you're right that I don't see need to go and Modify django source code, no.
Д
for functional purposes I don't really see a huge difference between questioning "the basic setting for Django auth is Basic HTTP Authentication" vs. "the basic DB for Django is SQLite" — since they both require going outside of Django
cj
well, they do Replace something
if we go to OP original question, about Django's auth system... you can extend it to add, for example, tokens, using JWT or something else, that doesn't mean you're replacing Django's auth system —which is one of the best built-in features out there— ¯\_(ツ)_/¯ but I'm glad you opened your eyes and got the point and stop acting childish, good for you
AL
ProgrammingError at /admin/ permission denied for table django_session
AL
help me 🙏
Shabbir
ProgrammingError at /admin/ permission denied for table django_session
https://stackoverflow.com/questions/24473957/programmingerror-permission-denied-for-relation-django-session