auto focus on tags
This commit is contained in:
parent
33ff78943d
commit
26759f5a70
|
@ -1,14 +1,24 @@
|
||||||
|
# Python imports
|
||||||
|
import secrets
|
||||||
|
|
||||||
|
|
||||||
|
# Lib imports
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_bcrypt import Bcrypt
|
from flask_bcrypt import Bcrypt
|
||||||
from flask_login import current_user, login_user, logout_user, LoginManager
|
from flask_login import current_user, login_user, logout_user, LoginManager
|
||||||
|
|
||||||
|
|
||||||
|
# Apoplication imports
|
||||||
|
|
||||||
|
|
||||||
|
# Configs and 'init'
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///static/db/database.db"
|
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///static/db/database.db"
|
||||||
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||||
app.config['TITLE'] = ':::APP TITLE:::'
|
app.config['TITLE'] = ':::APP TITLE:::'
|
||||||
|
|
||||||
# For csrf...change!!
|
# For csrf and some other stuff...
|
||||||
app.config['SECRET_KEY'] = '48e80dcf4ed6ea952ca1b7b564be22d665e6e178f7fda84828fdd5e7cdca097a'
|
app.config['SECRET_KEY'] = secrets.token_hex(32)
|
||||||
|
|
||||||
|
|
||||||
login_manager = LoginManager(app)
|
login_manager = LoginManager(app)
|
||||||
|
|
|
@ -14,7 +14,7 @@ class User(db.Model, UserMixin):
|
||||||
username = db.Column(db.String, unique=True, nullable=False)
|
username = db.Column(db.String, unique=True, nullable=False)
|
||||||
email = db.Column(db.String, nullable=False)
|
email = db.Column(db.String, nullable=False)
|
||||||
password = db.Column(db.String, nullable=False)
|
password = db.Column(db.String, nullable=False)
|
||||||
id = db.Column(db.Integer, nullable=False, primary_key=True, unique=True, autoincrement=True)
|
id = db.Column(db.Integer, primary_key=True, unique=True, autoincrement=True)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"['{self.username}', '{self.email}', '{self.password}', '{self.id}']"
|
return f"['{self.username}', '{self.email}', '{self.password}', '{self.id}']"
|
||||||
|
|
|
@ -17,14 +17,14 @@
|
||||||
{{ form.username.label(class="form-control-label") }}
|
{{ form.username.label(class="form-control-label") }}
|
||||||
|
|
||||||
{% if form.username.errors %}
|
{% if form.username.errors %}
|
||||||
{{ form.username(class="form-control form-control-sm is-invalid", autocomplete="off") }}
|
|
||||||
<div class="invalid-feedback">
|
<div class="invalid-feedback">
|
||||||
|
{{ form.username(class="form-control form-control-sm is-invalid", autocomplete="off", autofocus=true) }}
|
||||||
{% for error in form.username.errors %}
|
{% for error in form.username.errors %}
|
||||||
<span class="">{{ error }}</span>
|
<span class="">{{ error }}</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ form.username(class="form-control form-control-sm", autocomplete="off") }}
|
{{ form.username(class="form-control form-control-sm", autocomplete="off", autofocus=true) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -16,14 +16,14 @@
|
||||||
{{ form.username.label(class="form-control-label") }}
|
{{ form.username.label(class="form-control-label") }}
|
||||||
|
|
||||||
{% if form.username.errors %}
|
{% if form.username.errors %}
|
||||||
{{ form.username(class="form-control form-control-sm is-invalid", autocomplete="off") }}
|
{{ form.username(class="form-control form-control-sm is-invalid", autocomplete="off", autofocus=true) }}
|
||||||
<div class="invalid-feedback">
|
<div class="invalid-feedback">
|
||||||
{% for error in form.username.errors %}
|
{% for error in form.username.errors %}
|
||||||
<span class="">{{ error }}</span>
|
<span class="">{{ error }}</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ form.username(class="form-control form-control-sm", autocomplete="off") }}
|
{{ form.username(class="form-control form-control-sm", autocomplete="off", autofocus=true) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
Loading…
Reference in New Issue