Anonymous
i should read docs
Anonymous
super is a function to access super class of the current class.
i have only one class, how super class is created?
Alex
i have only one class, how super class is created?
1 You always have your classes inherited from object 2 It's simply a good practice to call super when you expect your code to be used in a inheritance chain.
Inuk
wtf this means super().form_valid(form), especially super() ?
when called from a class inheriting from another class, it lets you call the other class' methods, useful in cases like this: class Thing: def __init__(self): self.a = 1 class SpecialThing(Thing): def __init__(self): super().__init__() self.b = 1000
Mr
How to host django web application any ideas guys
Eric
How to host django web application any ideas guys
Use Heroku (its free): https://devcenter.heroku.com/articles/deploying-python Or if you still qualify for the free tier on AWS use AWS free tier: https://aws.amazon.com/getting-started/hands-on/deploy-python-application/
Vxvek
Can any one suggest me best server for hosting python django.. multiple website
Coders Needed Eth
Or you can try to make it work on aws lambda
Alex
Nginx + gunicorn
I think he meant a platform.
Coders Needed Eth
Ow
Coders Needed Eth
I have used digital ocean but ionos is really dope
♈
Arpit Mali: I have issues in django, after model field data delete, on all references related data remove But after deleting old record another model how protected ?
Ashok
Can you please send any examples link of django+chart.js+MySQL database (dynamic data send to chart.js )
Doragonsureiyā
Can you please send any examples link of django+chart.js+MySQL database (dynamic data send to chart.js )
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box, write down the same words you asked here Step 4: Read the first results
♈
Set on delete attribute to PROTECT of that foreign key
I also try this but there show me protected error raise
♈
@pyflare when I try to field data
Mirco
I also try this but there show me protected error raise
That's the behaviour, you have to delete the parent before deleting the children with PROTECT
Mirco
It's up to you to handle that scenario
♈
@pyflare you are also right, but I'm try to delete my parent obj is exchange rate = 20 Then show me protected error child obj related
Mirco
use pastebin.org to share errors or code
S.Ponmalar
Dear Friends, I need one help. I want to implement the django syllabus to my students. Any one refer the syllabus or book? Thanks in advance.
Vipin
Anyone knows django restframe work please help me
J
What help you want in django rest api Vipin
Vipin
I wanna know about how to create xml ouputing api and....how that xml data use with html ???
J
Do you mean the output of api to be a xml file ??
Vipin
Yes
J
https://jpadilla.github.io/django-rest-framework-xml/
Vipin
Ok
Anurag
Anyone can tell me how i can Show data from mysql database in templetes using function views. I have already stored data in mysql database. I have to only display it on html
4candels support
TypeError at /regi send_mail() got an unexpected keyword argument 'fail_silently'
4candels support
my error, how i can solving it
Charly
my error, how i can solving it
it says you are passing an argument that is not expected, don't send it
J
@anurag_629 can u try like this by replacing the corresponding model name and html file name def itemget(request): data = CityInfo.objects.all() context={ 'data': data } return render(request, CityApp/infopage.html", context)
4candels support
it says you are passing an argument that is not expected, don't send it
I have a form with several information, including email for the customer, when registering the information, including the email, I want the user to receive an automatic welcome message on his email
J
You should have model
4candels support
just don't pass the fail_silently param to send_email
Would you allow me to send a photo to you to check it out?
J
If you don't want to create model, then write a query to fetch the data and then use the render function @anurag_629
4candels support
No
if i make it false, still does not work with same error
4candels support
don't thesnd the parameter
If I delete it, an error will appear telling me that the code is missing
J
That i want to ask. Please tell me how i write query??
https://docs.djangoproject.com/en/3.2/topics/db/sql/
J
That i want to ask. Please tell me how i write query??
https://stackoverflow.com/questions/5931586/raw-sql-queries-in-django-views
4candels support
show that error
send_mail() takes 1 positional argument but 4 were given
Charly
send_mail() takes 1 positional argument but 4 were given
you are sending bad parameters, show the code
Anurag
https://stackoverflow.com/questions/5931586/raw-sql-queries-in-django-views
Thanks bro, i forgot about cursor connection.🤩🤩🤣🤣
Aziz
Hi! I have a problem which is around a week makes me crazy 😱 So i have profile update view, Profile model and form. When i try to update profile, it says that profile photo doesn't exist in media root folder. And it's right! Because, i have set photo field's upload_to parameter to /profile_images/{username}/pic.jpg. why it looks for this in media root? I have some issues with internet on my pc, so I'm going to send .py files
4candels support
you are sending bad parameters, show the code
def regi (request): form = RegisterForm() if request.method == "POST": form = RegisterForm(request.POST, request.FILES) subject = "Your subject here" message = "Your message here" recipient = str(form["Email"].value ()) send_mail( subject, message, EMAIL_HOST_USER, [recipient], fail_silently = True ) context = {} return render(request, "regi.html", context) else: return render(request, "regi.html", {"form": form})
Charly
No
Charly
I asked a pretty specific question
4candels support
I asked a pretty specific question
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smpt.gmail.com' EMAIL_HOST_USER = '*****.com' EMAIL_HOST_PASSWORD = '******' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_USE_TSSL = False
4candels support
That's not what I asked
from django.core.mail import message, send_mail
4candels support
I have already defined it
Anonymous
I'm getting status code 403 when I'm trying to Post data to Django using axios. I added the CSRF token to the Post data but it's not working. What should I do?
ILYOSBEK
axios.post('/user', { firstName: 'Fred', lastName: 'Flintstone' }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); example reactjsdotcom
Anonymous
Still forbidden
Azizbek Xushnazarov
How can I add initial values to a bounded serializer My problem is that when I create a serializer I want to assign a value to a field of it after some calculation. serializer = TaskSerializer(data=request.data, initial={'field1':calculated_data}) but this does not help. Any ideas how to achieve this?
Roberto
Hello all, I'm trying to include a widget for selecting the date and time in a template I made with bootstrap. I searched on the internet but honestly I got lost among a thousand of packages, templates etc. Could you show me the best / simplest and cleanest way to follow? I am a neophyte with django and html, thus I'd like to learn something. Thanks
Vimal
Hey, friends! It's time to do mini projects in my college, for that I planned to do so real time problem solutions using django. The thing is😅 , kindly provide me some good mini projects using django !! With resources help me a lot ✌🏻 Thanks in advance !!
𝗣𝗿𝗲𝗺𝗶𝘂𝗺𝗸𝗲𝘁
کسی هست باهم بخریم؟؟
chappa
Hey guys.. Kinda need some help. Why is it that when is use {{form}} tag in the template it saves the form but once I separate the fields ie {{form. Tittle}} it doesn't?
Harish
Please help on this. https://dpaste.org/U5HE#
Oleg
Guys, could you please point this out... What is the best practice in DRF should be if I wanna remove some m2m objects from base model object. Should I just be satisfied with update method (patch) in serializers (and orm m2m method "set" to reset and install all data values from scratch from list) when I use obj.m2m.set(*[list_values]) OR should I implement a remove method (delete) to remove specific values (and orm m2m method "remove" to remove specified in list objects) when I use obj.m2m.remove(*[list_of_values])? https://stackoverflow.com/questions/69276071/what-is-best-practice-to-remove-values-in-m2m-relation-in-drf