Sir
How to add request.FILES in CreateView?
αмiʀ⁦⁦⁦⁦
I think you should create a mixin
Sir
Really? Just, a man said me i should make init and add there request.FILES, but i don't know how to make it...
Sir
Do you know how to make it?
Sir
Help me(((
Enes
Help me(((
use function based views
Sir
It isn't the best idea...(for me)
Sai Kumar
https://stackoverflow.com/questions/71275309/how-to-install-pillow-on-namecheap-server
Raul
What's ur mean?
for example, I have several models that correspond to lab techniques, if my users decide to add a new technique, give them that possibility, generating a new model in my database
Raul
A model builder
Raul
Yes
Enes
It isn't the best idea...(for me)
I don't know then bro. You can take a look to the github repositories about that. But if you ask me there is no any problem to use function based views. At the end you will use a function in your class based view to solve your problem.
Anonymous
I need help
Anonymous
now l am building news blog news post are shown at article list I am going to show at home page also give some advice to show one view at two templates
Dmitriy
Hi, if I want to create for example a parser, where should i put all the code. It seems that Views were not made for this. I've tried using management/command but cannot return results from call_command into Views, it only prints into console. stdout doesn't work for me. What is the best practice for this?
Doragonsureiyā
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
Sir
I looked request.POST, but there weren't my images fields((
Enes
i remember now you need to use request.FILES to get the image and other files
Enes
def upload(request): if request.method == 'POST': form = UploadForm(request.POST, request.FILES) if form.is_valid(): upload = Upload() upload.timestamp = datetime.datetime.now() save_instance(form, upload)
Sir
i remember now you need to use request.FILES to get the image and other files
So, there are in request.FILES them also weren't
Enes
if you didn't add please add this <form action="" method="POST" enctype="multipart/form-data">
Enes
I used enctype, but it didn't work
https://stackoverflow.com/questions/43835128/cant-upload-image-in-django
Enes
look at to the first answer
Sir
look at to the first answer
I looked, i'll try, but then. Thank you)
Xeno
Help me!
It's a dict now, so just do sum(dict.values())
Xeno
Should work
Fredy
It's a dict now, so just do sum(dict.values())
Thank you, I'm going to run it...
hm
can't display images after uploading from admin
Doragonsureiyā
can't display images after uploading from admin
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
Enes
add this to your urls.py urlpatterns = [ path() ]+static (static(settings.static_url))
Thorka
Anyone familiar with dataclasses and could help me on this problem? https://dpaste.org/BSQi
Doragonsureiyā
Anyone familiar with dataclasses and could help me on this problem? https://dpaste.org/BSQi
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Ehsan
Hello . I have a question . Must I learn js for programming django ?
cj
Hello . I have a question . Must I learn js for programming django ?
no but it would help you a lot if you get your hands dirty in the frontend thing
Fredy
It's a dict now, so just do sum(dict.values())
It worked thanks... I need to add 10 columns, is there an optimal way to add columns? I am currently doing. Load.objects.filter(title='Python').aggregate(Sum('hours__hour_1'), Sum('hours__hour_2'), ... , Sum('hours__hour_10')) What is the best way to add rows.
Shazeb
can someone help me with this? i'm getting error
Shazeb
RuntimeError: Model class gumroadclone.products.models.Product doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Dev__master
@Shazebh Add your created app name in installed apps section in settings.py
Shazeb
I'm getting duplicate error
Shazeb
@Dev_120399
Shazeb
django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: products
Dev__master
Please check this once @Shazebh https://stackoverflow.com/questions/24319558/how-to-resolve-django-core-exceptions-improperlyconfigured-application-labels
Zdravo
Hello all! I am making a django rest API for a platform app where multiple services can be availed by its users like plumber, electrician, mechanic, etc. And these services will be provided by different vendors who will get registered to that app as a service provider My question is, what is the best approach? Should i use separate django apps for every service? (one for plumbing, ome for electrician,...) Or a single app named service with multiple models named plumber, electrician, etc.
Xeno
It worked thanks... I need to add 10 columns, is there an optimal way to add columns? I am currently doing. Load.objects.filter(title='Python').aggregate(Sum('hours__hour_1'), Sum('hours__hour_2'), ... , Sum('hours__hour_10')) What is the best way to add rows.
One simple trick that you can do is put a breakpoint after your operation, see the type of your variable, print the dir(var) and then you will be able to see all the methods that can you can apple
Xeno
*Apply
Jamil
Hey guys, do you guys know any swift and django tutorials? There seem to be so few..
Jamil
I am asking if anyone knows any tutorials where the frontend is built with swift and the backend is built with DRF.. so it does have to do with django..
Jamil
Because I can only find very few
Fredy
What has swift to do with Django?
For you it's all about Django... I suggest you skip questions.
Charly
I am asking if anyone knows any tutorials where the frontend is built with swift and the backend is built with DRF.. so it does have to do with django..
No it doesn't, the frontend don't care about what the backend is, nor the backend care about the frontend, so you don't need an specific tutorial use DRF then search for any tutorial to consume any kind of REST service, the backend language doesn't matter at all
Fredy
This group is all about Django
They are asking about Django... Your comments say it has nothing to do with Django...
Jamil
That’s my point, I am asking about django, but this guy seems to strictly only want every little word in the text to be about django
Fredy
If you don't know, skip the question and you're done... I'm tired of seeing that answer from you...
Charly
They are asking about Django... Your comments say it has nothing to do with Django...
Swift has nothing to do with python, and I'm not asking, please follow the rules
Charly
If you don't know, skip the question and you're done... I'm tired of seeing that answer from you...
Then leave the group because I need to make sure people follow the rules as an admin.
Fredy
Then leave the group because I need to make sure people follow the rules as an admin.
However you want, for me it should be more flexible, because we turn to a group for help... Greeting...
Д
However you want, for me it should be more flexible, because we turn to a group for help... Greeting...
We are here to problem solve. That requires the most rigorous possible approach. Mixing up 100% unrelated frontend programming languages with backend technologies specifically when Django is capable of producing templated responses does not help.
Д
The whole question is random. It's like asking "Where can I find a tutorial that teaches Spanish but also has pancake recipes??"
Morteza
Because I can only find very few
you should learn them seperately first you should learn how to make rest api endpoints using DRF then how to make call to the endpoints using swift and show the data on the frontend. so yes your question is not related to django if you have issue using DRF we are here to help eachother
Neeraj
Like this add this to your urls.py urlpatterns = [ path() ]+static (static(settings.static_url))