Django - Click on link won't redirect me to the page unless i right click and open in new tab

mari

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!

almost a beginner

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.

edited at
0

Comments

0 comments
Login to comment

Related

Right Click and save link to open in new tab

How to: On click open new page in new tab and redirect the old one

Custom right click for anchor tag to open link in new tab

Enable "open in new tab/window" in right click

Bind click event to open a link in new tab

How to right click on a link and open the link in a new tab using Selenium through Java

Open tab on click on link

Protractor Button Click and open page in new tab

Primefaces open page in new tab on button click

Click On Image To Open New Tab In HTML Page

After clicking a link, open new URL and automatically *click* on tab link inside that page

how to open text in webpage as link by right click "Go to web address" in new tab

firefox: remove "Open Link in New Tab" from the right-click menu

not able to select option open link in new tab in right click using selenium

Why won't this formula calculate unless i double click a cell?

'Open in new tab' click on link not open href value

How to open new tab on ASP C# and focus stay on current page then current page redirect to another page on click button?

How to open a page in new tab on click of a button in react, i want to send some data to that page also

React Router - Open Link on new Tab and Redirect to Home Page

AngularJS $state open link in new tab using ctrl + click

jQuery/JavaScript - Allow CTRL + Click to open link in new tab

How to click a link and open it in a new tab geckodriver selenium?

Window does not open new window or tab on external url link click

Google Chrome: Open a link in new tab and switch to it in one click

Open popup when click on picture and also redirect page on hyper link

Selenium Python right click "Open link in new Window" - (Windows 7)

Open to new window or tab on click

How can I design these cards so that on click, they will open up the link to a new page?

How to trigger jquery "click" event even when the user clicked "middle button" or right click -> open in a new tab