Skip to content

Tag: django

access variable in template from views.py – Django

This is my first time messing with django and I am having trouble passing variables from a view function to a template html file. views.py and I am trying to send userdata over to index.html like so: However, I am getting either no variables showing up on the screen or I get an error like this: I assume I am

ModuleNotFoundError: No module named ‘django.core’

I want to create django project so I’ve configured virtualenv ,and I installed django pipenv install django==4.0.1 when I create app using this command python3 manage.py startapp Accounts I got this error. can any one help to solve this problem ? Answer Instead of python3 manage.py startapp Accounts try…

How to search via Enums Django

I’m trying to a write a search function for table reserving from a restaurant, I have a restaurant model: which has a enum for kitchen_type: And this is the search function in view.py: So how am I able to search for kitchen_type in the view? Answer Instead of using a list of tuples I would recommend ext…