Apleoxero
Let me Explain the situation - I need to store multiple genres of an user and each genre is foreignkey to a certain model! which is currently storing single genre
Apleoxero
I.e the certain model is profile model
Apleoxero
Can anyone suggest me some solutions
Cheap
Let me Explain the situation - I need to store multiple genres of an user and each genre is foreignkey to a certain model! which is currently storing single genre
i think you need ManyToManyFiled as one genre can point to many users and many users can point to one genre. Not sure though
Apleoxero
I can try once
AnomaLee
How to use multiple model in index view
AnomaLee
I need to use 2 complete different models to show on my home page with generic view like for both of those models i made separate detail page but for the home i need them together
Rahin
Then activate it
Source name/bin/activate
Cheap
Source name/bin/activate
i think there is no bin/activate in windows There is some kind of Scripts/
Mirco
George
It's dead atm
it isnt maintained?
Mirco
it isnt maintained?
I don't know if they finally unblock the status but yup lots of users complained for not seeing a new release since 1 year , the team promise to go back working but to be honest in this situation I don't suggest to use it It's much better poetry for example or even better just use python -m venv
George
i didnt know that
cj
pyenv + virtualenv = 💕
Mirco
oof
“RIP Pipenv: Tried Too Hard. Do what you need with pip-tools.” by Nick Timkovich https://link.medium.com/o2KKppsQY5
George
pyenv + virtualenv = 💕
i prefer something more organized than virtualenv
Mirco
Poetry or pip-tools are so good imho
Anonymous
Bool object has no attribute 'utcoffset'. What might the cause of this error. Trying to create a new instance from admin.
George
Poetry or pip-tools are so good imho
this is sad, i made some repos with pipenv :/
George
but sure it has some stupid errors
Mirco
this is sad, i made some repos with pipenv :/
Me too, but fortunately I'm not supporting them anymore and for some of them I moved to classic venv
L
Hey there everyone! I recently deployed a practice kind of blog project to heroku. I let my friends write some blog posts on it, while I worked on improving some details. Today I pushed this changes(git heroku push master) and it seems like I accidentally pushed my database in the push, so now every post is erased, does anyone know how to revert this?
Cheap
and which kind of database you are dealing with?
Kushal
pastebin.com/JsnveTvv
Kushal
Help me
A
Hello I am beginer in python +Django i faced problem in urls.py file kindly help in solve in this form . import views syntax error
Cesar
pastebin.com/JsnveTvv
ModuleNotFoundError: No module named 'cashier_home'
Cesar
Watch your logs.... its pretty clear most of the time
A
okay
A
okay sir
Cesar
There is cashier_home sir
i dont think so, is it imported?
Cesar
you only gave us the error. not the code
Cesar
where is cashier_home? thats a view?
Cesar
Its in cashierView file
Totally makes sense, let me just check on your project that i have in my computer. wait a second
Cesar
upload you urls file
Kushal
pastebin.com/hgBnB8GT
Kushal
Kushal
Done sir
Cesar
i bet the method is not in that file
agiezpy
Hi everyone, I working in a project where I use django (obviously), and I need to render dynamically some bootstrap cards (image and text) regarding sme filter. I have implemented by ajax call, where the filter change, through ajax a call a view and it return a json whith the card rendered. ¿this there a better optimized way to that this operation?
A
Plz send screenshot of error
done i got error and resolve it
Pandu
Serializer perform delete operation?
agiezpy
for now in every request, I read DB, render the result in a template and then return a json. Can Redis make a visible difference in speed?
agiezpy
for update list of cards
cj
but you can use .update() to make a deletion, which I personally don't find it a good move 🤷🏻‍♂️
Rahin
Serializer perform delete operation?
It work as a validation for model fields
Cheap
i have a html contact form which has action = {% url to view which grabs data from POST request %} the details passed in POST request are name, email and message but when i parse post request as request.POST[‘email’] or request.POST.get(‘email’) i get None value How can i solve it ?
Cheap
check the post request using browser's devtools. If the post data has these fields then maybe the problem is with the csrf token
i viewed the POST request parameters, but i am only getting csrf and not the passed values i am using id=“email” etc. in html form do i need to use django forms anywhere?
Anonymous
you need to add name="email", etc in the html
Anonymous
you need to add name="email", etc in the html
this name is used when you do a post request
Alberto
Hi, I'm newbie on Django and I need to create a simple web. It only need to have a homepage with a form, it have to take the input of the form and use them as parameters of a Python script I have already done.
Alberto
How I should start? I have already created the project and done some general stuff. I thought I should create a database to handle the data and a form to put in the homepage, right? For creating the form I was creating a function on models.py
Alberto
Any suggestion will be much appreciated
Cheap
How I should start? I have already created the project and done some general stuff. I thought I should create a database to handle the data and a form to put in the homepage, right? For creating the form I was creating a function on models.py
Design your database model, use form inherited from ModelForm class so it can direclty map fields to your model https://docs.djangoproject.com/en/3.0/topics/forms/modelforms/
Alberto
Design your database model, use form inherited from ModelForm class so it can direclty map fields to your model https://docs.djangoproject.com/en/3.0/topics/forms/modelforms/
I have one issue, I have already created a database, so I want to delete it and replace with the new one of ModelForm class, or it isn't necessarily? I mean, can I reuse it? (It holds exactly the same information that I need to handle with a form)