The Inspired
if so, then you can do a if else template syntax
Riad
Yes
Yes, you just need to produce rest api from the backend and feed it to the frontend
Hamza
Hi I need to create api to download repository from GitHub How can do this ?
Hamza
Download by what?
By link of repos
Riad
By link of repos
In the backend? Or frontend?
Hamza
In the backend? Or frontend?
Backend with Django
Riad
Backend with Django
Read the code here. It uses a process to download github repo. You can follow the system to fetch url from frontend and provide to backend https://github.com/redwan-hossain/cydm/blob/main/cydm_updater.py
Hamza
Thanks a lot
so
Django-storages makes all that very easy if you haven't sorted the storage part out yet
hi again! I've figured out how to download a file, BUT I have to redirect to the Download page first and then download my file there. Can't figure out how to pass the parsed_file id to the parse view to download view and redirect to the different page at the same time 😭 Can you help me with that?
so
If anyone here knows that's possible, lmk how :D
so
So you want a user to click on a button, download file, then redirect to new view?
nah, the user uploads a file, then I parse it and redirect user to 'You can download your changed (parsed) file', where they can download it. My logic was that upload and parsing and redirecting happens in one view, then the download happens in a different view. Afaik I have to connect these two views so the download_view could get the newly created file id, but I can't (apparently) redirect to both another view and a new page in one view..
Tanner
nah, the user uploads a file, then I parse it and redirect user to 'You can download your changed (parsed) file', where they can download it. My logic was that upload and parsing and redirecting happens in one view, then the download happens in a different view. Afaik I have to connect these two views so the download_view could get the newly created file id, but I can't (apparently) redirect to both another view and a new page in one view..
I think what you're saying makes sense - just one view at a time. 1. User submits file in form - with your get_success_url or however you are redirecting them there, send them to a download page with the new file's id in the url kwargs. 2. Grab that out of the kwargs and use it in get_context_data. 3. Create download url in template with the id in context
Tanner
4. They click on your new url to actually download the file from the "your file is ready page"
After you save the file, you can use that model instance's id in get_success_url or whatever to set up the next couple things
FOR YOU
Hi guys, can you tell me about jwt authorisation in drf. I can use for_user method which create access token or refresh token. I don’t understand, how to create that every api call(other) will check this token? Help, please!! Maybe I should write something in settings? Help
Kirime
How I can upload photos in models
You can't do it. You mast create media settings in setting.py and urls.py same as for static files . Files will be saved to directory /media. Models (FileField) will be contain path to media file in the media directory
John
Hey can someone please fix me cors error in Django
Doragonsureiyā
Hey can someone please fix me cors error in Django
No one can help you until you explain your difficulties.
John
Iam running frontend on same pc different port
John
Whenever I make a get request it shoots a cors orgin error
Cheshtaaaaaaa
While extending the user model
Cheshtaaaaaaa
I m getting some errors
𝙰𝚜𝚑𝚠𝚒𝚗
I m getting some errors
What's the error
Hojat
While extending the user model
I think you did the first migrations before using AbstractUser which is wrong.
Hana
What is django?
Maxim
What is django?
what is google?
|-|●$€!|/|
How I can upload photos in models
So easy , Add ImageField() to your model , And create a directory and url in setting.py -> MEDIA_ROOT = BASE_DIR / "media" (name is up to you ) MEDIA_URL = "/media/" Then add images in admin panel and automaticly will be saved in a folder named media
ask
How to implement custom validation on django's UserCreationForm, I want to implement some validation on email id while user registers.
Nasib
hello everyone
Nasib
I need recaptcha input type
Nasib
in html
Viki
How can i host my django application in godaddy
Viki
Can you help me anyone
Viki
I am stuck with this problem
Денис
Host on your own server
adelshievvv
Hello everyone! I'm doing a Django project with the MongoDB database (djongo) I met with such a problem that in the admin panel I cannot create an object that has a foreign key in one of the parameters For example I have an Album model And to create it, I have one of the parameters is the foreign key "Artist", whose data I take from the Artist model And when I select an artist from there and click save A database error is coming out I can't figure out what the error is, can you help please?
ask
How to extract text from scanned or image pdf files in python???
F
Hi all. Anyone will tell me, can i use django last version to connect to oracle db 12.1.0.2?
F
Is possible or not?
ask
you can use pytesseract library
getting error, "Something is wrong..." what should I do?
developer
did you install this library?
developer
until now I have never seen that error ..☹️
developer
could I face your own code plz?
ask
until now I have never seen that error ..☹️
I'm getting an os error: OSError: exception: access violation writing 0x0000000000000008
Smile
Hello I am working with DRF. How to make lookup_field case insensitive? i tried two options: lookup_field = 'title_iexact' lookup_url_kwarg = 'title' both don't work. What am I doing wrong?
Louay
How long does it take to learn django enough so that one can land a job?
Maxim
How long does it take to learn django enough so that one can land a job?
your question makes no sense billions of people have jobs and know nothing about Django
Louay
Basically how do i know that I've learned enough
Maxim
I mean a job as in a django backend developer
your question doesn't even make sense different employers have different requirements different people need different time to learn something to the same level
Maxim
Good point. How long did it take you?
took what? i am not familiar enough with Django to get a job as a Django backend developer
Louay
took what? i am not familiar enough with Django to get a job as a Django backend developer
I feel very lost right now lol. I had the idea that this group was full of django developers that could help me since i just started.
Louay
you'll start getting answers the moment you stop asking pointless questions
I may be new here but you don't have to answer me if you don't want to
Maxim
I may be new here but you don't have to answer me if you don't want to
i wouldn't be answering your questions if i didn't know they would be the best answers
Louay
Hmmm
Confident
i need someone who know how can i create a new app
Doragonsureiyā
i need someone who know how can i create a new app
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Axadjon
Yury
Hello everyone, how can i do smth like this: {% include “app/card-{{ some_specificator }}.html” %} inside template?
Confident
i have a problem with django anyone here can help me
Doragonsureiyā
i have a problem with django anyone here can help me
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Heigler Rocha
Hello everyone, how can i do smth like this: {% include “app/card-{{ some_specificator }}.html” %} inside template?
You can use the "add" filter for concat: {% include "app-card-"|add:some_specificator|add:".html" %}