-
Notifications
You must be signed in to change notification settings - Fork 169
Development Tips
karyon edited this page Feb 1, 2015
·
13 revisions
Here are some tips, roughly ordered by usefulness:
- for developing, do
vagrant sshand thensudo python manage.py run- this stops apache (that runs on the VM by default) and start django's integrated server, which, unlike apache, automatically instantly reloads all code changes and prints uncaught exceptions directly on the console.
- run
manage.py testbefore opening a pull request (but it also helps while developing!) - run
manage.py migratewhenever you pull changes with new migrations - run
manage.py makemigrationswhenever you change any models - use poedit to edit the translation files
- run
manage.py shellto interactively test python code - use
manage.py dump_testdatafor creating a new test_data.json - when the vagrant VM does not boot, search for some commented-out lines in the vagrant file and uncomment them to start the VM with the virtualbox GUI
- when using apache:
-
service apache2 reloadwhen code changes -
manage.py collectstaticwhen static files change - easiest way to reroute console output to apache error logs: put
sys.stdout = sys.stderrinto manage.py
-