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
Tag: django
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
How to use a custom validation method taking request parameters
I have a really simple form on which I’m doing some validation: But I need to add another validation (which is based on the user making the request). I tried to add the parameter to the clean method: Unfortunately, I cannot call the is_valid() in the view with a parameter: I get the following error message: is_valid() takes 1 positional
How do I display my products by certain category
So I am making an ecom site, and I am using Django. I am quite new and I am using a tutorial but have stepped off touch with it as I want to have 2 categories and maybe more on my website in the future. I want to be able to display them by their category, and I asked for
Other user’s profile is not showing, It is showing only current user name . How to display other user’s profile?
I am creating a web app and I want this to display other user’s profile through the user’s post. I mean when a user click on other user’s profile for see the other user’s information then it will show the other user’s profile. I’ve tried everything but it is showing the name of the current user information after click on
How to check certain headers exist in each request in Django Rest Framework?
I want to test api_key and secret against all requests of different models. Both fields exist in a table. I am using DefaultRouter which itself creates all CRUD based requests URLs. Will I need to create custom functions to check headers or there is some better way to do it? Answer By the name of headers, I assume you want
InvalidImageFormatError Exception The source file does not appear to be an image
So I am using fallback default image to avoid 500 error and it is not successful. I keep getting the same error “InvalidImageFormatError: The source file does not appear to be an image”. In my case I try to thumbnail an image that does not exist. But it is assumed that if the image does not exist it should use
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
Django blog.models.Post.DoesNotExist: Post matching query does not exist
I am currently trying to add an Ajax to my like button to prevent refreshing, I am not an expert in JS. I am trying to learn from mistakes and small training exercises like this one but I am getting the following error: and I don’t know the source and reason of this error. Here is the views.py Here is