Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAndrew Nally
30 PointsDjango Page Error 404--url paths
I keep getting a 404 error whenever I click on the Style Info button that is supposed to lead me to the details page on my database manager project using django
these are my views:
def index(request): get_shoes = ShoeClosetModel.ShoeClosetModels.all() context = {'shoeclosetmodels': get_shoes} return render(request, 'ShoeCloset/shoecloset_index.html', context)
def details_shoeclosetmodel(request, pk): pk = int(pk) shoeclosetmodel = get_object_or_404(ShoeClosetModel, pk=pk) context = {'shoeclosetmodel': shoeclosetmodel} return render(request, 'ShoeCloset/shoecloset_details.html', context)
here are my urls:
urlpatterns = [ path('', views.home, name='ShoeCloset'), path('TheShoeCloset', views.index, name='TheShoeCloset'), path('addShoes', views.addShoes, name='addShoes'), path('ShoeCloset/<int:pk>/shoecloset_details', views.details_shoeclosetmodel, name='details'),
]
biplab dasd
Front End Web Development Techdegree Student 191 Pointsbiplab dasd
Front End Web Development Techdegree Student 191 PointsYes trying to understand this
def index(request): get_shoes = ShoeClosetModel.ShoeClosetModels.all() context = {'shoeclosetmodels': get_shoes} return render(request, 'ShoeCloset/shoecloset_index.html', context)
def details_shoeclosetmodel(request, pk): pk = int(pk) shoeclosetmodel = get_object_or_404(ShoeClosetModel, pk=pk) context = {'shoeclosetmodel': shoeclosetmodel} return render(request . https://shoespundit.com/best-slip-on-work-boots-for-concrete/ urlpatterns = [ path('', views.home, name='ShoeCloset'), path('TheShoeCloset', views.index, name='TheShoeCloset'), path('addShoes', views.addShoes, name='addShoes'), path('ShoeCloset/<int:pk>/shoecloset_details', views.details_shoeclosetmodel, name='details'),
]