|Info:||This is the source code of sirius|
|Author:||Foo Bar <root@localhost>|
This file has been created automatically by cyclone-tool for sirius. It contains the following files:
- sirius.conf: configuration file for the web server
- twisted/plugins/sirius_plugin.py: twisted plugin for running the web server
- sirius/__init__.py: information such as author and version of this package
- sirius/web.py: map of url handlers and main class of the web server
- sirius/config.py: configuration parser for sirius.conf
- sirius/views.py: code of url handlers for the web server
- tools/localefix.py: script to fix html text before running xgettext
- tools/cookie_secret.py: script for generating new secret key for the web server
For development and testing:
twistd -n sirius [--help]
twistd --logfile=/var/log/sirius.log --pidfile=/var/run/sirius.pid sirius
Well, since this is a web server, it might be a good idea to convert this document to HTML before getting into customization details.
Because not everybody has DocUtils installed, I recommend using the rst2a web service API:
curl -F "rst=@README.rst" http://api.rst2a.com/1.0/rst2/html > frontend/static/readme.html
And point your browser to http://localhost:8888/static/readme.html after this server is running.
For more information on the API, please check http://rst2a.com/api/.
This section is dedicated to explaining how to customize your brand new package.
Cyclone provides built-in support for Redis and SQLite databases. Because Cyclone is based on Twisted, it also supports any RDBM supported by the twisted.enterprise.adbapi module, like MySQL or PostgreSQL.
The default configuration file sirius.conf is already configured for using both MySQL and Redis. However, the code for starting the database connection is commented on sirius/config.py. Feel free to uncomment or even remove such code and configuration entries. It won't break the web server.
Cyclone uses the standard gettext library for dealing with string translation. Make sure you have the gettext package installed. If you don't, you won't be able to translate your software.
For installing the gettext package on Debian and Ubuntu systems, do the following:
apt-get install gettext
For Mac OS X, I'd suggest using HomeBrew. If you already use HomeBrew, do the following:
brew install gettext brew link gettext
For generating translatable files for HTML and Python code of your software, do the following:
cat frontend/template/*.html sirius/*.py | python tools/localefix.py | \ xgettext - --language=Python --from-code=utf-8 --keyword=_:1,2 -d sirius
Then translate sirius.po, compile and copy to the appropriate locale directory:
(pt_BR is used as example here) vi sirius.po mkdir -p frontend/locale/pt_BR/LC_MESSAGES/ msgfmt sirius.po -o frontend/locale/pt_BR/LC_MESSAGES/sirius.mo
There are sample translations for both Spanish and Portuguese on this package, already compiled.
The current cookie secret key in sirius.conf was created during the creation of this package. However, if you need a new one, you may run the tools/cookie_secret.py script to generate a random key.
- Cyclone web server.