#{extends 'main.html'/}

Your app is ready!

This is a template for a web application that uses the Play Framework. The sample code is a simple CRUD page that manipulates records for a single model object. To try it out go to the people page. Then use Eclipse or the Command Line to deploy some changes.
If you already created this app from the Heroku Eclipse Plugin, proceed to Step 3. The following steps depends on the Heroku Eclipse plugin. If you do not have the Heroku Eclipse plugin installed and configured, follow a step-by-step guide on Dev Center to install the plugin and configure the plugin in Eclipse.

Step 1.Configure Heroku Eclipse preferences

  1. Open EclipsePreferences
  2. Select Heroku
  3. Enter your Email and Password
  4. Click Login. If your login was successful, your Heroku API key would be populated in the API Key field.
    setup api key
  5. In the SSH Key section, click Generate if you need to generate a new key. If you have previously generated and saved a SSH key is automatically loaded from the default location. If it is not in the default location, click Load SSH Key
  6. Click on Add to add your SSH Key to Heroku Add SSH Key to Heroku

Step 2. Importing this App

  1. Open FileImport and expand the Heroku section Import App
  2. Select Existing Heroku ApplicationNext
  3. Select and click Next Create app from template
  4. Choose Import as General Project Project Type selection
  5. Click Finish to complete the import. The plugin will use eGit and clone the source code repository to a local Git repository. Local Project and Git Repository

Step 3. Configure the App

  1. Select the imported project
  2. Go to Run External Tools External Tools Configuration
  3. Double-click Program
  4. Enter the following values:
    • Name: Play Eclipsify
    • Location: Path to the play executable (or play.bat on Windows) in the Play directory unzipped above
    • Working Directory: ${project_loc}
    • Arguments: eclipsify
    Play Eclipsify External Tool Configuration
  5. Click Run
  6. Select the project and choose File Refresh

Step 4. Makes some changes to the app

  1. Open app/controllers/People.java and locate the index() method.
  2. To sort the person records by last name, change Person.findAll() to Person.find("ORDER BY lastName").fetch()
  3. Save the file.

Step 5. Deploy to Heroku

  1. Right-click the project root and choose Team Commit
  2. Enter a commit message and click Commit Commit Changes
  3. Right-click the project root and choose Team Push to Upstream
  4. Review the push results. At the bottom, a "... deployed to Heroku" message will appear. Push Results

Done!

You've just cloned, modified, and deployed a brand new app.

See your changes

Learn more at the Heroku Dev Center

Using Command Line:

Step 1. Setup your environment

  1. Install the Heroku Toolbelt.
  2. Download the Play framework version 1.2.4.
  3. Unzip the framework and add the directory to your PATH.

Step 2. Login to Heroku

heroku login
Be sure to create, or associate an SSH key with your account.
$ heroku login
Enter your Heroku credentials.
Email: playful@example.com
Password:
Could not find an existing public key.
Would you like to generate one? [Yn] Y
Generating new SSH public key.
Uploading SSH public key /Users/Administrator/.ssh/id_rsa.pub
Authentication successful.

Step 3. Clone the App

git clone -o heroku git@heroku.com:.git

Step 4. Makes some changes to the app

  1. Open app/controllers/People.java and locate the index() method.
  2. To sort the person records by last name, change Person.findAll() to Person.find("ORDER BY lastName").fetch()
  3. Save the file.

Step 5. Make sure the app still compiles

play clean precompile

Step 6. Deploy your changes

  1. git commit -am "New changes to deploy"
  2. git push heroku master

Done!

You've just cloned, modified, and deployed a brand new app.

See your changes

Learn more at the Heroku Dev Center