Difference between revisions of "Artenquiz documentation"

From Biowikifarm Metawiki
Jump to: navigation, search
m (+svn directory)
m (+section: Change translations)
Line 9: Line 9:
 
* https://biowikifarm.net/svn/artenquiz/ (you must be e registered user for svn to get access)
 
* https://biowikifarm.net/svn/artenquiz/ (you must be e registered user for svn to get access)
 
[[Category: Software documentation]]
 
[[Category: Software documentation]]
 +
 +
== Folder structure ==
  
 
  /var/www/v-artenquiz/django/
 
  /var/www/v-artenquiz/django/
Line 32: Line 34:
 
   ├ /data {{comment gray| (data for import) }}
 
   ├ /data {{comment gray| (data for import) }}
 
   └ /doc {{comment gray | (python + django documentation as [http://freemind.sourceforge.net/wiki/index.php/Main_Page freemind-mind-map]; current database schema)}}
 
   └ /doc {{comment gray | (python + django documentation as [http://freemind.sourceforge.net/wiki/index.php/Main_Page freemind-mind-map]; current database schema)}}
 +
 +
== Create a new project ==
  
 
You can start a django app by:
 
You can start a django app by:
Line 47: Line 51:
 
  [https://docs.djangoproject.com/en/1.3/topics/http/views/ views.py] {{comment gray| (view layer: form request definitions, form processing) }}
 
  [https://docs.djangoproject.com/en/1.3/topics/http/views/ views.py] {{comment gray| (view layer: form request definitions, form processing) }}
 
  [https://docs.djangoproject.com/en/1.3/topics/templates/ mytemplate.html] {{comment gray| (a template to process, see also [http://artenquiz.biowikifarm.net/admin/doc/ admin/doc/]) }}
 
  [https://docs.djangoproject.com/en/1.3/topics/templates/ mytemplate.html] {{comment gray| (a template to process, see also [http://artenquiz.biowikifarm.net/admin/doc/ admin/doc/]) }}
 +
 +
== Change translations ==
 +
 +
<source lang="html4strict">
 +
<!-- in /templates/mytemplate.html -->
 +
{% trans "Are you a new user? " %}
 +
</source >
 +
<source lang="bash">
 +
cd /artenquiz/django/artenbestimmung
 +
django-admin.py makemessages -l de --extension='.html,.txt' && django-admin.py makemessages -l en --extension='.html,.txt'
 +
</source >
 +
 +
Add translations at least in
 +
* <code>/artenbestimmung/locale/de/LC_MESSAGES/django.po</code>
 +
 +
<source lang="bash">
 +
cd /artenquiz/django/artenbestimmung
 +
django-admin.py compilemessages
 +
</source >

Revision as of 09:38, 2 January 2012

(See also Django-Installation and Django at a glance)

The test version for Artenquiz is running under:

An admin interface for django users having a special admin account is available at:

Subversion directory is:

Folder structure

/var/www/v-artenquiz/django/
 ├ /apache  (redirect/URL settings) 
 ├ /artenbestimmung  (projects artenquiz + artenbestimmung) 
 ·   http://artenquiz.biowikifarm.net/
 ·   http://artenquiz.biowikifarm.net/identification/
 ·   /accounts  (backend for user_name or email login) 
 ·   /artenquiz
 ·     /management
 ·       /commands  (various import tools) 
 ·        USAGE: 
 ·          cd /path-to/artenbestimmung  
 ·          python manage.py help importtaxa  
 ·          python manage.py importtaxa /path-to/datafile.csv 
 ·     /templatetags  (custom tags used in templates) 
 ·     /static  (static CSS styles, JavaScript files, icons) 
 ·     /tools  (python script tools) 
 ·   /local  (generated localization files and defined English translations) 
 ·   /register  (definitions of registration) 
 ·   /report  (simple reports of descriptions for admins) 
 ·   /templates  (all django XHTML-templates) 
 ├ /data  (data for import) 
 └ /doc  (python + django documentation as freemind-mind-map; current database schema)

Create a new project

You can start a django app by:

  cd my-dj-project-folder 
  django-admin.py help startapp 
   django-admin.py startapp my-app-folder 
  # a it needs always __init__.py!!!!

To let a django application get to work, you need (in general) the following files:

__init__.py   (a 0Byte file needed by python) 
url.py  (URL pattern definitions) 
models.py  (data-model definitions) 
views.py  (view layer: form request definitions, form processing) 
mytemplate.html  (a template to process, see also admin/doc/) 

Change translations

<!-- in /templates/mytemplate.html -->
{% trans "Are you a new user? " %}
cd /artenquiz/django/artenbestimmung
django-admin.py makemessages -l de --extension='.html,.txt' && django-admin.py makemessages -l en --extension='.html,.txt'

Add translations at least in

  • /artenbestimmung/locale/de/LC_MESSAGES/django.po
cd /artenquiz/django/artenbestimmung
django-admin.py compilemessages