Skip to content

Instantly share code, notes, and snippets.

View olawalejarvis's full-sized avatar

Olawale Aladeusi olawalejarvis

View GitHub Profile
@olawalejarvis
olawalejarvis / UserModel1.py
Created June 20, 2018 19:21
python_tutorial5
# src/models/UserModel.py
#####################
# existing code remain #
######################
from ..app import bcrypt # add this line
class UserModel(db.Model):
"""
User Model
"""
@olawalejarvis
olawalejarvis / UserModel0.py
Created June 20, 2018 19:18
python_tutorial4
# src/models/UserModel.py
from marshmallow import fields, Schema
import datetime
from . import db
class UserModel(db.Model):
"""
User Model
"""
@olawalejarvis
olawalejarvis / run.py
Created June 20, 2018 19:14
python_tutorial3
# /run.py
import os
from src.app import create_app
if __name__ == '__main__':
env_name = os.getenv('FLASK_ENV')
app = create_app(env_name)
# run app
app.run()
@olawalejarvis
olawalejarvis / app0.py
Created June 20, 2018 19:12
python_tutorial2
#src/app.py
from flask import Flask
from .config import app_config
def create_app(env_name):
"""
Create app
"""
@olawalejarvis
olawalejarvis / config.py
Created June 20, 2018 19:08
python_tutorial1
# /src/config.py
import os
class Development(object):
"""
Development environment configuration
"""
DEBUG = True
TESTING = False
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
flask = "*"
flask-sqlalchemy = "*"
"psycopg2" = "*"
flask-migrate = "*"
@olawalejarvis
olawalejarvis / GoogleSearchTest.java
Last active June 23, 2018 08:07
Selenium Grid Test
// src/test/java/GoogleSearchTest.java
import base.SetupTestDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.testng.annotations.*;
import java.net.MalformedURLException;
#src/shared/Authentication
import jwt
import os
import datetime
from flask import json
from ..models.UserModel import UserModel
class Auth():
"""