MATHI
How to pass image to drf api
ERMIA
How to pass image to drf api
Using formData object const form = new FormData() form.append(key, file_object) file object is usually event.target.files[0]
MATHI
Using formData object const form = new FormData() form.append(key, file_object) file object is usually event.target.files[0]
I want pass username, password, profileImage to drf api. It's possible with use of FormData Object
ERMIA
I want pass username, password, profileImage to drf api. It's possible with use of FormData Object
Yes, u can easily pass like this: form.append("username", "john")
ERMIA
I want pass username, password, profileImage to drf api. It's possible with use of FormData Object
Drf will automaticly convert app input data in same object( request.data)
ERMIA
Mahdi
U can use microservice, Or use sync/async code
Thanks I'm gonna search for it
Mahdi
Yep, sure But the thing is i don't want user to wait again till the file is going to the api and getting response let's say i wanna do it in background like 10 mins later even when user not here. And the next time user checked his status, I'll show the response and other things ..
Lalit
My static file is outside of the django project. How to use
Alex
My static file is outside of the django project. How to use
like they are in another folder or server?
Lalit
Another folder
Alex
well, then define it in settings
Caleb
Yep, sure But the thing is i don't want user to wait again till the file is going to the api and getting response let's say i wanna do it in background like 10 mins later even when user not here. And the next time user checked his status, I'll show the response and other things ..
U can have a boolean flag and based on that flag u can have a state on the frontend that says something like not processed or proccessed, and when you have finished your background work u can make the boolean flag true to show the user that the process has finished
Lalit
I want to use it on deployment
Kumar
What we call {{ }} Tag in django
Amit
What we call {{ }} Tag in django
Open varible and close variable
Kumar
{%%} is template tag
Amit
{%%} is template tag
It is a open block and close block
Kumar
There is no particular name right
Kumar
Just open and close block
Amit
{%%} is template tag
It is used for passing tags and filters like for loop if statement etc
Amit
What we call {{ }} Tag in django
It is used to pass the variable
Muflone
What we call {{ }} Tag in django
https://docs.djangoproject.com/en/4.2/topics/templates/
Rahat
Please tell me i created swagger api and I have a lagre data when upload data to slow api run how to do fast swagger api
Caleb
Exactly and that is the idea. The thing that i'm looking for is the term to do things in background. The issue is about that
Use an async function to do what you want in the background, can i ask what you want to do??
Mahdi
Use an async function to do what you want in the background, can i ask what you want to do??
Thanks, the async was the answer to my question and i'm reading about it right now. And yea, I'm getting a video of user and send it to an api that makes a 3d model out of that video. And after all, User will have access to the 3d model through Augmented reality.
切腹
Hi, I have a rather specific question. I have a bot that creates tables for each store. How can I dynamically create models for the newly created tables? The tables correspond strictly to the template and differ only in the name. These new tables I want to output in Django admin panel.
切腹
Or how can I solve it?
Asukhan
Hey, can anyone recommend me some tutorial, which explains how to create an authorization and registration pages etc with django? thx in advance
9830805fd794d3b8cbee22fe898fefb7
Hi all. I have a question about using GinIndex for Django2.2 postgres11.8. I have a queryset.filter(field__contains='value') query for table which contains >18m records. And there is an index in indexes = [GinIndex(fields=['field']), ...] for that model, but queryset.explain shows only Filter: ((field)::text ~~ '%value%'::text)) without any Index Scan or Index Cond. Do I use it improperly? The field is a CharField.
Yeganeh
Hi I have django app as server and react js as client I want send data to client with SSE(server sent event) by django-event-stream package but react can’t listen to my channel and i get 301 error message while i just use send event function when a new post added: send-event(my channel name, data) Any body know what’s the problem?
Anonymous
Send payload
Demsy
Good day.. I've been trying to fix a bug in my code
Demsy
AttributeError
Charly
AttributeError
Thats not enough information to help you
Muflone
🔮
..
I have a problem with linking between my CSS and my HTML
..
Any tips plz
Doragonsureiyā
Any tips plz
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
ramaalicoder
I have a problem with linking between my CSS and my HTML
The best way to link css file into html is by using link tag .You can place it into the header section . Example: <link href="style.css" >
..
THIS IS THE HTML CODE
..
IT WORKS BUT THE CSS DOES NOT WORK FOR ME
..
do i have to install a package
..
to link between css and html
ramaalicoder
IT WORKS BUT THE CSS DOES NOT WORK FOR ME
The problem caused by css file path don't include C:\ in your path .You have to copy your path correct.
..
i tried without C:\ it does not work
ARS
i tried without C:\ it does not work
Are you using it with Django? Or pure HTML?
..
with django
Anonymous
if you need more info on raw api,
Charly
to link between css and html
where are you putting your files? whats are the settings for static files?
Caesar
Hello everyone. I have non-standart question for you guys who already coding for about 2+ years. In the beginning of my coding journey especially django, drf, python etc i was hungry for knowledge and wanted to grow up but now i don't feel the same. How to get this feeling again? Maybe someone already passed this wall and have some suggestions for those people who have struggle with that. Would be great if somebody could share with their experience.
ㅤ
Hey guys, i have few doubts. Consider this as a learner doubt. I was creating 2 custom users with 'AbstractUser' then it successfully migrated. So i tried to createsuperuser then i have given normal required fields for creating super user on terminal, then it says some Fields from my user Model can't be empty 😕 Actually i was creating an app with 2- different custom users Such as teacher & student, So both of them can login/signup differently including my custom fields. Can anyone suggest me any link/url to refer such kind of creating custom user for this kind of situation might be helpful. I hope, u guys understand what I'm about doing 😊 Thanks in advance.
Duong Chan Troi
Is it possible to use a django with a frontend framework without api?
Duong Chan Troi
cj
How?
that's another totally different question
Duong Chan Troi
😐
cj
😐
basically you render the templates passing to it the values you want from the backend in the context, and grab them using a javascript code block, so you can use them with your frontend framework in whatever way you want... but I'll say that something you shouldn't do, if you can use APIs, then use them
Mario
Hi, I'm new to Django, but I have over 30 years of experience developing websites. My question is regarding the configuration of a VPS, what would be the best option? I work with Ubuntu, I have read that Gunicorn + nginx is a configuration, there is also Apache + mod_wsgi, for a system that will have medium traffic (1000 queries per hour on average), which is the best?
Mario
the best for what, exactly
Handled the production environment
cj
Handled the production environment
Nginx+Gunicorn should be your first option, using Apache+mod_wsgi will give you some headaches