Skip to content

Instantly share code, notes, and snippets.

# -*- 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
CLIENT_ID=a8e5dd31fbe53c035d08
CLIENT_SECRET=6a24248d597e379d937efaa23c20605ef3658fea
OAUTHLIB_INSECURE_TRANSPORT=1
FLASK_ENV=development
SECRET_KEY=supersecretkey
# -*- 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()
# -*- 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
# -*- 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'),
)
# -*- coding: utf-8 -*-
"""This module contains initialization code for the default blueprint package."""
CLIENT_ID=xxxxxxxxxxxxxxxxxx
CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxx
OAUTHLIB_INSECURE_TRANSPORT=1
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
# -*- 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)
update:
@pip install --upgrade pip
install:
@pip install -r requirements.txt
install-dev: requirements-dev.txt
@pip install -r requirements-dev.txt
run: