django link home page
---urls.py:---
from django.conf.urls.defaults import *
urlpatterns = patterns('myproject.views',
url(r'^$', 'index', name='index'), #name is important
)
---Templates:---
<a href="{% url 'index' %}">
django link home page
---urls.py:---
from django.conf.urls.defaults import *
urlpatterns = patterns('myproject.views',
url(r'^$', 'index', name='index'), #name is important
)
---Templates:---
<a href="{% url 'index' %}">
add page to django
Example (Hope this helps)
1) url.py
path('po/comparison/<int:pk>/', views.po_comparison, name='po_comparison'),
2) view.py
@login_required
def po_comparison(request, pk):
po = get_object_or_404(PurchaseOrder, pk=pk)
po_details = PurchaseOrderDetail.objects.filter(po=po).order_by("id")
return render(request, 'po/comparison.html', {'po': po, 'po_details': po_details})
3) comparison.html
Your HTML Page goes here
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us