Skip to content
Advertisement

Tag: django

Get html link id in django views.py

This is what my template index.html looks like And here is my urls.py file Finally, this is my link view inside of the views.py file Where page() is a function that takes one argument. I want the id of the <a></a> tag of index.html to be that argument. But I have no idea how to access get that id inside

Django get user data in main template

I’m trying to check if user logged in in the main template using this: but it’s not working maybe because main template doesn’t have a view could any one help i don’t know if the question duplicated,but i didn’t find my answer. Answer you could use:

Django How to link a foreign key to many tables

I have n classes and each class contains a column called key like this (where n==3) I want to make the column key as Foreign key between all the n classes? I know how make a foreign key between 2 classes but I want to do that with many classes because I have about 40 classes and some classes has

In django what is the use of urls.py for each app?

I am making a django project and i learnt that we need to create a urls.py file for each app created within project. Can anyone please tell what is the purpose of this because we have one urls.py file for the main project, isn’t that enough? Answer Mostly for reusability, partly for organizational reasons. Separate urls.py files allow django apps

Advertisement