wiki:NagareTutorial

Version 1 (modified by jlcarre, 7 years ago) (diff)

--

Nagare Tutorial, learning concepts

This tutorial will guide you through the basics of Nagare applications.

We will assume that you already have installed Nagare. To check if Nagare is properly installed, you can run the Python interactive interpreter and type:

>>> import nagare

If any error occurs see NagareInstallation .

Part 1, Create an application

  1. When installed, Nagare comes with one application, called admin. You can see it by running the following command:
$ nagare-admin serve
Available applications:
  - admin
  1. Move to a working dir and ask nagare to create your application skeleton:
$ cd /tmp
$ nagare-admin create-app tutorial
Application 'tutorial' created.

Note:
  1. Edit the file 'tutorial/setup.py' to set the informations about your new application.
  2. Register your application with:
       - cd "tutorial"
       - "/tmp/tutorial/bin/python" setup.py develop
  1. To add your application to known applications, you have to register it:
$ cd tutorial
$ python setup.py develop
...
Finished processing dependencies for tutorial==0.0.1
  1. Now the application can be served:
$ nagare-admin serve
Available applications:
 - admin
 - tutorial
  1. Launch your application in reload mode, this way modifications made to your file will automatically restart you application.
$ nagare-admin serve --reload tutorial
Application 'app tutorial' registered as '/tutorial'
02/28/11 11:33:04 - serving on http://127.0.0.1:8080
  1. Open you webbrowser and go to http://127.0.0.1:8080/tutorial, you should see a default application screen.

tutorial1.png

Go to part 2 of this tutorial

Attachments