This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contain the confuguration for the application.""" | |
import os | |
class BaseConfig(): | |
"""Base configuration.""" | |
SECRET_KEY = os.environ['SECRET_KEY'] | |
DEBUG = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLIENT_ID=a8e5dd31fbe53c035d08 | |
CLIENT_SECRET=6a24248d597e379d937efaa23c20605ef3658fea | |
OAUTHLIB_INSECURE_TRANSPORT=1 | |
FLASK_ENV=development | |
SECRET_KEY=supersecretkey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module has methods that are used in the other modules in this package.""" | |
import os | |
from dotenv import load_dotenv | |
load_dotenv() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contains initialization code for the api package.""" | |
from flask import Flask, redirect, url_for | |
from api.helpers import set_flask_environment | |
from .blueprints.default.views import default | |
from .blueprints.auth.views import auth | |
from flask_dance.contrib.github import github |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contains the routes associated with the github_blueprint Blueprint.""" | |
import os | |
from flask_dance.contrib.github import make_github_blueprint | |
auth = make_github_blueprint( | |
client_id=os.getenv('CLIENT_ID'), | |
client_secret=os.getenv('CLIENT_SECRET'), | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module contains initialization code for the default blueprint package.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLIENT_ID=xxxxxxxxxxxxxxxxxx | |
CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxx | |
OAUTHLIB_INSECURE_TRANSPORT=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3-slim AS builder | |
ADD . /app | |
WORKDIR /app | |
# We are installing a dependency here directly into our app source dir | |
RUN /usr/local/bin/python -m pip install --upgrade pip | |
RUN pip install --target=/app -r requirements.txt | |
# A distroless container image with Python and some basics like SSL certificates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""This module executes or application.""" | |
import os | |
from api import app | |
if __name__ == '__main__': | |
port = os.getenv('PORT') or 5000 | |
app.run(host='0.0.0.0', port=port) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update: | |
@pip install --upgrade pip | |
install: | |
@pip install -r requirements.txt | |
install-dev: requirements-dev.txt | |
@pip install -r requirements-dev.txt | |
run: |