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 %}
{% endblock %}

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