Exemplo n.º 1
0
 def setUp(self):
     self.stuart_twitter_access_token = "GTvMXibcnUYoMDnD2MTaRD5xp"
     self.stuart_twitter_access_secret = "16DaykgV8kMWGr5WOBhUd0u1l4cpVvfP7ttnY9Qu2XC4trFZkJ"
     self.app_context = app.app_context()
     with self.app_context:
         g.database = Database(
             'mongodb://*****:*****@ds063879.mongolab.com:63879/heroku_app34205970'
         )
Exemplo n.º 2
0
def init_db():
    g.database = Database(mongodb_uri)
Exemplo n.º 3
0
#!/usr/local/bin/python3.7 -u
from platform.utils.main import main, ConfigHooks
from src.db.database import Database, initconfig
from src.db.settings import validatefiles, createfiles

if __name__ == '__main__':
    hooks = ConfigHooks(checkfiles=validatefiles,
                        createfiles=createfiles,
                        saveconfig=initconfig,
                        createdatabase=lambda: Database())
    main('rs',
         ['{path} - программа для синхронизации кода и удалённой сборки'],
         hooks)
Exemplo n.º 4
0
 def setUp(self):
     self.database = Database(
         'mongodb://*****:*****@ds063879.mongolab.com:63879/heroku_app34205970'
     )
Exemplo n.º 5
0
 def setUp(self):
     self.app_context = app.app_context()
     with self.app_context:
         g.database = Database(app.mongolab_uri)
Exemplo n.º 6
0
from src.db.database import Database

database = Database()
metadata = database.get_metadata()
Base = database.get_base()
Exemplo n.º 7
0
# | Author  : UgolinDeveloper                         | #
# | Date    : 29/03/21                                | #
# + ------------------------------------------------- + #

# ~ Import libs
from flask import Flask
from flask_discord import DiscordOAuth2Session
from flask_sqlalchemy import SQLAlchemy

import os

# ~ Import files
from src.db.database import Database

# * Instances.
Database()

# ! Create Flask app.
app = Flask(__name__, static_folder='../app/static/',
            template_folder='../app/templates/')

# Adding config file.
app.config.from_object('app.configuration.Production')

# Adding secret key.
app.config["DISCORD_BOT_TOKEN"] = os.getenv("TOKEN")
app.config["DISCORD_CLIENT_ID"] = 720210871418224670
app.config["DISCORD_CLIENT_SECRET"] = os.getenv("CLIENT_SECRET")
app.config["DISCORD_REDIRECT_URI"] = "http://127.0.0.1:5000/callback"

# Flask secret key
def init_db():
    g.database = Database('mongodb://*****:*****@ds063879.mongolab.com:63879/heroku_app34205970')