Initial commit

This commit is contained in:
2024-04-22 21:14:54 -04:00
commit 994bad056b
21 changed files with 282 additions and 0 deletions

9
accounts/__init__.py Normal file
View 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

View File

@@ -0,0 +1,10 @@
{% extends "base.html" %}
{% set title %}Account Login{% endset %}
{% block content %}
Login here
---------------
Soon to come ;)
{% endblock %}

View File

@@ -0,0 +1,10 @@
{% extends "base.html" %}
{% set title %}Account Registration{% endset %}
{% block content %}
Register for an account
-----------------------
Soon to come ;)
{% endblock %}

View File

@@ -0,0 +1,3 @@
from accounts.views import login
from accounts.views import register

13
accounts/views/login.py Normal file
View 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

View 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