So, I ran into a problem on my website where I created two separate html pages. Then I edited urls.py so that the URLs are different for the two pages, but css stops working if I do this. My code is below and I will explain it in more detail after.
part of my head.html
<link href="../../static/textchange/index.css" rel="stylesheet"> <link href="../../static/textchange/jumbotron.css" rel="stylesheet"> <script src="../../static/textchange/index.js"></script>
How to include a title on every html page
{% include "textchange/head.html" %}
Two URLs causing problems
url(r'^results/(?P<uisbn>(\w)+)/(?P<uuser>(\w)+)$', views.contactpost, name="contactpost"), url(r'^results/(?P<uisbn>(\w)+)/(?P<uuser>(\w)+)$', views.contactwish, name="contactwish"),
Thus, the above shows how my URLs are configured at the moment, and I understand that this will only someday go into the contact information. When I change the URL as follows:
url(r'^results/(?P<uisbn>(\w)+)/post/(?P<uuser>(\w)+)$', views.contactpost, name="contactpost"), url(r'^results/(?P<uisbn>(\w)+)/wish/(?P<uuser>(\w)+)$', views.contactwish, name="contactwish"),
CSS stops working for both pages.
Initially, before I had 2 pages, the url looked like this:
url(r'^results/(?P<uisbn>(\w)+)/(?P<uuser>(\w)+)$', views.contact, name="contact"),
Views.py
@login_required def contactpost(request, uuser, uisbn): ltextbook = Textbook.objects.filter(isbn = uisbn) text = ltextbook[0] luser = User.objects.filter(username = uuser) quser = luser[0] post = Posting.objects.filter((Q(user = quser) & Q(textbook = ltextbook))) posting = post[0] return render_to_response( 'textchange/contactpost.html', locals(), context_instance=RequestContext(request) ) @login_required def contactwish(request, uuser, uisbn): ltextbook = Textbook.objects.filter(isbn = uisbn) text = ltextbook[0] luser = User.objects.filter(username = uuser) quser = luser[0] wish = Wishlist.objects.filter((Q(user = quser) & Q(textbook = ltextbook))) wishlist = wish[0] return render_to_response( 'textchange/contactwish.html', locals(), context_instance=RequestContext(request) )
Why does CSS stop working?
Thanks.