Vidit
Yeah i think you are right so what you all think i just follow tutorials on youtube or official documentation
Rajjix
both any resource is valuable, just treat them right, and by that i mean don’t be the copycatter. instead watch read and understand how things are done and do your own because too many tutorials is also not a good thing so find the balance to learn from others and produce with your own code.
Vidit
Resources for beginners
Vidit
New to Django? here is some resources to start Official docs tutorial Django Girls simpleisbetterthancomplex.com Mozilla Developer Network #videos thenewboston sentdex #books Django by Example Tango with Django Two Scoops of Django DJango ORM Cookbook
Vidit
Ohh sorry i didn't know
Mirco
No worries, as I said above u r not the only one 😂
Vidit
😂
Suraj
Is Their anyone who cleared Exploit Exercise Fusion Machine All Levels??
Suraj
CTF Challenge. I know its little out of topic. but
Suraj
Still, is Their anyone😊
Anonymous
How to create middleware in django for first login
Maz
How to create middleware in django for first login
Why would you want to create login middleware?
Anonymous
Is their any solution for it
Anonymous
Anonymous
How to implement it any example
Maz
Django comes with a pretty strong login system. No need to go write your own middleware for it. In fact I wouldn't advise you to tamper with middleware unless you really know what you're doing. 😅
Rajjix
I don’t think he does 🤔
Rajjix
and there is a full example in the docs about middleware and making your own custom middleware
Rajjix
https://docs.djangoproject.com/en/2.1/topics/http/middleware/
Rajjix
<h2>Writing your own middleware</h2>
Maz
If he knows what he's doing...that's cool. Plenty of online guides for it.
Anonymous
Can anyone give me access of vps
Rajjix
do you have 1$?
Anonymous
What should I look for to resolve this? https://stackoverflow.com/questions/53143721/how-to-create-query-in-django-with-query-in-url-and-return-the-filtered-result
Rajjix
Simpler solution
Rajjix
Just make a listview for you search
Rajjix
Grab the contents, do your query however you filter it and display a list of items found
Rajjix
Why should you be trying to grab the whole url to search something in your database?
Rajjix
in a simpler explanation would be when the search form is submitted, you take the value of the form and redirect to the search list view
Anonymous
I received a response in stackoverflow, just change the method to GET that "? q = test" is added automatically in the url, and this way, when accessing the link I have the expected results. But I did not know it worked that way, lol.
inchidi
try print(query) before if query: so you know what passed there
inchidi
you can set default to 1 if page not passed with page = request.GET.get('page',1)
inchidi
umm i dont get it
inchidi
is it because you use template = "blog/post_search.html" and not posts.html ?
Anonymous
is it because you use template = "blog/post_search.html" and not posts.html ?
oh, the error is because I was trying to use objects manager methods on the paginator object, so the count was zero and the template did not render the posts
Anonymous
In the end, I managed to solve some of the problems I was facing, studying alone with the doc is complicated but it's good because I break my head and understand things better
Anonymous
Stupid me, didn’t see that 🤭
see https://stackoverflow.com/questions/53143721/how-to-create-query-in-django-with-query-in-url-and-return-the-filtered-result/53143877#53143877
Maz
is it feasible to integrate a follower system into django cms or does it already come with one inbuilt?
Anonymous
😂
You look like @MrRudest
Shubham
Which database option is better sqlite 3 or firebase
Milan
Which database option is better sqlite 3 or firebase
For simplistic way, go for sqlite3... Otherwise firebase would be better for more senarios
Shubham
I have zero experience in django can some guide or provide a like for getting started to built a full stack website or else bootstrap and django website
Shubham
Please Help!!
Milan
@Shubhamn
Milan
New to Django? here is some resources to start Official docs tutorial Django Girls simpleisbetterthancomplex.com Mozilla Developer Network #videos thenewboston sentdex #books Django by Example Tango with Django Two Scoops of Django DJango ORM Cookbook
Shubham
Thank you
Akash
it’s kinda hard to get something like this, i suggest using codepen to find specific cool templates for specific pages or views and with ur knowledge implement them, bootstrap is good but somehow basic, eventually you’ll have to learn react do get all the cool stuff and really impress viewers regarding the stuff on client side.
Hello I have found a good template to start with in codepen. It has everything I need, how to actually use the code? Is there a better way than copying the HTML code in template manually, and other CSS and things seperately?
Rajjix
well u can put them all in the html file just add your style to your header
Rajjix
and check if the css is compiled and if the js is using external link for react or jquery because you’ll need those as well if it is
Rajjix
But my personal preference is separating stuff the more you separate your components the more control you have over your project
Adonis
It was a small behavior of Django when debug is False and handlerr404 is defined
Adonis
The point is that when you submit a request to the app and during it processing there is a 404 error where ever it will try to call the 404 handler and regenerate a new csrf_token invalidating the current one (the one in the posted for )
Sergei
Thank you
Mozilla Developer was the most convenient for me
Adonis
https://code.djangoproject.com/ticket/28488?cversion=1&cnum_hist=3#comment:12 here is a ticket related to it
Adonis
Thanks for you time
Rajjix
Thanks for you time
Thanks for your feedback ☺️
Михаил
Hello everyone, trying to access my API through oauth2, using django rest && oauth toolkit, added the application with client_type: public, Authorization grant type: Authorization code, authorized the application, received authorization_code, but the access token can not get. Response: unsupported grant type. I'm trying to get an access token in the form of a post request curl -X POST -d "client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&grant_type=authorization_code&code=<CODE>&redirect_uri=http%3A%2F%2F127.0.0.1%3A8000%2Fo%2Faccess" http://127.0.0.1:8000/o/token/ curl -X POST -d "grant_type=authorizatio-code&code=<CODE>&redirect_uri=http%3A%2F%2F127.0.0.1%3A8000%2Fo%2Faccess" http://admin:adminnfrjq1@127.0.0.1:8000/o/token/
Михаил
Tried - did not help: 'OAUTH2_BACKEND_CLASS': 'oauth2_provider.oauth2_backends.JSONOAuthLibCore
Михаил
Any idea what the problem might be? Or may need data from settings.py?
Prosto
better documentation. easy to install, easy to manage
George
is django admindocs goode?
George
YES, ITS BRUTAL AND YOU NEED IT
Anonymous
share any reference for developing chatboat
Bhupesh
share any reference for developing chatboat
What tech would you be using at backend??
Anonymous
share any reference for developing chatboat
By using python and sqlite3 in django
Srivatsa
I've three fields in my database table with attributes a, b and c. C is sum of a and b . I I'll take input for a and b only from front end and I've to calculate c and store all three to dB. How to implement it ?
Rajjix
c = a+b ?
entropy
I've three fields in my database table with attributes a, b and c. C is sum of a and b . I I'll take input for a and b only from front end and I've to calculate c and store all three to dB. How to implement it ?
implement a save() method in your model to do self.c = self.a + self.b. This way you can just create the instance from the inputs. Also this will ensure that everytime a or b updates, c will also be updated.