Skip to content
Advertisement

Tag: django-templates

Django Querysets adding additional information inside View

I’m currently working on a small django application for my school. I got two models involved in this problem: “category” and “device”, which are connected in a one-to-many relationship category—<device(s) I added one page/template/view for the category overview, containing a large table with all the relevant information on every category created. Querying the categories like this: And displaying them inside

Order of Operations Django Templates

I have a float variable mynumber in Django templates, and I need to round it to the nearest integer without third party filters, so I’m following this logic: In Django templates I can do this: But the problem, as you can see, is that there is no order of operations, so I get a different number than the expected, how

Django: issue with template path for tenant

I have an app where depending on its category, a tenant is either directed to the app (and templates) at /dashboard/templates/dashboard or /dashboard2/templates/dashboard2. somehow, for dashboard2, the app is not found by Django and it tries to find those templates under dashboard. here is a dashboard2/views.py and the error: and the traceback: when try specifying /dashboard2/Supplier2.html I still get the

How to fix TemplatesDoesNotExist error even after BASE_DIR has been Joined with templates in settings.py?

Image 1- Error I notice Exception Value: registration/login.html , I don’t even have that in the templates, instead, i have sign-in.html, I have no idea why it mentioned login.html. Please see my templates folder below as image 3-Templates. I’m trying to fix the above error. My project path looks like Image 2- project path Image 3- Templates The image 2

Template file not found Django

I am trying to make a home page of a new website via Django. My app name is ‘blog’, home page is home.html I still receive the error template does not exist when I go to http://127.0.0.1:8000/blog/home/ I made sure I added ‘blog’ to my templates in settings.py and that I added the folder templates in the main directory as

Advertisement