V
well the problem with sending json payload to the FormView based view.
V
js : https://pastebin.com/t9Ru0cXJ
V
views: https://pastebin.com/bmXGKLH1
hack:https://pastebin.com/PsRBkUWs
V
i am a newbee in django
Baggy ️️
Has anyone made upvote downvote on a post
Yash
How do I set the content type of file with can be of any format in django response?
Anonymous
How to deploy Django to heroku
Doragonsureiyā
How to deploy Django to heroku
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 firsts results
Fuad
Anonymous
Thanks bro
Anonymous
Thanks
Fuad
Fuad
Yash
Fuad
def validate_file_extension(value):
import os
from django.core.exceptions import ValidationError
ext = os.path.splitext(value.name)[1] # [0] returns path+filename
valid_extensions = ['.mp4' , '.mkv' , '.avi']
if not ext.lower() in valid_extensions:
raise ValidationError(u'Unsupported file extension.')
Yash
Okay thanks again!
Jose Luis
i need to run a task (in background) after click in a button from a view. is possible to use just a GET to run it, or is better to use a form and a POST?
Jose Luis
the task will take like 10 minutes to finish
cj
I'll use POST to trigger things using buttons from forms
cj
that way you'll have some kind of protection against unwanted GET actions 🤷🏻♂️ protecting your POST actions with the CSRF protection that Django has built-in
Jose Luis
Thanks cj
Ashutosh
Identity error at attemt_myuser.email.UNIQUE constraint failed in django project
Ashutosh
Alex
Aswath
Heyy folks doubt here
Aswath
i wanna set one of my fields for a model to a default value which is the value of an other field on the same model
Aswath
How do i do this ?
Alex
Aswath
class Room(models.Model):
wing = models.ForeignKey(Wing,on_delete=models.CASCADE)
number = models.CharField(max_length=5)
bed_count = models.IntegerField()
available_beds = models.IntegerField(default=bed_count,blank=True)
is_full = models.BooleanField(default=False)
Aswath
Here is the code
Alex
-_-
Aswath
https://hastebin.com/ajahenegew.py
Alex
https://docs.djangoproject.com/en/3.0/ref/models/instances/#django.db.models.Model.clean
Aswath
Aswath
Pls explain
Aswath
@alkalit
Aswath
🙏
Alex
Pls explain
I dont know how to say more than it states in the doc
This method should be used to provide custom model validation, and to modify attributes on your model if desired. For instance, you could use it to automatically provide a value for a field
i hate milk
hello.
how can i cancel the migration?
Junaid
i hate milk
thanks
Yash
How do I get the values of various single choices radio boxes in my view after form submission?
I mean like this.
How do I this without specifying unique "name" atrribute in every input field in html form since there can be 100's of questions?
Alex
You should just apply them. All testing and development should be done in your dev.
Aniket
I am trying to connect MySQL db with django project in virtual environment of python but I get an erroe while installing mysqlclient
Aniket
Any solution?
Muslim
Nikhil
Alex
Nikhil
Alex
I have added sir
Then it means that somthing "magical" happend and I dont know what and how to help you
Yash
I have a local sql file of my postgess database how do I replace the heroku database with this sql file?
cj
Itay
Yash
upload it with git
How do I populate the heroku database with my local sql file though?
Itay
Maybe upload a script that will sync the databases
professor
is possible to integrate 2 github pages jekyll into django?
/main_site (ajax from external uri)
/blog_site
/app(external server)
Muflone
Yash
professor
sure, but for example if I want to have example.com , and I also want to do example.com/blog
Muflone
professor
sure, but I need two sites (static) within the same page , but how can I do this in jekyll/
Muflone
Jimmy
Hello guys is it possible for me to use the mysql-connector for mysql connections instead of mysqlclient since I cant get to install it correctly
sheikh
How to learn about internals of django?
professor
Jimmy
Miguel
Hi guys, good night. Today I come to ask you a question type suggestion / help.
What documentation system for API's do you use, other than Postman or Swagger? If it is Open Source, much better. Whether especially for Python / Django / Flask, etc. Or in general. I would greatly appreciate your help.
Ansab
Django devoleper... Looking for freelance works
Anonymous
Hello Nice to meet you
I am a web full stack developer.
now I am looking for web dev projects. I have been developing on web full stack for over 7 ~ 8 years.
is there anyone who is looking for web developer?