Maxim
but still bring error
be careful with the case of letters
Anonymous
from django.http import HttpResponse
You probably misspelled it in your code
Anonymous
Post your error occurred
Denes
initially i write httpResponse but then i changed it
Denes
name 'httpResponse' is not defined
Denes
i changed it but still bring error
Maxim
you should restart Django
Denes
means to restart server. isnt it?
Maxim
means to restart server. isnt it?
no need to reboot the entire server
Вячеслав
DRF question I have such endpoint POST: applicants/<int:applicant_id>/tags/ What is the best way to pass applicant_id parameter from url to serializer that will create tag for this person? UPD: Override get_serializer_context() on your view and pass parameter from self.kwargs https://www.austingrandt.com/writing/how-to-pass-query-parameters-to-serializers-in-django-rest-framework-drf/
Julius
hello! guys, how do i properly localize TextChoices model to filter it with django rest? model is like this now: ``` class Sample(models.TextChoices): USER = 'user', gettext_lazy('User') ``` i can get localized value when calling api, but i cant get reverse result when i filter some foreign lang value am i wrong trying to use generated locales with DRF? should i use smth like django-modeltranslations instead?
Pench
Hi Team, I am new to Django, Need your help guys. How to connect databricks delta tables using django..please help me on this.
Vlad
Hi Everyone, can tell me how I can write script Alert when i redirect page class ArticleUpdateView( LoginRequiredMixin, UpdateView): model = Article fields = ("title", "body",) template_name = "article_edit.html" def get(self, request, *args, **kwargs): obj = self.get_object() if obj.author != self.request.user: return redirect('article_list')
kiran
I created a login and create unique constrain for phone number and then i deleted user with mobile number but now i cant create the data with same phone number
kiran
If i created a user with the phone number i can't reenter the phone number even if i deleted that object
Vlad
You can check Django messages
Thanks, will check it
kiran
Share your models code for that object
https://nekobin.com/foqopiqoyu
.
https://nekobin.com/foqopiqoyu
Perhaps you can check if you implemented a soft delete or sentinel user on deletion for the user model. Other than that I have no idea.
Patrick
I am using django channels in my windows laptop, I had to use daphane because redis now don't have windows support IG. On my ubuntu server I can't run channels. Unable to shake hand! Anyone have any documentation for server setup with django channels?
Charly
creates an Article Object
Rohan
How can we show product images according to colour of product when user clicks on colour?
mohammed
Deployed project on pythonanywhere it's generated PDF file then download but this file does not contain the design or static files
Charly
Any help?!
No, we dont have enough details to help you
mohammed
No, we dont have enough details to help you
Can you suggest me a good course that teaches me that
Charly
Yes
I dont think there is such thing
mohammed
Ok thanks 👍
Charly
Yous give more details, like how are you generating your PDFs, why a PDF should have static files and what do youmean by de design
Charly
Show some code, anything that can be used to help you
banditEric
Hi All apart from celery which other schedule task can I use
Charly
Hi All apart from celery which other schedule task can I use
Why do you need an option? Dramatiq, Huey or RQ seems to be good options. In my case I had many issues with celery (but these are not common to most people) and I endedn changing it to a custom worker solution using SQS
S
Hi … how to solve KEYERROR in django sessions
Charly
Hi … how to solve KEYERROR in django sessions
Imposible to know without the exact code and error
Mikias
Hey guy's how you doing... I'm a fresh back-end developer and i would like to do projects using django framework...so i need your advice
Nil
Expectation value : bootstrap 4/uni_form.html
Nil
How t solve this
Mikias
No one can help you until you explain your difficulties.
Okay like where to start or what to know first
Doragonsureiyā
Okay like where to start or what to know first
Check out PythonRes, a channel for Python resources - video courses, pdf books, tutorials and other info to help you learn Python.
Doragonsureiyā
Okay like where to start or what to know first
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Mikias
Thanks
Роман
Hey, guys! Can anyone explain why Docker hub recommends use of python image instead of django? On the django page (https://hub.docker.com/_/django) it is described as "deprecated"
Siddharth
hey, i have made a website where everyone can upload and download the custom roms and all, but now I stuck in a problem that, i used unique attribute in the models but then also if anyone upload the same data more then once, it is shown in the models, please suggest me how to overcome this problem. thank you
EFK$$$
Hello who can send me best PDF for django
Doragonsureiyā
Hello who can send me best PDF for django
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Vlad
Hi, how can I 'divide' one Serializer into two parts(POST)? i want to have a serializer like: 'attributes': { 'type': '...' ...... ...... }, 'relationships': { 'cpu': '.....' } I think I should create a writable ModelFieldSerializer, but i dont know, how can i do this thanks
Bandar
Hi I'm trying to connect django to mysql I already configure database I already installed mysqlclient venv is fine but when when runing python migrate I encounter "version_info, _mysql.version_info, _mysql.file"
Bandar
any can help I have been trying to fix it for 2 hours 😂 I'm giving up
Bandar
import MySQLdb as Database File "****django-database/myvevn/lib/python3.11/site-packages/MySQLdb/__init__.py", line 24, in <module> version_info, _mysql.version_info, _mysql.file ^^^^^^ NameError: name '_mysql' is not defined
Bandar
Oh okay will try thank so much
Bandar
I’m running Darwin does it matter ?
Bandar
I did brew install mysql-connector-c did not work
Charly
also, darwin is not an OS
Bandar
yes sir
Charly
yes sir
https://forum.codewithmosh.com/t/nameerror-name-mysql-is-not-defined-mac-m1/13358
Bandar
I think I already try this yesterday let me check
Charly
Another article: https://forum.codewithmosh.com/t/django-my-solution-on-issue-mysql-is-not-defined-in-lesson-9-of-the-setting-up-the-database-section/5804
Bandar
yesterday I did "export PATH=$PATH:/usr/local/mysql/bin"
Bandar
wohow hahaha
Bandar
you are legend
Bandar
worked