Vadim
DisallowedHost at / Invalid HTTP_HOST header: '172.27.229.95:8000'. You may need to add '172.27.229.95' to ALLOWED_HOSTS.
Armin
you must be set allow_hosts = ['*'] in your project setting
Armin
but for test and development, when you want to deploy it, must be changed
Armin
keep care about it
Vadim
keep care about it
Thank you, it works
Alireza
Hello I just started Django I made a series of changes inside my model, when Migraite gives me the following error I also set the default value, but received the same error again django.db.utils.IntegrityError: column "group_id" contains null values
Musa
I have a django website with payment gateway integration... On redirection to the site after payment, the user is being logged out. Any idea how to solve this problem??
Valentin
it's a database error
Shubham
i know i need to override the create method but how to make nested create method ?
Alternatively you just save the data of both the models in a single create method instead of doing nested create methods
Zakx
I am creating signup api with email verification by using is_verified field and otp field in django model , when user signup ,user got mail in and create user but is_verified == FALSE Till not verified otp and user save in dB but problem is when try to signup same mail , user email already save in dB. So how can possible to signup with login functionality create in django.
Mo Matin
I'm confronting this error: 'list' has no attribute 'join'
Mo Matin
lists has no join attribute
I have imported path from sys Then I wrote this line: MEDIA_ROOT = path.join(BASE_DIR, 'media') This must work
vlad
I have imported path from sys Then I wrote this line: MEDIA_ROOT = path.join(BASE_DIR, 'media') This must work
MEDIA_URL = '/media/' MEDIA_ROOT = BASE_DIR / MEDIA_URL.replace('/','')
Shakthi
How to verify Mobile number in registeration form ? How to send OTP to phone nd validate
Shakthi
Anyone please help me
Mo Matin
Charly
Anonymous
vlad
Anyone please help me
https://duckduckgo.com/?q=django+mobile+number+in+registration&t=brave&atb=v303-1&ia=web
J
Anyone familiar with using UserChangeForm? When I render it using form.as_p the password section doesn't give the "change password using this form" link. It renders the <a> tags and href link instead.
Mo Matin
import os os.path
It worked Thank you soooooooo much
Mo Matin
?
My problem was something else Your solution was for my next step Thanks❤️
Zakx
I am trying to register the user by sending an OTP to their mail. Consider the following usual: the user posts a request for registration with an email, password. (email mapped to the username of Django). Django creates the user and the user gets the OTP for verification. If the user verifies, an 'is_verified' field will be set to true. Now, If the user doesn't verify himself with the OTP, I can't get around the following issues. Please suggest a workaround. ---> Any other user can now not use the same email for registration, as email already exists in the database. I want the user to be updated in the database only after the user has successfully verified the otp.
Zakx
Anybody have solution please suggest
Neo
Wait you want that another user could use the same mail in case the user did not verify 2FA?
Zakx
you using default User ??
Yes abstract user use
Fan / Ac
Yes abstract user use
if something in django user doesnt match your need, you can always change it https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html
Zakx
Make the email field unique
But email is saved in dB already and again try to signup same user.
Fan / Ac
But email is saved in dB already and again try to signup same user.
then dont save email till the user verify or if the user doesnt verify remove the email from the user do whatever that works for you
Fan / Ac
i dont know how you are doing otp authentication but you can remove email from user if the user dont verify
Zakx
But how can add validation with email.
Zakx
If email is deleted
Fan / Ac
sorry i don't understand what problem you are facing, wait for others
Ali Hasan
Hello everyone. Sorry for this long message but please bear with me. I entered a local physical course (not online) with a title (Restful API with django and django-ninja). I was fairly new to python and I went with it cause before that I knew and studied what are api’s and what is the backend ,… etc using node js. I’d say I’m a beginner so far. The course gave us how to make models, migrations, customize admin and other stuff concerned with django-ninja. After finishing the course I feel I’m so lost. Django is so huge and I really want to learn it the right way. I prefer something that goes from the very low stuff and go up step by step (no boring details but the things that needs to be understood). I can’t even handle the database stuff well and don’t understand how it works exactly in django. My question is , is there any resource that explain django in details, its ORM, how it deals with requests exactly, how to override lots of things, what are django forms, and any of that low level stuff but most importantly the building blocks details. Sorry for taking your time but I’m lost . Any course I’ve tried is concerned with the views and only scratches django stuff that aren’t that helpful. Many thanks in advance for any help.
Ali Hasan
Hello everyone. Sorry for this long message but please bear with me. I entered a local physical course (not online) with a title (Restful API with django and django-ninja). I was fairly new to python and I went with it cause before that I knew and studied what are api’s and what is the backend ,… etc using node js. I’d say I’m a beginner so far. The course gave us how to make models, migrations, customize admin and other stuff concerned with django-ninja. After finishing the course I feel I’m so lost. Django is so huge and I really want to learn it the right way. I prefer something that goes from the very low stuff and go up step by step (no boring details but the things that needs to be understood). I can’t even handle the database stuff well and don’t understand how it works exactly in django. My question is , is there any resource that explain django in details, its ORM, how it deals with requests exactly, how to override lots of things, what are django forms, and any of that low level stuff but most importantly the building blocks details. Sorry for taking your time but I’m lost . Any course I’ve tried is concerned with the views and only scratches django stuff that aren’t that helpful. Many thanks in advance for any help.
P.S : I don’t care if it was free or paid as long as it gives the knowledge I’m seeking. The documentation is hard for me in this phase to depend upon. I’m not native english speaker and not that of a good programmer to understand all the things there 😅
Zakx
No
Gaurav
As I can't chain annotate and distinct on a queryset Operation then what should i do to obtain the same results. I am having a queryset i want to take distinct values of some nested foreign keys through many tables and order in ascending order of some foreign key count
Neo
But how can add validation with email.
yeah i dont understand your problem either, sorry
༆𖤍ཽ🇻 G⃖r༙e༙y༙h༙a༙t༙⚚×͡×
Best resource for learn django from 0 lvl?
Doragonsureiyā
Best resource for learn django from 0 lvl?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
chappa
Can someone please help me with this login page. Its just not working http://paperhackers.herokuapp.com/
Charly
Can someone please help me with this login page. Its just not working http://paperhackers.herokuapp.com/
the page is not useful for use, share the code, errors and related logs to help you
Shukurillo
url(r'^fluff$', lenzo.views.fluff) what do "^" and "$" mean in the code above?
Farrux
Hi there!
Farrux
I have a problem with Django .Can you help me
Farrux
What's the problem
I want to send the problem through a picture but it seems forbidden
Farrux
I prepared Django templates and made a mistake
Farrux
What's the problem
My browser is erroring the DTL code written in the HTML file as python Set
Rebellion
Friends, How to create pagination for search functionality..? Whenever I click to next page, it shows me an error, "The view xyz didn't return an HttpResponse object. It returned None instead." How to solve this..? Thank You..!
Ing. Mario Tamayo
This is, in your view at the end u need to return either render, httpresponse, json response
Ing. Mario Tamayo
Or any similar
Ing. Mario Tamayo
Got it?
Rebellion
This is, in your view at the end u need to return either render, httpresponse, json response
return render(request, template_name, context) I'm returning this....
Ing. Mario Tamayo
Post via pastebin the view and the chunk of html when u call the url
Ing. Mario Tamayo
And maybe the urls.py, with that I might help u out