Compare commits
No commits in common. "7342516ce77cdcdfc1aeee195ad4e1a0442a6a1e" and "f23003e28d13051bd34aad8a13d4c4f1047f069a" have entirely different histories.
7342516ce7
...
f23003e28d
22
.env.example
22
.env.example
@ -1,22 +0,0 @@
|
||||
# TODO Fill me up
|
||||
|
||||
HOST=
|
||||
PORT=
|
||||
|
||||
MYSQL_USER=
|
||||
MYSQL_DATABASE=
|
||||
MYSQL_HOST=
|
||||
MYSQL_PORT=
|
||||
MYSQL_PASSWORD=
|
||||
|
||||
REDIS_HOST=
|
||||
REDIS_PORT=
|
||||
|
||||
JWT_SECRET_KEY=
|
||||
|
||||
MAIL_SERVER=
|
||||
MAIL_PORT=
|
||||
MAIL_USERNAME=
|
||||
MAIL_PASSWORD=
|
||||
MAIL_USE_TLS=
|
||||
MAIL_DEFAULT_SENDER=
|
@ -6,11 +6,8 @@ from flasgger import Swagger
|
||||
from app.doc.main_swag import main_swagger
|
||||
|
||||
app = Flask(__name__)
|
||||
from app.config import FlaskTesting, FlaskProduction
|
||||
app.config.from_object(FlaskTesting)
|
||||
|
||||
mail = Mail(app)
|
||||
jwt_manager = JWTManager(app)
|
||||
mail = Mail(app)
|
||||
swag = Swagger(app, template=main_swagger)
|
||||
|
||||
def create_app():
|
||||
@ -21,6 +18,9 @@ def create_app():
|
||||
app.register_blueprint(bp_user)
|
||||
app.register_blueprint(bp_cart)
|
||||
|
||||
from app.config import FlaskTesting, FlaskProduction
|
||||
app.config.from_object(FlaskTesting)
|
||||
|
||||
from . import jwt_utils
|
||||
|
||||
return app
|
@ -22,8 +22,7 @@ class FlaskTesting:
|
||||
SERVER_NAME = os.environ.get('HOST') + ':' + os.environ.get('PORT')
|
||||
|
||||
MAIL_SERVER = os.environ.get('MAIL_SERVER')
|
||||
MAIL_PORT = os.environ.get('MAIL_PORT')
|
||||
MAIL_PORT = os.environ.get('MAIL_USERNAME')
|
||||
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
|
||||
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
|
||||
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS')
|
||||
MAIL_DEFAULT_SENDER = os.environ.get('MAIL_DEFAULT_SENDER')
|
@ -62,7 +62,10 @@ class UserService:
|
||||
print(f"Error: {e}")
|
||||
return {"Failed": "Failed to insert into database. Username or email are likely in use already"}, 500
|
||||
|
||||
send_mail("Successfully registered!", email, "Congratulations! Your account has been successfully created.\nThis mail also serves as a test that the email address is correct")
|
||||
# TODO Implement mail sending
|
||||
# Currently throws error - connection refused
|
||||
|
||||
# send_mail("Successfully registered!", email, "Congratulations! Your account has been successfully created.\nThis mail also serves as a test that the email address is correct")
|
||||
|
||||
return {"Success": "User created successfully"}, 200
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user