This file contains 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 flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello, World!' | |
if __name__ == '__main__': | |
app.run() |
This file contains 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
[program:yourproject] | |
directory=/home/gamic/projects/gamic/ | |
command=/usr/bin/python /home/gamic/projects/gamic/bot.py | |
user=root | |
autostart=true | |
autorestart=true | |
stopasgroup=true | |
killasgroup=true | |
stderr_logfile=/var/log/gamic/flaskblog.err.log | |
stdout_logfile=/var/log/gamic/flaskblog.out.log |
This file contains 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
# importing... | |
from flask import Flask, render_template, Response ,request, url_for, redirect, send_from_directory, Markup, session, flash, jsonify | |
import json | |
# app confog(typo) | |
app = Flask(__name__) | |
# a simple route | |
@app.route("/") | |
def hello_wordl(): |
This file contains 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
# using flask_restful | |
from flask import Flask, jsonify, request | |
from flask_restful import Resource, Api | |
# creating the flask app | |
app = Flask(__name__) | |
# creating an API object | |
api = Api(app) | |
# making a class for a particular resource |
This file contains 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
import pyrebase | |
config = { | |
"apiKey": "Your API Key", | |
"authDomain": "YourprojectId.firebaseapp.com", | |
"databaseURL": "https://YourdatabaseName.firebaseio.com", | |
"storageBucket": "YourprojectId.appspot.com", | |
"serviceAccount": "path/toyour/serviceAccountCredentials.json" | |
} | |
# initialisatiing pyrebase | |
firebase = pyrebase.initialize_app(config) |
This file contains 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
import pyrebase | |
config = { | |
"apiKey": "Your API Key", | |
"authDomain": "YourprojectId.firebaseapp.com", | |
"databaseURL": "https://YourdatabaseName.firebaseio.com", | |
"storageBucket": "YourprojectId.appspot.com", | |
"serviceAccount": "path/toyour/serviceAccountCredentials.json" | |
} | |
# initialisatiing pyrebase | |
firebase = pyrebase.initialize_app(config) |
This file contains 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
import pyrebase | |
config = { | |
"apiKey": "Your API Key", | |
"authDomain": "YourprojectId.firebaseapp.com", | |
"databaseURL": "https://YourdatabaseName.firebaseio.com", | |
"storageBucket": "YourprojectId.appspot.com", | |
"serviceAccount": "path/toyour/serviceAccountCredentials.json" | |
} | |
# initialisatiing pyrebase | |
firebase = pyrebase.initialize_app(config) |
This file contains 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
import discord | |
from discord.ext import commands | |
bot = commands.Bot(command_prefix='!') | |
@bot.event | |
async def on_ready(): | |
print('Logged in as') | |
print(bot.user.name) | |
print(bot.user.id) |
This file contains 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
import discord | |
from discord.ext import commands | |
bot = commands.Bot(command_prefix='!') | |
@bot.event | |
async def on_ready(): | |
print('Logged in as') | |
print(bot.user.name) | |
print(bot.user.id) |
This file contains 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
import discord | |
from discord.ext import commands | |
bot = commands.Bot(command_prefix='!') | |
@bot.event | |
async def on_ready(): | |
print('Logged in as') | |
print(bot.user.name) | |
print(bot.user.id) |
OlderNewer