𝕾𝖍𝖔𝖛𝖆𝖓
"I need help in Django. I'm using cross-header CORS with the following configuration :
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = ('https://shovan-04.web.app/',).
However, when I receive a request from a Python backend file, the backend sends a response. How can I stop this?
20BCS3401_Vikram_Sharma
Please provide full code.
https://github.com/vikramsharma20025/blogger_system/blob/main/blog_app/views.py#L193
please check this function and tell me if it's possible to do what i intend to do 🙏 namely change password
𝕾𝖍𝖔𝖛𝖆𝖓
𝕾𝖍𝖔𝖛𝖆𝖓
𝕾𝖍𝖔𝖛𝖆𝖓
The Inspired
please help me
you are using the django-cors-headers package, right?
𝕾𝖍𝖔𝖛𝖆𝖓
The Inspired
in their docs, it clearly says CorsMiddleWare should be placed above CommonMiddleWare. In your settings, why is it below?
Did you not read the docs?
The Inspired
also, why do you have 2 CommonMiddleWare?
The Inspired
if you are copying code, atleast check and copy properly
The Inspired
ajef
just directly import it?
I imported it but how can I add two models on one view class?
eg
class List(Listview):
model = Student
template_name = 'stud_list. html'
now can I add another model for the class List in the above example?
The Inspired
yeah, you can't
class based view work on only one model at a time.
If you want it to work on more than one models, you will have to override their methods
ajef
Morteza
20BCS3401_Vikram_Sharma
Morteza
Morteza
Can you tell me where?
I can see a typo here
https://github.com/vikramsharma20025/blogger_system/blob/main/blog_app/views.py#L227
20BCS3401_Vikram_Sharma
Morteza
Also an error here
https://github.com/vikramsharma20025/blogger_system/blob/main/blog_app/views.py#L215
save on a queryset ? can't be done. update is enough for your case but still not recommended
you can get the user with first() method and check if there any user or not
20BCS3401_Vikram_Sharma
20BCS3401_Vikram_Sharma
20BCS3401_Vikram_Sharma
I will try it then thanks brother
Morteza
But I think your code did not reach the place where the password should have been changed.
put some prints to detect where you code has reached.
20BCS3401_Vikram_Sharma
20BCS3401_Vikram_Sharma
I will check it
Giree
How to get a form from a drop down in a form in django , any suggestion  is appreciated!
Paul
Devendra
Rtmf meaning plz
Devendra
Real time message frameworks
DJHM
In the template, the {{ form.as_p }} will render the form as a series of paragraphs, with the dropdown field rendered as a select box.
Make sure to include {% csrf_token %} in the form to protect against cross-site request forgery (CSRF) attacks.
AAYUSH
How can you add the data on many-to-many relationships model data on django.
Kiro
What is the best way to give different update "permissions" based on user role? Like, if a user has some role, he can only update an attribute, otherwise he can update another etc. Should I use multiple serializers? Or just use if in the cbv?
Kiro
Same doubt on reading. I have a serializer to an object that can be read from a model for both admins and normal users, but like for a user I want to hide some details
Berkan
In Django, I add to cart without page refresh, but when I scroll infinitely in django, why is the added data not added to the cart?
Berkan
Alexey
Berkan
Alexey
Kiro
Kiro
I'm learning Django and trying to make something that is both functional and "correct" at project level
Yuman
Guys can anyone help me?
Unknöwn
I keep getting errors when I try to connect django to Mysql Database.
I have installed the "mysqlclient" package.
but whenever I try to connect my project to Mysql using ( mysql -u root -p). I don't get a prompt to put in my password. I keep getting the error : "mysql is not recognized as an internal or external command".
I have tried using the same command in the command prompt and windows power shell, but I keep getting the same errors.
Any alternative way to go about it please?
Nfl
Shamnad
Unknöwn
Shamnad
Shamnad
A screenshot might help better
Unknöwn
Shamnad
windows
Download mysql from their official website. After installation you can confirm it by running, mysql --version
Unknöwn
I want to also ask if there is an alternative package needed to connect mysql database to Django
Firdaus
Praveen
Hey I'm facing issue with django
Praveen
Can any one help me
Iあぬやわ🖤🖤
Hey i hace question we can have two custom user
Praveen
Not able to send photos here
Praveen
I'm facing template syntax error in django
Praveen
Please help
Doragonsureiyā
Not able to send photos here
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
Yuman
I have a cart in my page site , aunthenticated users are able to update the but non aunthenticated user are not what might be the problem
عبد القيوم
Acquaintance
Guys
How can I add another class name in the for loop in the template for every second 'div'?
Acquaintance
Егор
Hi. For some reason, the files are not added to the "link" field. There is no such problem with other fields, does anyone know how to solve this problem? No errors are displayed. https://nekobin.com/nicotukuya
Anonymous
.@admin.register(Applicant)
class Applicants(CustomUserAdmin):
...
def vacancy_title(self, obj):
if obj.vacancy_title:
return obj.vacancy_title
return 'not applied any vacancy'
how to filter with vacancy_title in django admin
Aditi
After installing django ..make coding on visual studio..first django run but after changing in view it's show error .and didn't able to catch url of firstapp while i set all urls according video..plz guide
Aditi
I am beginner in django
Aditi
Today my first day
Plz help
Jamie
What is your error