Open source cms for mobile and desktop websites

Datastore - Getting started

Starting the webserver

Once Pyramid and nive_datastore are installed, you can start the webserver from the instance directory nive/myDatastore by calling

#Unix
../bin/pserve development.ini

#Windows
..\Scripts\pserve development.ini

If you get a message similar to the following the server has started all right.

Starting HTTP server on http://0.0.0.0:6543

Now open your web browser and enter http://127.0.0.1:6543 to load the website in your browser.

The configuration

The configuration of the website including database and data directory is included in

myDatastore/__init__.py

The block responsible for the cms configuration contains the following code:

website = AppConf("nive_datastore.app",
      title="My Datastore",
      id="storage"
)
dbConfiguration = DatabaseConf(
         fileRoot="data/storage",
         # SQLite
         context="Sqlite3",
         dbName="data/storage.db"
)
website.modules.append(dbConfiguration)

with the following elements:

  • title of the website
  • id (the url path name of the cms)
  • fileRoot (file system root directory for the files)
  • dbName (sqlite database file)

All options are listed in api/definitions.

The application includes a single data type todo included as ObjectConf

todo = ObjectConf("nive_datastore.item",
    id = "todo",
    name = u"Todo",
    dbparam = "todos",
    # ...
)

# todo: scaffold description and running application

© 2013 Nive GmbH