Skip to content

Tag: django

“Database ‘docker-db’ does not exist”

so I have this problem building django/postgre app with docker. it keeps saying “database does not exist” and quite few time googling doesnt bring any results. I already scrapped the volumes and rebuilt my app few times, followed different guides on how people do the postgres, still no luck making…

Cannot access staticfiles using Pycharm Community Edition

UPDATE: I have updated the followin This is the html file for that specific webpage. Here is the CSS file: I have also changed the settings file like this: You can see my project tree as under for more clarification: Now there is no error but the background image that I am trying to get is now shown on that

‘SessionStore’ object has no attribute ‘cart’ – Django

I generated a basket with 2 products, at the level of the basket page and also on this same page I added a form to insert the customer’s name. by clicking on the submit button which will send the request to a view for insert into the database. but I have an error (‘SessionStore’ object has n…

Automatic avoidance of category duplicates

I have the problem with Category Model. I have 2 tables: so they are standard models with categories. User can create Category by creating a movie with the name of category additionaly. The problem is when user is trying to create Movie with category name that already exists, because it will create another ca…

Building a custom canonical url in python

I want to build a canonical url for my website: my.com here are the requirements: always include www subdomain always use https protocol remove default 80 and 443 ports remove trailing slash Example: This is what I have tried: But I don’t know how to join these url components? Answer You just need to wr…

Django NotEqual custom lookup on related field

I registered a custom lookup base on this answer and official documentation. I registered the custom lookup in my app config. Then i use it in the exclude method this way. The idea here is to get all the customers where user is info.context.user (with private is False or True) OR user is NOT info.context.user…