Mirco
I found it is useful for back end part
Your question is also not clear
Mirco
Django is a web framework So you can build web apps both backend + frontend Or just develop APIs
ㅤㅤ
Your question is also not clear
Question _ what is django ... it's first time I heard about that .... Thanks
Mirco
Question _ what is django ... it's first time I heard about that .... Thanks
That's why you can read official docs and tutorials
L¿<>
Ok
But dont waste time with django-templates
notyour
guys for developing apis any particular video playlist you wanna recommend
notyour
??
Rajesh
I&#39;m using django to develop my project after deployment can I use Admin panel?? Like now I&#39;m using localhost:8800/admin after deployment can i use www.domain.com/admin
Rajesh
Yes, it works
Sure?? If means the username and password will be the superuser password right
Rajesh
Correct
Thanks a lot.
L¿<>
How do I change
In urls path
Rajesh
Path()
Rajesh
In urls path
Instead of empty path(&#39; &#39;,incl....) I need to change some valid name??
L¿<>
urlpatterns = [ path(&quot;CHANGE HERE whatever you want /&quot;, admin.site.urls), , ]
The TokenTitan
Exactly, I don&#39;t use the /admin to route to Admin panel I use something very uncommon
Rajesh
Can you guys share sometips like this. Because I&#39;m new to django
Rajesh
I&#39;m going to deploy my own personal project
$@£d@®
When I try to send activation mail to my email I get this error failed to send activation email to example@gmail.com, error: (530, b&#39;5.7.0 authentication required. for more information, go to\n5.7.0 https://support.google.com/mail/?p=wantautherror d2e1a72fcca58-70b1b6382c5sm2889119b3a.34 - gsmtp&#39;, &#39;webmaster@localhost&#39;) in django So what can I do to avoid this error
Priyanshu Pratap
I am not able to use session variables in django i did all preliminary steps like configuring middleware and engines and session age as well but still its not working. I am using mysql as a database and using nextjs as frontend and django as backend...please help
I am creating a session variable in a view where i am doing login opertation request.session[&quot;somevalue&quot;]=&quot;Abc&quot; But when i fetch the session in another view like print(request.session[&quot;somevalue&quot;]) it is printing None..why its happening??...i am using DRF and class based views
John
Is , I can able to deploy my project on this site freely..???
The TokenTitan
I am creating a session variable in a view where i am doing login opertation request.session[&quot;somevalue&quot;]=&quot;Abc&quot; But when i fetch the session in another view like print(request.session[&quot;somevalue&quot;]) it is printing None..why its happening??...i am using DRF and class based views
Know that in DRF, if a user is not authenticated, Evey request is different from the previous. Because the request are always &quot;detached&quot;. So if you save a session with request.session and you make another request, another session gets created entirely so you cannot rely on session like that.
Priyanshu Pratap
The TokenTitan
The TokenTitan
Like jwt or something
The TokenTitan
It&#39;s best to use token authentication Because if you want to implement pure authenticate() and login() it will not be persistent because Evey request is entirely different so it needs to login again
The TokenTitan
Look up Simplejwt django rest framework It&#39;s the recommended way to achieve that in. DRF
The TokenTitan
With that, you can pass the access token to the front-end and when a request is made to the Django and the token is also detected, you will be free from frequent logging out and all You can configure it and customize it Just do that and let us know when else you have issues
Priyanshu Pratap
It&#39;s best to use token authentication Because if you want to implement pure authenticate() and login() it will not be persistent because Evey request is entirely different so it needs to login again
So if we use login method in drf then with different view the request gets changed and due to that the user gets logged out??..how login works with the normal django...like user remain login when till the session age expiry
The TokenTitan
So if we use login method in drf then with different view the request gets changed and due to that the user gets logged out??..how login works with the normal django...like user remain login when till the session age expiry
I don&#39;t really understand this tho But for authentication in DRF It&#39;s best to use token authentication Though Basic Authentication, Session Authentication also can be used Basic Authentication will always require you to pass login credentials everytime (email and password or username and pass) But for your own case (Next js on the FE), token authentication should be your go to
ask
Please explain what you&#39;re trying to do
$@£d@®
Is your gmail smtp well configured
I don&#39;t know if you have solution please give me
The TokenTitan
I don&#39;t know if you have solution please give me
Paste your email back-end configuration and also the send_mail()
The TokenTitan
I am sorry this isn&#39;t well explained more information and details
Alex
there is third party package for that.
The TokenTitan
Okayyy You mean one out of them is like a main Image and the others are saved after the main one has been saved
The TokenTitan
Well, let&#39;s see your models.py and your views.py
The TokenTitan
Please use pastebin.com
The TokenTitan
Even from this I don&#39;t see where &#39;Zwie&#39; is being assigned a value Also, you cannot access that &#39;Zwie&#39; if at all its being passed you need to access it like If &#39;zwie&#39; in request.POST.keys() So that if condition will not evaluate to True
Emmanuel
alright
eric
I don&#39;t see EMAIL_HOST_USER in your settings
$@£d@®
I got it I didn&#39;t use email host password in my settings.py that&#39;s why I got this error
Jahongir
Hello everyone, I have released a package for PyPi. What should I do to ensure that this package is verified, that is, so that it appears in a Google search?
Doragonsureiyā
Hello everyone, I have released a package for PyPi. What should I do to ensure that this package is verified, that is, so that it appears in a Google search?
This is not a Django specific question, please delete your offtopic message. If it&#39;s a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Rajesh
You can add filter code in admins.py if you are using admin panel to filter
Flam
Overide the queryset and use filter(username__id=self.request.user.id)
Suryo Adhy Chandra
give an id with primary key or unique=True
Suryo Adhy Chandra
you must control it in override on save method https://www.geeksforgeeks.org/overriding-the-save-method-django-models/
𝑀𝓇. 𝐿𝑒𝓋𝒾𝒶𝓉𝒽𝒶𝓃
Hi everyone I have a question, which way is better for Writing queries: Use django orm or write queries in stored procedure and then import it?
𝑀𝓇. 𝐿𝑒𝓋𝒾𝒶𝓉𝒽𝒶𝓃
better for what, exactly I mean, what kind of queries
Simple queries like read all queries, filtering and others
cj
Simple queries like read all queries, filtering and others
from scratch? then use the ORM. unless as Charly said, you already have SP you don&#39;t want to touch for a very strong reason
𝑀𝓇. 𝐿𝑒𝓋𝒾𝒶𝓉𝒽𝒶𝓃
The ORM, unless you have version controlled and tested stores producedures.
Ok thanks So you say that it isn’t neccessary to write queries in sp
𝑀𝓇. 𝐿𝑒𝓋𝒾𝒶𝓉𝒽𝒶𝓃
The ORM, unless you have version controlled and tested stores producedures.
I just want it for my project and it isn’t too large Just an online shop So as you say orm is better
𝑀𝓇. 𝐿𝑒𝓋𝒾𝒶𝓉𝒽𝒶𝓃
Why would it be necessary?
Someone told me write your queries in sp
𝑀𝓇. 𝐿𝑒𝓋𝒾𝒶𝓉𝒽𝒶𝓃
Then ask that person
He said sp is better because we must separated queries from our app codes And I dunno he said the truth or not
𝑀𝓇. 𝐿𝑒𝓋𝒾𝒶𝓉𝒽𝒶𝓃
🤷‍♂
Ok thanks bro I use orm and dont care what he said
cj
Someone told me write your queries in sp
maybe that someone doesn&#39;t use Django