Skip to content
Advertisement

Tag: django

Django project without models and data base

It is possible to build a project in Django without models ? I have a views, templates(html), css and urls. That site is looking very good in a browser. It is a hairdressing salon website. Greetings Answer It is completely possible to create a Django project without any models. You only really need models if your website contains objects, like

How to get data of Post.user not the logged in User

I am currently working on a blog project for learning purposes, I am trying to get the total number of posts made by a specific user. In my model I have set the User who makes a Post as Author. In the Post detail page I am trying to show the total number of Posts made by this specific author

Is it possible to add values to context into a for loop?

I have a for loop to iterate a list. In every iteration i have a different value, and i want to add this value to my context. I’m trying using context.update, but every time this returns an empty context. cCard returns correct data. The only thing I need is to store what come from cCard to context[‘card_list’], but evert attempt

Django-filter: count data

Does anybody knows how can I use count based on selected value using django_filters Error My Reference link views.py filters.py user_list.html I want to count all the list base from data I filtered Answer You’ll want the count of the resulting queryset, which you can get from the filter’s qs property (as you do in your template!). Change to

Advertisement