WhiteDevil
I will use the Web-UI only for reviewing retrieving values from the DB
WhiteDevil
But I need to execute the script from the Web UI
WhiteDevil
Is that possible ? Can someone guide me ?
Anonymous
Anonymous
Hello everyone I am begginer in django. I am trying to build app by referring "django project.com". I have done all operation but i am not getting the questions in that form. In admin.py i have already mentioned "admin.site.register(question)". After doing that part of questions is not visible to me. Please help me to figureout where i did wrong. I am referring this link for practice. And also doing the same project which is present in that site. https://docs.djangoproject.com/en/3.0/intro/tutorial02/
Roman
Hi guys I am doing the query by the property of foreign key and this is not working have no idea why
Roman
filter(pulled_from_database=False,campaign__is_running=True)
Roman
campaign__is_running=True
Roman
It's not Fk
Roman
Like it's but it's the property of it
WhiteDevil
Use admin commands for it...
Can you please share me any examples or references?
Hari
Hi Can any one help here to save logs to database
ㅤㅤㅤ
Migrate qiling
Mikhail
can you provide your urls.py?
Mikhail
show home function from views pls
Mikhail
u can show it fully, but then pin it as a file, or use smth like https://www.codepile.net/
Anonymous
With django how can i use an iframe to open camera module
Dishant
hi i am getting this error while deploying my django site to heroku a=can anyone help me I have made Procfile and requirements.txt and procfile has: web: gunicorn django_project.wsgi --log-file - Building source: remote: remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to myblogspot. remote:
Dishant
Yeah I checked but it tells to add Procfile but I have added it
Davit
https://davit.tech/django-jupyter-notebook/ How to use Django shell in Jupyter Notebook
Michael
Hello a quick Django question is it possible to exclude the password field or at the very least make the password field on sign-up not required when using Django or django-allauth
Michael
Password not required ?!
Would have sent a screenshot of the dilemma I'm facing but can't do that ...
Michael
You can override the form, but I am not sure whether it can be done without password need to execute and see it
I managed to create a custom sign-up form but everytime I try create a user through it ... I am redirected to the default signup page that tells me the password field is required
Michael
I will send you my code now
That would be highly appreciated
Mohamed
Yes I tried, same error bro
Mohamed
Why don't you create a manual form, get username and store it in model and when they login, you can query the table and if result come you can redirect?
Michael
If u can disable password then how it will become 'auth'?
the flow I wanted was that an admin creates users and instead of having the admin set passwords for the users ... An email is automatically sent to the users on creation for a password reset ...
Mohamed
https://www.google.com/url?sa=t&source=web&rct=j&url=http://django-authtools.readthedocs.io/en/latest/how-to/invitation-email.html&ved=2ahUKEwjv8buPvfToAhV5zjgGHeQUCwgQFjAAegQIARAB&usg=AOvVaw1FgsZwkXyXMpOltv9SxZ8x&cshid=1587299090017
Mohamed
There in Django documentation with example, good luck bro
Shihasz
Also there is a method set_unusable_password() , u may read docs on that topic
Michael
Create a custom user model and make password field and set null = True
Can overriding the password field be done when someone has created the Custom User by extending the AbstractUser class ....
Shihasz
Can overriding the password field be done when someone has created the Custom User by extending the AbstractUser class ....
Yes, password field is same like any other fields except saving is done through hashing
Onur
Hello, I cannot get CSRF Token from cookies. It gives CSRF Token error when I try to make post on password_change endpoint. Somehow user cannot login I guess so change_password endpoint redirects me again to login endpoint. I am using knox token for authentication and custom login view. I use django auth's password_change view. Here is my models, serializers, views, settings and urls. Any help would be appreciated. https://del.dog/jyvypelyme
Onur
-when I try password_change endpoint in browsable API; it redirects to login page and does nothing. However knox token for the user is created. -when I try the endpoint in Postman it gives CSRF token error since I cannot get the CSRF token
Anonymous
Guys I just deploy my django app on heroku it was running there perfectly but after 2 hours of later my all blogs images are hidden from there, I don't know what happening plzz help me
Michael
Okay lemme try that ....
Was finally able to implement the functionality ..... 😭 Thank youuuuu
Anonymous
Guys I just deploy my django app on heroku it was running there perfectly but after 2 hours of later my all blogs images are hidden from there, I don't know what happening plzz help me
heroku free tier resets at certain points, so you lose new files stored there. use an external service to store your images like cloudinary
Anonymous
How to do that
https://cloudinary.com/documentation/django_integration
Anonymous
you can use other services if you want. but cloudinary has a sdk for django and they offer free tier
sagir
Can anyone tell me how to get one single field from model..
sagir
Model.objects.values()? Should I pass anything in ().?
Mirco
Model.objects.values()? Should I pass anything in ().?
Inside values you specify the fields you wanna get
sagir
OK thanks
Doragonsureiyā
OK thanks
You're welcome! 😊
sagir
Hey I am using values () But when I am rendering this to my template it showing me all the objects. I need only that where I will click
Mirco
Inside values you specify the fields you wanna get
What of this sentence is not clear ?
Mirco
You need to specify the fields you wanna get otherwise it will show you all fields Much more clear ?
sagir
Look..I have two functions are there.. In first function I am using all() with truncatewords and in second function I am using values (). So whenever I will run the server all data will come from my first function with truncatewords and every card has View button to view more..so problem is that, if i am clicking on the first card them instead of showing data of first card it's showing the data of all the cards..
Anonymous
Or get_object_or_404
Mirco
Study ListView and DetailView
Mirco
6 lines of code more or less and you have what you need
Onur
I am getting usertoken and passing it to cookies already. However, when I am making a post on “/password_change/“ it returns a CSRF forbidden response. This lead me to try getting csrftoken in the front-end. However I cannot reach csrftoken on that side. Django returns csrftoken to browser when I log in on my React.js page but it comes inconsistantly. That is, I cannot see cookies always in the cookie table of browser. Thanks you!!
Asaduzzaman
I would like to learn django professionly.
Sheshadri
Look..I have two functions are there.. In first function I am using all() with truncatewords and in second function I am using values (). So whenever I will run the server all data will come from my first function with truncatewords and every card has View button to view more..so problem is that, if i am clicking on the first card them instead of showing data of first card it's showing the data of all the cards..
Ah, you have not written PasswordResetSerializer(you have created Register and login though), what you are trying to access is different via REST, I would recommend you use DJOSER(https://github.com/sunscrapers/djoser) https://djoser.readthedocs.io/en/latest/base_endpoints.html .. which has built-in password reset endpoint, you just need to call that using the Knox Authorization Token.
Sheshadri
Or take a look at the above codebase how he is achieving change_password and replicate the code in your serializer, but I would recommend using this module as it does many more useful things
M3FoOoS
When I put csrf in the form and request url, code is generated, but how can I verify this code before entering the function and how to generate a generation before the render html process, When the page requested, we see header csrf not matching the random code in the template