Angel
Guy's, I have a question :$ ... I'm a beginner :p
Angel
So
Angel
I need you use a database that exists, how
Angel
how can I use a data base that exists
Angel
?
Angel
Sorry, haha I got it
Angel
😅
Роман
Hi guys! I am currently working on my project using DRF and got stacked in one problem where I need to pass json body to destroy function (destroymixin) in view file . Is it legal and should I do it?
Роман
Thanks in advance! 😊
Martín
hello, I have just started a project with cookiecutter-django template when trying to run the server from pycharm, it gives me a SyntaxError: invalid syntax in the lib/python3.6/site-packages/environ.py of my virtualenv and PyCharm tells me this is not python3
Martín
python3.6 seems not to support this
Martín
is something wrong with my way of running or with my virtualenv?
godmode
is something wrong with my way of running or with my virtualenv?
Are you sure that you're running the venv that you created in pycharm? Cuz that use to happened to me, everytime i was in pycharm this one run Python from my system and not the one i created Cuz my conf was wrong... I'd try 2 run it in a independent terminal out of pycharm and see what's going on...
Martín
mmmh
Martín
well, I did a couple of experiments, the venv was created from pycharm but for another project
Martín
and the django project was created from command line using cookiecutter, of course with the pycharm "yes" option and added later to pycharm
godmode
Ummm
Martín
I'm trying from the command line, as you say
godmode
and the django project was created from command line using cookiecutter, of course with the pycharm "yes" option and added later to pycharm
In my project i made a venv un a terminal and indicate pycharm to run this venv. It even recognize the git repo i got in the root
godmode
I'll Talk later , i got Modelate Class! See you!
Martín
ok, thanks
Martín
with the instructions of godmode, now I get ModuleNotFoundError: No module named 'environ'
Kannan
Hi, how to use csrf token inside multiple ajax call for a single form
Kannan
Anyone knows?
Денис
Can I connect models from different apps by ForeignKey or OneToOneKey?
Денис
looks like it's different databases
Денис
oh, I found the way in the docs, thanks
Sumit
How can I get the value of a field in serializer which is in ManyToMany relationship with self
Zerihune
hello guys am new for django i had a problem using Materialize staticly will you help me pls
Денис
hello guys am new for django i had a problem using Materialize staticly will you help me pls
Just describe your problem as thoroughly as possible. We don't ask questions.
Orestis
Hello djangers! I have two models which are linked with a foreign key.I want to access to the model's A functions while i am in the model B. Is there any way to access the functions of model A from model B, without importing the model A inside the model B?(using related_name or something?) Thanks in advance 🙌
Orestis
Get obj from related_name and use obj method. Not clear what you want
inside my Booking(model A) i have a function called get all bookings. now i am writing an another function inside User(model B) where i need to call the getallbookings from Booking. Is there any way to do it without importing model A to the model B?
Денис
also I don't think it's a great idea to use models for shared methods.
Orestis
also I don't think it's a great idea to use models for shared methods.
hmm you think so? could you extend your thoughts on that? i merely understand it but i just want to listen your opinion
Денис
they are connected with a foreign key
still I recommend to use a separate utils.py for shared methods. Models are for fields, fields are for storing data.
Orestis
got it, but my project is already structured like that. so if you know how i can achieve what i asked please let me know. Thank you very much though! @tor_gash
Денис
got it, but my project is already structured like that. so if you know how i can achieve what i asked please let me know. Thank you very much though! @tor_gash
in one model you have a ForeignKey with a related_name parameter. The second model, which is addressed by that ForeignKey, automatically get another field named the same as you put in related_name. And you can use it.
Orestis
yes but as i see i can only access tje objects of the other model and not his functions :/ it works like a query
Денис
yes but as i see i can only access tje objects of the other model and not his functions :/ it works like a query
But modes ARE for queries. Nothing else. Business logic is out of the model's scope
Денис
You still can import one class's methods into another.
Orestis
yes i know, but i want to avoid that. PS [SOLVED] you can access it by calling the objects first
Orestis
depends what you want but yes
Orestis
with all doesnt work. but if you specify like first or you filter it works
Денис
with all doesnt work. but if you specify like first or you filter it works
all() returns a QuerySet, not the model object itself.
Денис
because ForeignKey means one-to-many, there may be several objects in the field named after related_name
Orestis
exactly!
Денис
exactly!
But making database queries everytime you need a utility method of a model... looks like something incredibly insane at first sight.
Baggy ️️
How to send notification in Django between users
Orestis
also do anyone know if importing models, affects the performance of a large project?
Orestis
thank you again @tor_gash
Anonymous
Need help I just created input form inside html page and i want to add some extra feature whenever we clicked on submit it's all input data must to collect in database (i am using pgadmin4). How can i do this?
jam
Hi guys.
jam
I need help, connect django to maxdb
Anonymous
I need help, connect django to maxdb
If you can find a driver to connect to maxdb, it will work. Currently, cannot find a driver for Django to Maxdb
Anonymous
How can I overwrite delete method by replacing with soft delete/safe delete?
Shubham
Hello I m using JWT auth for my Django project in which whenever Im trying to logout its giving an error
Shubham
Method Not Allowed: /users/auth/logout/
Shubham
https://github.com/shubham1507/school
Shubham
http://127.0.0.1:8000/users/auth/logout/
Shubham
hitting this
Khumoyun
Please, Like with red heart
Andrey
Method Not Allowed: /users/auth/logout/
Hello, there is POST method by default for logout https://django-rest-auth.readthedocs.io/en/latest/api_endpoints.html#basic
Andrey
to use GET, set corresponding setting
Anonymous
Hello guys If debug = true will it expose sensitive data?
Anders (izzno / gooood) 🇳🇴
I am adding wagtail to an existing django project. How would you take use of the existing models in other apps? Some I would like to be controlled by wagtail and some by django admin. Would can you change class inheritance from models to Page in existing models or is it better practice to link to existing models by keys etc?
$...🙏💛🔥Maha
I'm creating php project but my question Is php support django?
Tony
I am finding it very difficult to design the user creation form in Django with css.
Jimmies San
Jimmies San
or a unicorn, is better