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 celery import Celery | |
import celery_config | |
app = Celery(__name__) | |
app.config_from_object(celery_config) | |
@app.task() | |
def random_task(): | |
pass |
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
CREATE TABLE towns ( | |
id SERIAL UNIQUE NOT NULL, | |
code VARCHAR(10) NOT NULL, -- not unique | |
article TEXT, | |
name TEXT NOT NULL -- not unique | |
); | |
insert into towns ( | |
code, article, name | |
) |
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 flask import Flask | |
app = Flask('__name__') | |
@app.route('/hello', methods=['GET', 'POST']) | |
def hello_world(): | |
return 'This is the hello world api request' |
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 flask import Flask | |
app = Flask('__name__') | |
@app.get('/hello') | |
@app.post('/hello') | |
def hello(): | |
return 'This is the awesome hello api request' |
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 flask import Flask | |
import asyncio | |
app = Flask(__name__) | |
@app.get("/data") | |
async def get_data(): | |
await asyncio.sleep(1) | |
return 'Hello' |
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
import toml | |
from flask import Flask | |
app = Flask('__name__') | |
app.config.from_file('config.toml', toml.load) |
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
import time | |
from random import randint | |
import requests as requests | |
from flask import Flask | |
app = Flask(__name__) | |
def get_xkcd_image(): |
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
import time | |
from random import randint | |
import requests as requests | |
from flask import Flask | |
app = Flask(__name__) | |
def get_xkcd_image(): |
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
import asyncio | |
import time | |
from random import randint | |
import httpx | |
from flask import Flask | |
app = Flask(__name__) | |
# function converted to coroutine |
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
version: "3" | |
services: | |
sonarqube: | |
image: sonarqube:8.5.1-community | |
container_name: sonarqube | |
hostname: sonarqube | |
ports: | |
- 9000:9000 | |
environment: |