I'm fairly new to django and I'm working on a project for some reason clicking on my links won't redirect me to the desired page, nothing happens, but i cant open it bu right click > open in new tab here is my template
index.html:
<ul class="list">
{% for movie in all_movies %}
<li>
<img src="{{ movie.poster }}" alt="" class="cover" />
<a href="{% url 'detail' movie.id %}"><p class="title">{{ movie.title }}</p></a>
{% for genre in movie.genre.all %}
<p class="genre">{{ genre.genre }} | </p>
{% endfor %}
</li>
{% endfor %}
</ul>
views.py :
def detail(request, movie_id):
movie = get_object_or_404(Movie, pk=movie_id)
return render(request, 'movies/detail.html', {'movie': movie})
urls.py :
urlpatterns = [
# /movies/
url(r'^$', views.index, name='index'),
# /movies/id/
url(r'^(?P<movie_id>[0-9]+)/$', views.detail, name='detail'),
]
i can't find what's wrong with my code, any help would be appreciated!
This is most likely a JavaScript issue, this has nothing to do with Django. Your Django setup is working fine, I tested it is well.
There is an identical issue faced by someone else here, and it was revealed that JavaScript was the actual issue.
I can't think of any other issues that may cause this.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments