Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.19 KB

README.md

File metadata and controls

35 lines (24 loc) · 1.19 KB

Flask-NSFW

Flask-NSFW is a wrapper around clarifai api that helps to prenvent the NSFW content coming to your flask backend.

Currently flask-nsfw blocks images that are sents as multipart, base64 or url.

Build Status PyPI version Coverage Status

To use flask-nsfw : Step 1: Run pip install flask-nsfw (link here)
Step 2: Create account on Clarifai
Step 3: Follow the example below.


from flask import Flask
from flask_nsfw import NSFW

app = Flask(__name__)

app.config['CLIENT_APP_ID'] = '<Clarifai App ID>'
app.config['CLIENT_APP_SECRET'] = 'Clarifai App Secret'


nsfw = NSFW(app)

@app.route('/',methods=['POST'])
@nsfw.block()
def index():
    return "Request contains no NSFW content"

if __name__ == '__main__':
    app.run(debug=True)