Nedd
Allow me to update the Paste
Nedd
Or rather I can explain here only
Nedd
So I added a statement before the form.is_valid() where I returned an HTTPResponse(form). To my surprise, even though I have uploaded a file, the form shows no file is selected.
Naveen
connect teamviewer
Naveen
if possible
Naveen
update the paste then
Naveen
what is the error now 🤔
Nedd
Technically there is no error.
Naveen
then
Nedd
The thing is I am filling the form and returning that filled form as an HTTPResponse just to see what is being recieved.
Nedd
So whats happening is that I fill the two form fields; title and file upload. After I press submit, I am shown the HTTPResponse as the title field filled with the content I typed, and an empty file field
Naveen
can you share the code html and all updated code
Nedd
https://pastebin.com/tsSJgM8A
Naveen
dont return before verifying form.is_valid()
Naveen
else it will nevr verifu
Nedd
That was just for debugging
Nedd
To see where the program is failing
Naveen
okay
Naveen
dont create instance first
Naveen
just do form.save()
Naveen
remove instance and other stuff
Naveen
also change "request.POST" to "request.POST or None"
Nedd
ok
Nedd
Did both those things. Didn't work
Naveen
Nedd
yep
Naveen
what is the error now?
Nedd
The view audio.views.upload_audio_file didn't return an HttpResponse object. It returned None instead.
Naveen
did you setup static files management stuff ?
Nedd
yeah. I set up the directory, settings.py was appropriately changed
Nedd
I will try something else in a few hours. Thanks for all the help
Naveen
👍
Naveen
one more thing dont create fields again in modelform since you are already having those from model itself
Bhupesh
https://stackoverflow.com/questions/57054321/typeerror-expected-string-or-bytes-like-object-while-updating-m2m
Bhupesh
Naveen
Your date fields are giving errors. Just remove all their attributes and add "auto_now=True,auto_now_add=True"
Anonymous
Hello,
search_fields = ['meta_data', 'store__district__id']
in this search fields how can i rename the fields like instead of store__district__id I want just district__id
Yegor
owner is a ScrumyGoals' instance, not Users
Sheshadri
Yeah, user object create should have fields like username and password.
Maksim
Greetings everyone!
Anyone can explain me how works this code. I can't understand. I learn with help of book
https://pastebin.com/Txu5LZ3K
Maksim
I can't understand following and followers fields, where exists these fields
Naveen
Denys
Hi Does anyone know an analogue of this library 'pygments' ?
cj
what do you want to do?
Denys
Rohan
cj
Rohan
Why such sorcery?
{°_°}
Dmytro
Hello. I need your help with the path to my SQLite.
For now, I have the following settings for PostgreSQL DSN:
DATABASES = {
'default': dj_database_url.config(default=POSTGRESQL_DSN),
}
But, for some reasons I require an opportunity to use SQLite but with URL also.
DATABASES = {
'default': 'sqlite:///db.sqlite',
}
Approach above does not work for me. Could you please help me?
Pranay
https://docs.djangoproject.com/en/2.2/topics/db/multi-db/
You can define separate databases for separate apps.
Dmytro
Solved. Thanks.
Pranay
No possibility?
Dmytro
sqlite:///db.sqlite3 or postgres://... work.
dj_database_url.config(default=DATABASE_URL)
Anonymous
hi everyone
Rohan
Rohan
Anonymous
i've tried for three days now that' why am requesting help
Anonymous
if u know help pls
cj
if u know help pls
can you please stop cross spamming your homework in all the groups you can? you posted it in every group you are in
Anonymous
Naveen
José
hello, i want a third party app for a news feed, which one should i use?
Anonymous
Post question some complex questions on python
Mirco
Anonymous
It means interview complex questions
Mirco
what u need ?
cj
if you can't answer that, you're fired
Anonymous
I have created one portal when users login they will get some information in info.html template.i have used ""login" function in views for it.
but when I enter "127.0.0.1:8080/login/info/ " i am directly getting info page/template without login/authentication
Shreehari
Anonymous
Anonymous
How to create chat box in django application
Nitesh
how to take avg of max in a sql table
Nitesh
??