Ashok kumar
Hi ,I want to learn django can you share videos anybody here
Kashif
Can Anyone tell me which will be more better with Django backend Dreamweaver vs Bootstrap Studio?
Abasie
Hi ,I want to learn django can you share videos anybody here
Search coding for entrepreneurs on YouTube he has great Django content
Ammar
hey i am trying to annotate a forgein key and serialize it how ever i am getting this error Got AttributeError when attempting to get a value for field `brand_name` on serializer `MedicineListSerializer`. The serializer field might be named incorrectly and not match any attribute or key on the `int` instance. Original exception text was: 'int' object has no attribute 'brand_name'. this is the code can some one help https://dpaste.org/ENzsU/slim
any chance some one know how to fix this What i am traying to do is that i have a model that have two foreign key for the same model ( medicine ) so when i put them togather thats mean they have the same effect the problem is this is some data that might be found in the database Collumn 1 | Collumn 2 Med1_id: 1 | Med2_id: 2 Med1_id: 3 | Med2_id : 1 Med1_id: 5 | Med2_id : 6 .... Or in reverse so i want of user want to find medicine 1 equals to show 2 and 3 I tryeid to annotate the field with the code from previous result it gives the right ids that i want but there is a problem in serializing ( feels like django cant figure out its a medicine foregin key ) What can i do
Dlight
You got an answer and ignored it
Which one ???? ! There was a mate kindly sent me a private message but that didn't work
Dlight
https://t.me/django/251887
This is not the solution. Just a general answer .
Charly
This is not the solution. Just a general answer .
He told you to build a custom form with the desired fields and you just showed you created a model form without any modifications
Charly
CustomForm
You keep ignoring the point, which is create a custom for with the fields you want not the full model fields
Dlight
You keep ignoring the point, which is create a custom for with the fields you want not the full model fields
Bro what are u talking about. Do you read the question. I know what is custom field ..When extend AbstractUser , u will have Password .
Dlight
A custom form with only the email Field! What's hard about understanding that?
This is my customform Class CustomUserCreationForm(UsetCreationform): Class Meta:   Model :CustomUser   Field =email Model has the emailfeild .
Dlight
That's not even valid python
My man ! It's clear you have not worked with Django. Thanks for help anyway.
Dlight
Dude, explain the 3rd line then Mr expert
from django.contrib.auth.forms import UserCreationForm from .models import CustomUser from django import forms class CustomUserCreationForm(UserCreationForm):     class Meta:         model = CustomUser         fields = ["email"]     def init(self, *args, **kwargs):         super(CustomUserCreationForm, self).init(*args, **kwargs)         del self.fields["password1"]         del self.fields["password2"]     def clean(self):         cleaned_data = super().clean()         password1 = self.cleaned_data.get("password1")         password2 = self.cleaned_data.get("password2")         if password1 and password2 and password1 != password2:             raise forms.ValidationError("Passwords do not match.")         return cleaned_data     def save(self, commit=True):         user = super().save(commit=False)         user.set_password(self.cleaned_data["password1"])         if commit:             user.save()         return user
Dlight
Dude, explain the 3rd line then Mr expert
That's just typo😐😐. I copy and pasted my code so know there is no typo
Dlight
I asked in Stackoverflow but no reply. Thought maybe there is senior in this group can guide.
Jimmies San
ask chatgpt
Charly
That's just typo😐😐. I copy and pasted my code so know there is no typo
Thats the point dude, the typo makes it invalid and the full code was necessary
Dlight
ask chatgpt
Already done . It basically same answer.
Jimmies San
I asked chatgpt and it said it's ok
Jimmies San
cannot see that rule in the group rules tho 🤔
Charly
from django.contrib.auth.forms import UserCreationForm from .models import CustomUser from django import forms class CustomUserCreationForm(UserCreationForm):     class Meta:         model = CustomUser         fields = ["email"]     def init(self, *args, **kwargs):         super(CustomUserCreationForm, self).init(*args, **kwargs)         del self.fields["password1"]         del self.fields["password2"]     def clean(self):         cleaned_data = super().clean()         password1 = self.cleaned_data.get("password1")         password2 = self.cleaned_data.get("password2")         if password1 and password2 and password1 != password2:             raise forms.ValidationError("Passwords do not match.")         return cleaned_data     def save(self, commit=True):         user = super().save(commit=False)         user.set_password(self.cleaned_data["password1"])         if commit:             user.save()         return user
The save method is setting a password which is not required and I see no code.to send email validation
ashu
Hii everyone i have some doubt i clone a website from c panel and try to run in my vs code but when i give python manage.py runserver they show the No DATABASE _URL environment variable set, and so no database setup
Charly
ashu
Can you give some extra information like how I use
Maxim
Can you give some extra information like how I use
create .env file add line DATABASE_URL=<value> to the file for ex. DATABASE_URL=jdbc:mysql://myhost1:3306,myhost2:3307/db_name
Jamie
TokenVerifyView is used to verify access token or to verify both refresh and access token?
Shahzodbek
where can i get some examples of django channels ?
Rathish
I already created a e-commerce website,if I need to add staff(admin or employee )and merchant(supplier) ,can I use the same login form from customer or need to create a new for the two
Tumelo
Good morning Family i have an API(Fastapi) its connected to my database , but i cant connect the api to my website and also if anyone knows how to deploy the django proect please assist
Charly
Good morning Family i have an API(Fastapi) its connected to my database , but i cant connect the api to my website and also if anyone knows how to deploy the django proect please assist
FastAPI has nothing to do in this group. Regarding deployment manually of Django it depends on what kind of server you have, there are tons of guides on Google.
Shahzodbek
Maybe start by googling?
You think I didn't?. I know why I am writing here
Charly
You think I didn't?. I know why I am writing here
And what's the issue with the examples found on Google?
Shahzodbek
And what's the issue with the examples found on Google?
They just don't work. I need to use websocket when my model changes
Charly
ashu
Hey everyone when I run the command of python manage.py runserver my machine is showing the can't connect to MySQL server on 'locolhost'([WinError 10061] No connection could be made because the target machine actively refused it
Neha P
Hii.guys I need a help to create shelf using django
Charly
Kashif
No one works with Django templates
yeah I know for that We need to edit from scratch but I am talking about designing part for frontend
Amin
for mathjax https://algorithmshub.uz/posts/post/f811f689-3aa6-49f4-8f6e-672a0922f7cc/
Thanks But i want to copy equations from word Not latex Can i do this?
Shreya
Heyy guys I’ve an internship project deadline tomorrow to make a django project with deadlines and another project using django netmiko pyATs and textFSm. Can Y’ll please help me !!
Doragonsureiyā
Heyy guys I’ve an internship project deadline tomorrow to make a django project with deadlines and another project using django netmiko pyATs and textFSm. Can Y’ll please help me !!
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Adnan
Is it ok to share my django project here ? it is open source of course!
Shivanshu Sahu
I am making an website by django , adding crypto payment gateway in it
Doragonsureiyā
I am making an website by django , adding crypto payment gateway in it
No one can help you until you explain your difficulties.
Adnan
share what for?
for people can clone it and use it and give me feedback about
Shreya
No one can help you until you explain your difficulties.
I’m facing difficulties to make a my django dashboard I’m not able to find the right html files And can we make django projects using netmiko and pyATs?
Sandeep
I have created a dashboard project and created a login id will be stored in the postgre sql now who ever login his name should be displayed on the dashboard
Shreya
Can you send the link or smthing ?!
Sandeep
Not having
Shreya
Fine can u help me on this ? I’m not able to find the index.html files from bootstrap..
Please how do I handle media files in production
Muflone
Please how do I handle media files in production
read the previous messages with the tag #static
Muflone
I'm not getting them
what you're not getting?
Muflone
then your webserver is not setup properly
kiash
for people can clone it and use it and give me feedback about
Use ngrok and share a live server we see from there
Faeze
HI I have a data picker in my Django project: due_date = JalaliDateFIled() I don't Know how to ue it coreectly in html code, Any experience??
Faeze
What is a JalaliDateField?
I use it for solar Calender in model
Muflone
I use it for solar Calender in model
This doesn't seem to offer any datepicker What picker are you using? Oh nm, I found it in another package There's an example using form