Package: yappa
Simple deploy of python web-apps @YandexCloudForget about setting up your own infrastructure, vps, network, orchestrators, etc... goserverlessQuickstartUpdatesDeployment examplesDjangoManagement commandsCreating superuserYandex Cloud authorizationLimitationsDatabase connectivityHeaders and authorizationArticlesRoadmapNext stepsFar-faraway plansTroubleshootingSupport and contributionAcknowledgementsQuickstartsetup virtual env, create your appcreate account at Yandex Cloudinstall Yappa$pipinstallyappa-U
$pipfreeze>requirements.txtuse Yappa:$yappasetup
$yappadeploy...that's it! Your application is deployedUpdateswhen your code is updated just run$yappadeployDeployment examplesBoth WSGI and ASGI applications are supported (as well as raw functions). So Django, Flask, FastAPI... etc could be
easily deployed.Furthermore, not just regular json API could be deployed this way. Several types of applications could be launched with
Yappa:raw serverless functionraw serverless function + Postgresjson API (Flask,FastAPI,Django rest framework)single page applicationSPA + multiple API versions...more examples will be added soonDjangoplease see examples:Django Rest Framework basic- basic DRF app. To explore serverless and Yappa features, like management commandsDjango Rest Framework + Postgres-DRF app with managed Postgres connectivityManagement commandsdjango manage.py commands are supported. just run$yappamanagemigrateIn order to support management commands, for Django projects second cloud function is being created every deploy. It's
made only for handling management commands, and it's not public. Therefore, commands do not support user inputs: to
every command '--no-input' flag is added.Creating superuserAs of Django 3.0 env variables are supported for createsuperuser command. So you should deploy your app with
DJANGO_SUPERUSER_USERNAME, DJANGO_SUPERUSER_PASSWORD environment variables. Then run$yappamanagecreatesuperuserThe other way around would be to implement custom management command (seeStackOverflow topic)Yandex Cloud authorizationCommand '$ yappa setup' prompts you for OAuth token. Then, Yappa creates
service account "yappa-uploader-service" with
roles editor and serverless.functions.admin for the specified folder.
Key for this account is created and saved locally at .yc file.Command '$ yappa deploy' supports two types of authorizationservice account key saved at .yc file (generated during '$ yappa setup')environment variables YC_OAUTH and YC_FOLDERLimitationsThere are some limitations, however YandexCloud team is constantly
releasing new features and services. Also, the team
of this project will try to keep up. So stay tuned :)Database connectivityManaged Postgres and YandexDB is supported inside Yandex Cloud.
In case any other DB - it has to have public IP addressFor details on how te set up connection with managed postgres
please refer toYandexCloud docsraw function + Postgres exampleDjango exampleHeaders and authorizationPlease note that some request headers (like Authorization) aredeleted before function is invokedArticlesHabr:Yappa: запускаем python web-приложения. Просто. Бессерверно. В Яндекс ОблакеDevelopment and ContributionPlease seeproject boardsandissues. With any questions and suggestions please visit
ourtelegram chatIn the near future we will be focused on documentation improvements (mainly deployment examples) and support of async
tasks (serverless workers and scheduler for celery).Troubleshootinginstalling grpcio on Apple M1: installing with anaconda may help. Also look
atstackoverflowversions of python 3.7 support yappa up to 0.3.12. You should use python 3.8 and above for new versions of yappa.AcknowledgementsMikhail Novikovfor starting this project two years agohttpxas a great tool for calling WSGI/ASGI apps offlineZappafor inspiration