Development Section

Development Environment

  • Install the ltree package in the postgres database, so that it is available for new databases. The ltree package is part of the postgresql contributions software collection. For windows you may find it in the share\contrib directory of the postgres installation directory. On Redhat you must install the postgresql-contrib package and the ltree.sql file is in the /usr/share/pgsql/contrib directory. Information about the ltree package is available at http://www.sai.msu.su/~megera/postgres/gist/ltree/ . I installed the package in the template database with
    psql -f ltree.sql -d template1 
    

  • Create a postgres login role "itsdb". This login role is used by the web application to connect to the database. Make sure the name of the role matches the value fo the DABASE_NAME entry in the settings.py file. Also check the password of the role to match the DATABASE_PASSWORD entry.
  • Edit the /usr/local/src/its/development/adminserver/src/testmgmt/local_settings.py file. Enter the name of the installation directory , /usr/local/src/its/development/adminserver, as the INSTALLDIR value

Loading initial data and execute Tests

  • Create a database itsdb using collating sequence UTF8 and owner itsdb. Either use pgAdminIII for this job, or execute the following SQL stmt.
    CREATE DATABASE itsdb
      WITH ENCODING='UTF8'
           OWNER=itsdb;
    
  • Change to the base directory ( /usr/local/src/its/development/adminserver/src/testmgmt/) create the database tables with the command
    python manage.py syncdb 
    
  • Answer yes to the question if you want to create a superuser.
  • enter any username/email/password you like
  • The initial data fixture loads a default user with a username "b" and password "b". This user is the owner of all default entries in the database and is used during unit testing. This is only valid until a release. The initial fixture data for a release will not contain any passwords and the default user will not be able to login.
  • A default test project with he name "prj1" is loade from the initial data fixtures. Again, this project is used for unit tests.
  • Run the unit tests with
    python manage.py test
    

Running a "real" development server

  • Run the development server with the command
    python manage.py runserver 9090 
    
  • Fire up a browser with http://localhost:9090/ and login with the username "b", password "b" and "prj1" as the project.

Conventions used in the project

User Stories.Important for design and development. User stories describe something a user/admin/developer wants to do with the system. User stories use real things in a real world to describe requirements.

Each User Story is refined, until it can be expressed by one or more tickets in Trac. Such a ticket has a ticket type enhancement. Pls make a note at the user story which contains the ticket number as a Trac link, so that it is easier to see if a user story is already implemented. A link to a ticket looks like WikiFormatting#TracLinks