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
How to deploy Django to heroku
https://youtu.be/MoX36izzEWY
Anonymous
Thanks bro
Anonymous
Thanks
Fuad
Fuad
Thanks I will look into this
For example save this file in your project app as something.py, it uses to validate video files
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
Alex
Identity error at attemt_myuser.email.UNIQUE constraint failed in django project
I need my personal telepat to solve this, but it seems you are trying to add an email that already exists.
Ashutosh
I need my personal telepat to solve this, but it seems you are trying to add an email that already exists.
I have entered different emails too,data is storing but error is still there.
Alex
I have entered different emails too,data is storing but error is still there.
Then you have to provide full context on what you do
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 ?
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
Aswath
Model.clean
Can you elaborate
Alex
-_-
Aswath
https://hastebin.com/ajahenegew.py
Alex
https://docs.djangoproject.com/en/3.0/ref/models/instances/#django.db.models.Model.clean
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?
Muflone
hello. how can i cancel the migration?
It depends it was already applied or not
Nikhil
Delete the migrated files
But what about in production
Alex
But what about in production
Em, you should not make migrations in your production envirement.
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?
Nikhil
Em, you should not make migrations in your production envirement.
I'm confused actually I made a blacklisttoken model And makemigrations and then migrate it in my local but when I tried to migrate it in production then it didn't migrate and now it is showing me error
Alex
I have added sir
Then it means that somthing "magical" happend and I dont know what and how to help you
Nikhil
Then it means that somthing "magical" happend and I dont know what and how to help you
I don't know as I have never worked on deployment so I am checking if there anything I am missing btw thanks
Yash
I have a local sql file of my postgess database how do I replace the heroku database with this sql file?
Yash
that's not related to django
I was hosting django application though.
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)
cj
I was hosting django application though.
but your problem is not strictly related to django but database 🤷🏻‍♂
professor
sure, but for example if I want to have example.com , and I also want to do example.com/blog
Muflone
is possible to integrate 2 github pages jekyll into django? /main_site (ajax from external uri) /blog_site /app(external server)
It's not an integration, Jekyll produces a static website, simply serve the static website with your webserver
professor
sure, but I need two sites (static) within the same page , but how can I do this in jekyll/
Muflone
sure, but I need two sites (static) within the same page , but how can I do this in jekyll/
The web server will serve the two sites, it's not related to django
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
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?
Miguel
Django devoleper... Looking for freelance works
No, i'm looking for know what api doc tool do you use, recommendation