P
P
PyChan2020-05-29 15:33:13
JavaScript
PyChan, 2020-05-29 15:33:13

Why is the entropizer not working?

I have a template with user registration:

<!DOCTYPE html>
          <html>
{%load static%}
          <head>
          <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/froala/[email protected]/dist/css/froala_blocks.min.css">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor/css/froala_editor.pkgd.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor/css/froala_style.min.css">
  <script type="text/javascript" src="{% static 'node_modules/jquery/dist/jquery.js' %}"></script>
    <script type="text/javascript" src="{% static 'bower_components/entropizer/dist/entropizer.js'%}"></script>
    <script type="text/javascript" src="{% static 'bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'bower_components/entropizer/dist/entropizer.min.js' %}"></script>
  <link rel="stylesheet" href="{% static 'bower_components/entropizer/dist/entropizer.min.js'%}">
  <link rel="stylesheet" href="{% static 'bower_components/entropizer/dist/entropizer.js'%}">
</head>
          <body>
          <section class="fdb-block py-0 fp-active" data-block-type="forms" data-id="1" draggable="true">
  <div class="container py-5 my-5" style="background-image: url(https://cdn.jsdelivr.net/gh/froala/[email protected]/dist/imgs//shapes/6.svg);">
    <div class="row">
      <div class="col-12 col-md-8 col-lg-7 col-xl-5 text-left">
        <div class="row">
          <div class="col">
            <h1>Sign Up</h1>
          </div>
        </div>
        <div class="row">
          <div class="col mt-4">
            <input type="text" name="username" class="form-control" placeholder="Username">
          </div>
        </div>
        <div class="row mt-4">
          <div class="col">
            <input type="text" name="mail" class="form-control" placeholder="Email">
              <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
          </div>
        </div>
        <div class="row mt-4">
          <div class="col">
            <input type="password" id= "password" name = 'password' class="form-control" placeholder="Password">
          </div>
        </div>
        <div class="col-md-5" id="meter"></div>
        <pre>
        $('#meter').entropizer({ target: '#password' });
        </pre>
        <div class="row mt-4">
          <div class="col">
            <input type="password" name = 'confirm_password' class="form-control" placeholder="Repeat password">
          </div>
        </div>
        <div class="row mt-4">
          <div class="col">
            <button class="btn btn-primary" type="button">Submit</button>
          </div>
        </div>
      </div>
      </div>
</div>
</section>
      <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/froala-editor/js/froala_editor.pkgd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js"></script>
          </body>
          </html>

I needed to do password complexity check with entropizer https://github.com/jreesuk/jquery-entropizer/blob/...
As a result, nothing works. I thought that the problem might be that for some reason I can't find static 'node_modules/jquery/dist/jquery.js' (error: /app/static%20'node_modules/jquery/dist/jquery.js' HTTP /1.1" 404 2862). This is strange, because the rest of the files in static are loaded.
If anything, the project structure:
5ed10097a24c9863178919.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PyChan, 2020-05-31
@PyChan

Sergey Tikhonov , if you just write src="{% static node_modules/jquery/dist/jquery.js %}", then there will be an error. + what path do not specify, he will look for it in the app

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question