0

Why does the above error happen? register.html exists, and register() exists.

Why would there be no errors for any other html imports?

File "/home/ubuntu/workspace/finance/application.py", line 9, in <module>
from register.html import *

ImportError: No module named 'register'

Register.html if needed:

{% extends "layout.html" %}

{% block title %}
    Register
{% endblock %}

{% block main %}
    <form action="{{ url_for('register') }}" method="post">
        <fieldset>
            <div class="form-group">
                <input autocomplete="off" autofocus class="form-control" name="username" placeholder="Username" type="text"/>
            </div>
            <div class="form-group">
                <input class="form-control" name="password" placeholder="Password" type="password"/>
            </div>
            <div class="form-group">
                <input class="form-control" name="password confirmation" placeholder="Password Confirmation" type="password"/>
            </div>
            <div class="form-group">
                <button class="btn btn-default" type="submit">Register</button>
            </div>
        </fieldset>
    </form>
{% endblock %}

Thanks, Ian

  • Is your register.html form inside your templates folder? – Flesheaters Mar 26 '17 at 15:56
  • Just fixed it, sorry. I shouldn't have been importing it in the first place – Ianardo Mar 26 '17 at 18:53

You must log in to answer this question.

Browse other questions tagged .