Arun
cool will use that
Arun
it goes to if and then else . so the else result is in page.
Arun
i just want to go if alone
entropy
whaaat? how? hahaha
entropy
maybe the Client.objects.get(id=request.GET.get("id")) == Client.objects.all()[0]?
entropy
so it looks like it goes to the else branch
Mirco
Anonymous
I am creating a web application...I want multiple users to use the application....and want to maintain different memory for each and every user....can anyone tell how to do this in Django?
R
Anonymous
I created a tool and deploying on server
Anonymous
I created web application for single user
Anonymous
I want other users as well to use the application
Anonymous
But the memory I am maintaining behind for my tool should be different for each user so that I can divide work and give to each user and get the benefits
entropy
create a login functionality for your web app. hihi
Anonymous
After login?
Anonymous
Like Instagram your images will be specific to your account....I want same functionality
Anonymous
Yeah
Anonymous
I am configuring my tool with django app
R
You can just make a web app for multiple users and when a user request to run the tool, launch it with celery or django-q on background
Anonymous
My tool is to process documents
Anonymous
I want to divide work between multiple users to do
R
Additionally, if the tool ur users should launch is a python script you could look at https://github.com/wooey/Wooey/blob/master/README.md which is a UI for allowing users to run python scripts built with django and celery on background
Anonymous
And tool is using static folders....when user sign-up should I create a seperate environment for each?
Anonymous
It is taking data from a input folder
Anonymous
And giving output in separate folder
Anonymous
These folders should be different for each user
Anonymous
Then I will have to create separate environment for each user and redirect them to respective environment?
R
Hm, you could just store the input directory and output directory that each user should have access lets say by extending the user model or creating a userprofile
Anonymous
How can I manage path in this?
Anonymous
My tool should dynamically create new path for each user and configure itself....my tool as well in python and it is using custom modules
R
Then, you have multiple approaches depending on ur use case, but when user wants to see all files in output directory you could just read them from the filesystem based on his output directory and display them/allow download or you could for example store each file path in some model of ur choice and them retrieve them from db instead of filesystem
Anonymous
I am using postgresql
Anonymous
And nginx
Anonymous
These all very new to me...and this is my first project.....most excited....I will be asking lot of doubts.... please help me 😊
𝙑𝙞𝙨𝙝𝙖𝙡
Guys, I made a form and when I am taking the submitted values through request.POST I want to get the object of the value I get through request.POST so how can I get the object of the submitted value ? Please help
Mirco
𝙑𝙞𝙨𝙝𝙖𝙡
Thanks
𝙑𝙞𝙨𝙝𝙖𝙡
Actually I made a form that has a drop down list showing books names which were added by the admin so I want when user choose any book of them and click of submit I get the book name but I want the object of that book name so that I can print the price of that particular book there
Mirco
𝙑𝙞𝙨𝙝𝙖𝙡
form = Form(request.POST)
This returns a dictionary that has the values submitted by the user
I want to find the object of one of the value submitted by the user
𝙑𝙞𝙨𝙝𝙖𝙡
Form.objects.all() returns all objects
But I want that object only of which value has been chosen by the user
𝙑𝙞𝙨𝙝𝙖𝙡
What function do I use to find the object of :
request.POST['name']
Mirco
𝙑𝙞𝙨𝙝𝙖𝙡
It is not printing anything
𝙑𝙞𝙨𝙝𝙖𝙡
Maybe I am doing something wrong
Mirco
share your code 😊 and use pastebin or similar pls
𝙑𝙞𝙨𝙝𝙖𝙡
Ok
𝙑𝙞𝙨𝙝𝙖𝙡
I have never used pastebin 😬 how to share from there
Mirco
Shreehari
𝙑𝙞𝙨𝙝𝙖𝙡
https://pastebin.com/D6FkpSNU
𝙑𝙞𝙨𝙝𝙖𝙡
This is just views.py file
Mirco
𝙑𝙞𝙨𝙝𝙖𝙡
Ok
𝙑𝙞𝙨𝙝𝙖𝙡
https://pastebin.com/8ihew8Qu
𝙑𝙞𝙨𝙝𝙖𝙡
https://pastebin.com/GzvG0dNR
Mirco
Ok
first you don't need two views
you can just check request method if it's GET or POST to render the form ( GET ) or make your calculations ( POST )
Mirco
𝙑𝙞𝙨𝙝𝙖𝙡
I don't understand
But thank you so much for helping. Actually I'm very new in django
𝙑𝙞𝙨𝙝𝙖𝙡
You guys are very helpful
𝙑𝙞𝙨𝙝𝙖𝙡
Mirco
𝙑𝙞𝙨𝙝𝙖𝙡
method is equal to post
Mirco
you will understand what you need
𝙑𝙞𝙨𝙝𝙖𝙡
But I want the object of that choice
𝙑𝙞𝙨𝙝𝙖𝙡
Also
𝙑𝙞𝙨𝙝𝙖𝙡
𝙑𝙞𝙨𝙝𝙖𝙡
Any projects for beginner ?
Alexander
Hello, everybody!
Explain to me please: how I can upload file in models instance from local dir?
I get instance like this: questionnaire_instance = Questionnaire.objects.get(form_link=form_link)
Mirco
syedj
I have added my logging module in settings.py but i am getting django frameworks logging also
Mirco
syedj
How can I disable django frameworks default logging
Alexander
I have empty FileField in model and path to file. I get MyModel.instance and want write file on path in MyModal.instance.MyFileField