Initial commit
This commit is contained in:
9
accounts/__init__.py
Normal file
9
accounts/__init__.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from flask import Blueprint
|
||||
|
||||
accounts = Blueprint('accounts', __name__,
|
||||
template_folder='templates',
|
||||
url_prefix='/accounts')
|
||||
|
||||
# Placed here to avoid circular import error
|
||||
from accounts import views
|
||||
|
||||
10
accounts/templates/login.html
Normal file
10
accounts/templates/login.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% set title %}Account Login{% endset %}
|
||||
|
||||
{% block content %}
|
||||
Login here
|
||||
---------------
|
||||
Soon to come ;)
|
||||
{% endblock %}
|
||||
|
||||
10
accounts/templates/registration.html
Normal file
10
accounts/templates/registration.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% set title %}Account Registration{% endset %}
|
||||
|
||||
{% block content %}
|
||||
Register for an account
|
||||
-----------------------
|
||||
Soon to come ;)
|
||||
{% endblock %}
|
||||
|
||||
3
accounts/views/__init__.py
Normal file
3
accounts/views/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from accounts.views import login
|
||||
from accounts.views import register
|
||||
|
||||
13
accounts/views/login.py
Normal file
13
accounts/views/login.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from flask import jsonify
|
||||
from flask import render_template
|
||||
|
||||
from accounts import accounts
|
||||
|
||||
@accounts.route('/login', methods=['GET'])
|
||||
def login():
|
||||
return render_template('login.html')
|
||||
|
||||
@accounts.route('/login', methods=['POST'])
|
||||
def authenticate():
|
||||
return jsonify({"message": "Login successful"}), 201
|
||||
|
||||
14
accounts/views/register.py
Normal file
14
accounts/views/register.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from flask import jsonify
|
||||
from flask import render_template
|
||||
|
||||
from accounts import accounts
|
||||
|
||||
@accounts.route('/register', methods=['GET'])
|
||||
def sign_up():
|
||||
return render_template('registration.html')
|
||||
|
||||
@accounts.route('/register', methods=['POST'])
|
||||
def register():
|
||||
# Registration logic
|
||||
return jsonify({"message": "Registration successful"}), 201
|
||||
|
||||
Reference in New Issue
Block a user