Documentation versions

Reahl examples

Reahl comes with a number of examples ready for you to check out and play with. These are not self-explanatory – they are referred to all over in the rest of the tutorial to illustrate what is explained there.

This is just a quick guide you can use as a cheat sheet when you come across an example in the rest of the tutorial and you wonder how to run it.

Get developing with Reahl contains a step-by-step explanation of all the details here.

Listing and checking out examples

Once inside the virtualenv where you installed Reahl, you can use this command to list all the examples that come with Reahl:

reahl listexamples

The list of example names this outputs are referred to all over in our documentation.

To get an example, run (e.g.):

reahl example tutorial.hello

This will create a directory “hello” in your current location containing the example.

Running examples

After first checking out an example, you need to do the following before you can run it:

  • Go to the checked out example:

    cd hello
    
  • Prepare the example for development:

    reahl setup -- develop -N
    
  • Create a database:

    reahl-control createdbuser etc
    reahl-control createdb etc
    reahl-control createdbtables etc
    

Once that is done, run the example:

reahl serve etc

Cleaning up

All examples use the same database. Before you run a different example, you need to remove the previous database:

reahl-control dropdb etc

To remove a previous example from development, run:

reahl setup -- develop -N --uninstall

Documentation versions