GeniePy supports deployments to

The following sections assume that flyctl is installed on your machine.

1. Create application supports the Infrastructure-as-Code paradigm by letting you specify parts of your application inside a fly.toml configuration file.

GeniePy includes a basic fly.toml for you to extend. Open it up in your text editor and adjust the app setting to a name you've reserved on

app = "example"

Next, launch this app:

$ flyctl launch

2. Set configuration

There are a few configuration settings the app needs to function. Let's set them using flyctl secrets:

$ flyctl secrets set \
    SITE_NAME=Name \ \
    SITE_URL= \
    COOKIE_SECRET=s3cr3t \
    CSRF_SECRET=s3cr3t \

Note that these values are only examples and that you should change them depending on your application.

3. Initialize the database

Create a new PostgreSQL database on

$ flyctl postgres create --name example-postgres

Next, attach this database to your app:

$ flyctl postgres attach --postgres-app example-postgres

This will "attach" the PostgreSQL cluster to your app the database and export the connection string as the DATABASE_URL environment variable to your app.

Now that the app knows how to access the database, let's run database migrations to bring it into the latest state.:

$ flyctl ssh --app-name example "alembic -c app/alembic.ini upgrade head"

4. All done!

That should be it. You can now check your dashboard to get more details on the app you just launched and how to access it.