{"id":15642462,"url":"https://github.com/playpauseandstop/flask-dropbox","last_synced_at":"2025-04-14T06:43:17.797Z","repository":{"id":3068757,"uuid":"4091624","full_name":"playpauseandstop/Flask-Dropbox","owner":"playpauseandstop","description":"Dropbox Python SDK support for Flask applications","archived":false,"fork":false,"pushed_at":"2021-08-02T03:40:09.000Z","size":195,"stargazers_count":66,"open_issues_count":15,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T02:59:40.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"steipete/PSTAlertController","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/playpauseandstop.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-20T21:52:53.000Z","updated_at":"2025-03-09T14:30:41.000Z","dependencies_parsed_at":"2022-08-26T04:43:26.349Z","dependency_job_id":null,"html_url":"https://github.com/playpauseandstop/Flask-Dropbox","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playpauseandstop%2FFlask-Dropbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playpauseandstop%2FFlask-Dropbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playpauseandstop%2FFlask-Dropbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playpauseandstop%2FFlask-Dropbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/playpauseandstop","download_url":"https://codeload.github.com/playpauseandstop/Flask-Dropbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837264,"owners_count":21169373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T11:56:19.090Z","updated_at":"2025-04-14T06:43:17.771Z","avatar_url":"https://github.com/playpauseandstop.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=============\nFlask-Dropbox\n=============\n\n.. image:: https://travis-ci.org/playpauseandstop/Flask-Dropbox.png?branch=master\n    :target: https://travis-ci.org/playpauseandstop/Flask-Dropbox\n\n.. image:: https://pypip.in/v/Flask-Dropbox/badge.png\n    :target: https://crate.io/packages/Flask-Dropbox\n\n\nDropbox Python SDK support for Flask applications.\n\nRequirements\n============\n\n* `Python \u003chttp://www.python.org/\u003e`_ 2.6 or 2.7\n* `Flask \u003chttp://flask.pocoo.org/\u003e`_ 0.8 or higher\n* `Dropbox Python SDK \u003chttp://pypi.python.org/pypi/dropbox\u003e`_ 1.4 or higher\n\nInstallation\n============\n\n::\n\n    $ pip install Flask-Dropbox\n\nLicense\n=======\n\n``Flask-Dropbox`` is licensed under the `BSD License\n\u003chttps://github.com/playpauseandstop/Flask-Dropbox/blob/master/LICENSE\u003e`_.\n\nConfiguration\n=============\n\nSECRET_KEY\n----------\n\n**REQUIRED.** As token would be stored in Flask's `session\n\u003chttp://flask.pocoo.org/docs/quickstart/#sessions\u003e`_ instance, you need to\nconfigure secret key for your application.\n\nDROPBOX_KEY\n-----------\n\n**REQUIRED.** App key from Dropbox developer site.\n\nDROPBOX_SECRET\n--------------\n\n**REQUIRED.** Secret key from Dropbox developer site.\n\nDROPBOX_ACCESS_TYPE\n-------------------\n\n**REQUIRED.** Should be ``'dropbox'`` or ``'app_folder'`` as configured for\nyour app.\n\nDROPBOX_CALLBACK_URL\n--------------------\n\nBy default, you don't need to provide this setting, cause ``Flask-Dropbox``\nwill setup callback URL automaticly usign current host and type of request,\nbut if you don't trust us, you could to rewrite this setting manually.\n\nDROPBOX_CALLBACK_TEMPLATE\n-------------------------\n\nTemplate to be used for showing errors while trying to process oAuth callback\nfrom Dropbox API. By default: ``'dropbox/callback.html'``.\n\nNext boolean vars could be sent to the template:\n\n* ``error_oauth_token`` - Dropbox API didn't return oAuth token.\n* ``error_not_equal_tokens`` - oAuth token from Dropbox API is not equal to\n  request token stored in Flask session.\n* ``error_response`` - Dropbox API returns ``ErrorResponse`` instance. Also\n  actual exception as ``error`` var would be sent to the template too.\n\nDROPBOX_LOGIN_REDIRECT\n----------------------\n\nPage to redirect to after user successfully logged in with Dropbox account. By\ndefault: ``/``.\n\nDROPBOX_LOGOUT_REDIRECT\n-----------------------\n\nPage to redirect to after user logged out from authenticated Dropbox session.\nBy default: ``/``.\n\nDROPBOX_CACHE_STORAGE\n---------------------\n\n.. versionadded:: 0.3\n\nWhere to place account info, Dropbox client and Dropbox session instances. In\n0.2 and lower all this info stored in ``flask_dropbox.Dropbox`` instance, which\nisn't thread safe, but from 0.3 all these values stored to ``flask.g``. If you\nneed custom storage you can override this setting with object or string which\nwould be imported.\n\nUsage\n=====\n\n``app.py``::\n\n    from flask import Flask\n    from flask.ext.dropbox import Dropbox, DropboxBlueprint\n\n    import settings\n\n\n    app = Flask(__name__)\n    app.config.from_object(settings)\n\n    dropbox = Dropbox(app)\n    dropbox.register_blueprint(url_prefix='/dropbox')\n\n``settings.py``::\n\n    SECRET_KEY = 'some-secret-key'\n    DROPBOX_KEY = 'dropbox-app-key'\n    DROPBOX_SECRET = 'dropbox-app-secret'\n    DROPBOX_ACCESS_TYPE = 'app_folder'\n\n``views.py``::\n\n    from flask import url_for, redirect, request\n    from werkzeug import secure_filename\n\n    from app import app, dropbox\n\n\n    @app.route('/')\n    def home():\n        return u'Click \u003ca href=\"%s\"\u003ehere\u003c/a\u003e to login with Dropbox.' % \\\n               dropbox.login_url\n\n\n    @app.route('/success/\u003cpath:filename\u003e')\n    def success(filename):\n        return u'File successfully uploaded as /%s' % filename\n\n\n    @app.route('/upload', methods=('GET', 'POST'))\n    def upload():\n        if not dropbox.is_authenticated:\n            return redirect(url_for('home'))\n\n        if request.method == 'POST':\n            file_obj = request.files['file']\n\n            if file_obj:\n                client = dropbox.client\n                filename = secure_filename(file.filename)\n\n                # Actual uploading process\n                result = client.put_file('/' + filename, file_obj.read())\n\n                path = result['path'].lstrip('/')\n                return redirect(url_for('success', filename=path))\n\n        return u'\u003cform action=\"\" method=\"post\"\u003e' \\\n               u'\u003cinput name=\"file\" type=\"file\"\u003e' \\\n               u'\u003cinput type=\"submit\" value=\"Upload\"\u003e' \\\n               u'\u003c/form\u003e'\n\nBugs, feature requests?\n=======================\n\nIf you found some bug in ``Flask-Dropbox`` library, please, add new issue to\nthe project's `GitHub issues\n\u003chttps://github.com/playpauseandstop/Flask-Dropbox/issues\u003e`_.\n\nChangeLog\n=========\n\n0.3\n---\n\n+ Flask 0.10 support\n+ Store account info, Dropbox client and session in thread-safe ``flask.g``\n  storage instead of ``flask_dropbox.Dropbox`` instance\n+ Introduce ``DROPBOX_CACHE_STORAGE`` setting\n\n0.2\n---\n\n+ Add ``init_app`` method to ``Dropbox`` extension class.\n+ Do not send ``dropbox`` instance for initialization of ``DropboxBlueprint``\n  class.\n+ Use ``current_app.extensions['dropbox']`` statement in views for getting\n  initialized ``Dropbox`` instance.\n\n0.1.5\n-----\n\n+ Add ``register_blueprint`` shortcut to initialize ``DropboxBlueprint`` with\n  default values in one line.\n+ Move ``Dropbox`` class from ``flask.ext.dropbox.utils`` to\n  ``flask.ext.dropbox.extension`` module. But mainly, it wouldn't affected to\n  your code if you used ``from flask.ext.dropbox import Dropbox`` statements.\n\n0.1.4\n-----\n\n+ Add ``dropbox`` library as install requirement in ``setup.py``.\n+ Update project short description.\n\n0.1.3\n-----\n\n+ Fix handling templates while installing via setup.py\n\n0.1.2\n-----\n\n+ Add support of Dropbox SDK 1.4.1\n\n0.1.1\n-----\n\n+ Check that access token is the instance of ``oauth.OAuthToken`` class if it\n  exists in session.\n\n0.1\n---\n\n* Initial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaypauseandstop%2Fflask-dropbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaypauseandstop%2Fflask-dropbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaypauseandstop%2Fflask-dropbox/lists"}