Rohan
Make a limit on file upload
Maset
So host files on the server itself 🤷‍♂️
Well I'm using heroku for hosting
Maset
So I have been using GitHub as the project source
Rohan
But you want to upload files to your project source?
Rohan
That’s kinda.... weird
Maset
Just use imgur buddy
Is that a django module
Anonymous
Is that a django module
No its an image hosting website and they have an api
Anonymous
Use the api to upload images to imgur, store the link in your database
Maset
I will need about 1gb of media storage
Anonymous
Im pretty sure theres a package out there that will help you do this
Maset
I will need about 1gb of media storage
Will it provide me with that
Anonymous
You have to find that information on your own
Maset
You have to find that information on your own
Ok well thanks for the information
Tukhtamurod
Which framework is Best and Beneficial for making API :- Django vs Django Rest Framework
which one is best and beneficial for cooking: Kitchen or Stove
Sujit
any idea about this error?
any idea about this error?
😇ANGELO™️🎧
Could someone please share a pdf of the Django documentation
....
any idea about this error?
idea is that you might have installed one environment in the beginning and then tried another one, which was not specified in settings.py... IMHO... Try to open your project in Pycharm it handles such issues. Note: I am a beginner
Doragonsureiyā
Could someone please share a pdf of the Django documentation
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
Jay
With this one can use GitHub repo as s3
Tech
Could some one please tell me how to fetch data using "related_name"
Doragonsureiyā
Could some one please tell me how to fetch data using "related_name"
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
Anonymous
What django host plataform do you recommend, please?
Anonymous
mod_wsgi
Anonymous
I got hostgator but didn't work for me
Tukhtamurod
Could some one please tell me how to fetch data using "related_name"
class UserPhotos: user = models.ForeignKey(User, ... related_name="photos") created_date = ..... ..... then if you have user object, user.photos.all() gives you all photos of that particular user
Anonymous
Thank you Peter.
Zey
In views.py I should prefer class based view or function based?
cj
In views.py I should prefer class based view or function based?
it's up to you ¯\_(ツ)_/¯ nobody can force your preferences
Alexey
Hi all. Whitenoise is used with nginx or instead of nginx for serving static? I am using cookiecutter whith traefik as a reverse proxy. Should i configure Nginx behind Traefik for serving static in prod without CDN or it is enough to install and setup Whitenoise?
Anonymous
nah don't bother
Mirco
thx
!yw
Doragonsureiyā
thx
You're welcome! 😊
Place
Hello everyone, i am sorry to contact you but i have a question, i tried a lot of things but nothing is working so here is my problem : Well i am making a mobile app using flutter, and to make my admin panel i used django since it has a ready to use admin panel admin. I have 2 fields (start_date and finishing_date) juste some models.DateTimeField and would like to make a rule that will not allow the user to enter a finishing_date < start_date
Place
thanks in advance to everyone 😇
Anonymous
Is it a good idea to use django rest framework with flutter for an ecommerce app?
Place
Is it a good idea to use django rest framework with flutter for an ecommerce app?
for my personal case, i use django just for the django-admin, for my back-end i did a restful api with nodejs, its a school project !
Place
At that point, FastAPI could be a better choice for u
well i was about to ask a question, i think everyone just didn't saw it haha! But everything is working good i am asking about a thing in djang-admin, maybe i will ask again to be more clear haha I have in my django-admin app : 2 fields (start_date and finishing_date) with models.DateTimeField and would like to make a rule that will automise at the registry so it will not allow the user to enter register an instance if startdate_> finishing_date
Place
Just use the clean method
yes i tried to make a custom validator but i didn't do it correctly, maybe iam just a newbie but thats why i am asking haha
Mirco
yes i tried to make a custom validator but i didn't do it correctly, maybe iam just a newbie but thats why i am asking haha
And that's why I've answered u But without your code snippet it's impossible to tell u what's u've done wrong
Place
i can share it here in the chat or i must put it on a sendcode website kind ?
Doragonsureiyā
i can share it here in the chat or i must put it on a sendcode website kind ?
To share code or error tracebacks, be considerate and use an online pasting service - here is a list of suggested sites: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you post a wall of text message (many lines), delete it quick or you may get a warn strike.
Place
thank you i had in my memory that it must be something like that haha!
Place
https://del.dog/wingevylir
Mirco
https://del.dog/wingevylir
Totally wrong, this is not the use case of a validator
Place
ah! i knew i misunderstood the doc
Place
i tried to follow this example https://docs.djangoproject.com/en/3.1/ref/forms/validation/
Mirco
ah! i knew i misunderstood the doc
https://docs.djangoproject.com/en/3.1/ref/models/instances/#django.db.models.Model.clean
Place
https://docs.djangoproject.com/en/3.1/ref/models/instances/#django.db.models.Model.clean
ah and if self.ending_date < self.beginning_date i raise the error i want thats what you adviced me to do in the beginning? thank you so much for your answers !!
Place
otherway it will show a 500 error no? (just my intuition)
Place
oh i implemented it and its working, i understood what happen, its too beautiful, thank you so much for your answer!!!!
Place
Well i have another question, hope its not too much, if so i will delete my message asap, but since the help here made me win soo much time i will ask haha! My second problem is that i have 2 models for example : notification and event and would like that each time i create an event, a notification is created too with the same name that the event, is there any keyword to google to look how to do it by myself (i just don't know what to look for on google) thanks in advance to everyone for our help!!
Place
maybe you want to use: django signals (specifically the post_save signal)
Well i read all the doc i can, but i am a little bit confused about signals. if i understand correcty, i have to create a new file : "signals.py" where i have to define a function using the post_save method where i specify a "if created : ..." ?
Morteza
u pointed on me?
Place
and i have a question, to register something on django (to add it to the database) is it the "save" method?
Morteza
also you can create object into database directly like ModelName.objects.create(name=name, user=user) and so on