1

I'm working on my Django web application and I can't seem to get the dropdown list to actually drop down when clicked.

        <div class="panel panel-default">
      <div class="panel-body">
         <div class="dropdown">
      <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Actions
      <span class="caret"></span></button>
      <ul class="dropdown-menu">
        <li><a href="{% url 'start' uuid=uuid %}">Start</a></li>
        <li><a href="{% url 'clone' uuid=uuid %}">Clone</a></li>
        <li><a href="{% url 'stop' uuid=uuid %}">Stop</a></li>
        <li><a href="{% url 'paranoidfish' uuid=uuid %}">Run Anti-Anti-Forensics Checker</a></li>

      </ul>
    </div>

and by request my urls.py, although i'm not entirely sure how that's related

  urlpatterns = [
        #multiurl(
        url(r'^$', views.index, name='index'),
        #url(r'^$', views.transfer, name='transfer'),
        url(r'^malware/$', views.malware, name='malware'), # Add this /malware/ route
        url(r'^pokedex/$', views.pokedex, name='pokedex'),  # Add this /malware/ route

        url(r'^about/$', views.about, name='about'), # Add this /about/ route
        #url(r'^(?P\d+)/results/$', views.results, name='results'),
      #  url(r'^(?P<>\d+)/Clone/$', )
        url(r'^clone/(?P<uuid>[\w\-]+)$', views.clone, name='clone'),

        url(r'^start/(?P<uuid>[\w\-]+)$', views.start, name='start'),
        url(r'^paranoidfish/(?P<uuid>[\w\-]+)$', views.paranoidfish, name='paranoidfish'),
        url(r'^stop/(?P<uuid>[\w\-]+)$', views.stop, name='stop'),
        url(r'^transfer/(?P<uuid>[\w\-]+)$', views.transfer, name='transfer'),
     #   url(r'^(?P<uuid>[\w\-]+)/(?P<malware>[\w\-]+)$', views.execute, name='execute'),

        url(r'^execute/(?P<uuid>([0-9\-a-f]+))/(?P<malware>[-A-Z\0-9\-a-z]+)/$', views.execute, name='execute'),
        url(r'^transfer/(?P<uuid>([0-9\-a-f]+))/(?P<malware>[-A-Z\0-9\-a-z]+)/$', views.transfer, name='transfer'),
    #)
              ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
1
  • post the content of your urls.py. Commented Jan 6, 2018 at 13:41

1 Answer 1

5

Your template seems correct. If your dropdown menu doesn't show up, you've probably missed to import the Bootstrap JS library and/or jQuery.

Bootstrap v3:

<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

Bootstrap v4:

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js" integrity="sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4" crossorigin="anonymous"></script>
Sign up to request clarification or add additional context in comments.

1 Comment

I was coming to the conclusion that it was probably a problem with the cross domain include. Thank you very much for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.