Initial commit
This commit is contained in:
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