Django: Unterschied zwischen den Versionen

Aus Open Source Ecology - Germany
Zur Navigation springen Zur Suche springen
Zeile 6: Zeile 6:
 
==Install Packages==
 
==Install Packages==
 
* Find version: https://pypi.python.org/pypi/
 
* Find version: https://pypi.python.org/pypi/
 +
 +
==Django CMS==
 +
* Test web pages always with "Preview". When the page is ready see it with "Publish".
  
 
==Virtualenv==
 
==Virtualenv==

Version vom 26. August 2013, 17:11 Uhr

Django - a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Aptana Configuration

  • Win-Preferences->PyDev->Editor->Code Completeion: Apply completion on '.' and '('

Install Packages

Django CMS

  • Test web pages always with "Preview". When the page is ready see it with "Publish".

Virtualenv

Activate:

  • source <your_environment>/bin/activate
  • . ~/.environments/<your_environment>/bin/activate

Tutorials

Style Guides

Images

Configure with PyCharm

Databases

  • Install Databases
~/.environments/<PROJEKT>env/bin/pip install -r requirements.txt

Requirements.txt

On change of the requirements.txt:

  • pip install -r requirements.txt
  • <ENV> manage.py syncdb
  • <ENV> manage.py migrate

Migrations

  • Migrate on change of requirements.txt, e.g. new tables are added.
    • <ENV> manage.py syncdb
    • <ENV> manage.py migrate
  • Migrate on model change:
    • manage.py schemamigration app_name --auto
    • manage.py migrate app_name
  • Django database migration tool: south, explained
  • Delete migration
    • manage.py migrate <app_name> <number_of_migration_to_rollback_to>
    • delete file

Internationalization

  • How Django discovers translations
  • Create or update message files:
    • manage.py makemessages -l de
  • Compile:
    • manage.py compilemessages -v 2 -l de
  • Compile all:
    • bash compilemessages.sh


If you have problems with translating strings:

AJAX

REST

AngularJS

Hosting

Sites in Django