Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
then clone from the repo here:
In this post, I will be demonstrating how to deploy a Django Rest Framework (DRF) application on fly.io. DRF is built on top of Django and is my choice when it comes to building small to massive APIs. I have used it extensively professionally and personally, and as a cybersecurity researcher, it's been my favorite to build as a backend for some complex applications that track malicious actors and their infrastructure. I noticed the fly website did not have a Django example, so I wanted to provide the community with a template to get started to avoid the headaches that I endured building this :)
â””> fly postgres create ? App Name: ssapidb Automatically selected personal organization: Zack Allen ? Select region: iad (Ashburn, Virginia (US)) ? Select VM size: shared-cpu-1x - 256 ? Volume size (GB): 10 Creating postgres cluster ssapidb in organization personal Postgres cluster ssapidb created Username: postgres Password: SECRETPASSWORD Hostname: ssapidb.internal Proxy Port: 5432 PG Port: 5433 Save your credentials in a secure place, you won't be able to see them again! Monitoring Deployment ... ... 2 desired, 2 placed, 2 healthy, 0 unhealthy [health checks: 6 total, 6 passing] --> v0 deployed successfully Connect to postgres Any app within the personal organization can connect to postgres using the above credentials and the hostname "ssapidb.internal." For example: postgres://postgres:[email protected]:5432 See the postgres docs for more information on next steps, managing postgres, connecting from outside fly: https://fly.io/docs/reference/postgres/
Swagger and OpenAPI capabilities using drf-yasg, where you can only see endpoints and Swagger docs if you have a valid Token