Mirco
class base views and function based views; which ones do you use and why
as always it depends sometimes FBVs are enough, in other scenarios a CBV simplifies a lot the code by reducing redundancy and boilerplate code
Mirco
for example if u need something that Django already does like the creation of a model instance by submitting a form, then use a CreateView ( CBV )
Mirco
if u need to return a simple template with a context, maybe a FBV is enough
Eng. A'ula 🇺🇬
Eng. A'ula 🇺🇬
exactly, u can re-use and customise everything
oh okay, I expected fbv to be better for their easy customization
Sanjarbek
#help Hello, everyone! Please, who can help me? I have 10 sites made with Django Is it possible to make it so that from one time to add news to all 10
Shukurillo
Hello, who would like me to accept me like an apprentice, I am happy to help and at the same time to gather some experience as python dev.
Doragonsureiyā
Hello, who would like me to accept me like an apprentice, I am happy to help and at the same time to gather some experience as python dev.
Looks like you need an offtopic group, please continue this conversation at @pythonofftopic as it's not related to Python
IN AFRICA
https://pypi.org/project/django-shopping-cart/ the solution with simplicity
NoBody
Hi guys Anyone knows how to convert : *⁠* Salam *⁠* In the django TextField model form To: <b>Salam</b> In the template, Like telegram ?
Anonymous
How to learn Django? Some resources to learn Python and Django. https://github.com/abbasymot/How-to-learn-Django
Luq
Is there uvicorn worker apart from gunicorn? As gunicorn basee on unix only
Eng. A'ula 🇺🇬
nope, you cannot use inheritance etc etc
then I will just have to choose wisely
Raghav
Is it possible to make share bazar broker api frontend development in django
Sh.Xudoynazarov Shov.t.
RecursionError at / maximum recursion depth exceeded while calling a Python object
Dexter
How to edit form with multiple filefield in class based views
Sh.Xudoynazarov Shov.t.
RecursionError at / maximum recursion depth exceeded while calling a Python object
Here's how to fix this error 🙏🏻🙏🏻🙏🏻
Vivek
Anyone here who has knowledge using web scraping in django rest api? I need some guidance regarding something I want to build
Doragonsureiyā
Anyone here who has knowledge using web scraping in django rest api? I need some guidance regarding something I want to build
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Aman
https://pypi.org/project/django-mercadopago/
Do someone know anyone who can help in retrieving instagram account??
Doragonsureiyā
Do someone know anyone who can help in retrieving instagram account??
Don't tag people randomly, even if they seem knowledgeable. Most of the time, the person you tagged doesn't even know about the topic you just brought up. If people want to help you, they will - just be patient.
Karlygach
Please, help me please with template
Dot enum
I wanted to learn the core of django. I have been working on django for 3 months. But now I need to learn the core part of it. Can anyone tell me where to begin?
Dot enum
What is core part
Like I know the implementation or you can say functionality of django,but I don't know what's happening in core part of django
Dot enum
Like when I use migrate for models to store in database what exactly migrate command do
Вин Король Саксов
Like I know the implementation or you can say functionality of django,but I don't know what's happening in core part of django
You don't have to know that. If you interested how it is working, read it's source code, as it has different parts, read the source code of parts that you are interested in. Knowing how django works, and being able to call some functions from it or change them, is very rare use case (however I had it two times)
Вин Король Саксов
Like when I use migrate for models to store in database what exactly migrate command do
When you are doing migeation, it actually creates/updates, table in your database based on your models. Django uses sqlalchemy for that as I know, but it build some functionality on top of that. And sqlalchemy turns it all into sql code, and runs
Dot enum
So I know how it's architecture and everything works
Вин Король Саксов
So I know how it's architecture and everything works
If you are asking about django source code, that means you don't know how it is working under the hood
Dot enum
What is the difference between one-to-one field and foreign key field
Вин Король Саксов
What is the difference between one-to-one field and foreign key field
One to one field allows only, database row relate to another. Foreign key allows to have multiple rows relate to another one
Dot enum
Ok I get it
Вин Король Саксов
Dot enum
One to many
Вин Король Саксов
Django has models.ManyToMany also
Вин Король Саксов
One to many
Many to one, and one to many is the same
Вин Король Саксов
How we use that?
https://docs.djangoproject.com/en/3.2/topics/db/examples/many_to_many/
G
I had manually added tables in DB which I connected to django later on. Can I get all those tables as models in django? How can I use them directly in dango, without having a model? Any article/link?
IN AFRICA
I had manually added tables in DB which I connected to django later on. Can I get all those tables as models in django? How can I use them directly in dango, without having a model? Any article/link?
Use migrations, some time we can get the best practrice... please i recommand you to create your models in django and Apply migrations. Steps 0. Make sur your django project is connected with your databse please 1. Create the classe represented the table 2. In cmd put this command. python manage.py makemigrations 3. If is run okay, now you can Apply this command . python manage.py migrate
Nazrul Islam
it might be a great help can anyone tell me how to create django groups with permissions after migrating the database ? project , docs or videos references would be awesome. ✊
Вин Король Саксов
Nazrul Islam
check please
IN AFRICA
okay
Azlu
'Matching query does not exists ' how to slove?
Anonymous
Nazrul Islam
If you already know about models, groups is just a way of classifying your models based on the attributes you want
I know about models and how they work. basically i want the groups permission created automatically after running first migrations. hope you can understand
Anonymous
can u explain more
#in Meta class permissions = [(permission_code, permission_name)] permission_code must be a string and a valid python identifier You can set as many permissions as you want but it should be in that format
Anonymous
any references or docs to know more ?
Sure https://docs.djangoproject.com/en/3.2/ref/models/options/
Muhammed
Hi there, I have a problem to create a table in HTML with Django so I share my views code and templates as follows : Please help me
Muhammed
[31/08, 11:16] Mohammad Rajabloo: all_data = { 'a' :[1,2,3,4], 'b' :[5,2,8,4], 'c' :[3,9,3,4], 'd' :[1,7,5,4] } return render(request, 'Warranty_report.html', {'all_data':all_data}) [31/08, 11:17] Mohammad Rajabloo: <table border="1"> <tr> <th>a</th> <th>b</th> <th>c</th> <th>d</th> </tr> {% for i in all_data %} <tr> <td>{{i.a}}</td> <td>{{i.b}}</td> <td>{{i.c}}</td> <td>{{i.d}}</td> </tr> {% endfor %} </table>
Muhammed
But I got empty table
Muhammed
{{i}} not {{i.a}}
I've got header of table in loop. Header is repeated in table not values of my lists
Anonymous
I've got header of table in loop. Header is repeated in table not values of my lists
You can only get a, b, c... by looping through your context variable and for each a, b, c.. you loop through to get your list.
sai
Everyone make use of it guys
Sanji
Hey Guys... Can I send Verification mail in Class based Views or I have to use function based views
Sanji
?