Environment
Now that you have set up your development environment, you should get familiar with your environment and the Ion code base.
Useful Commands
Vagrant
To manage your Vagrant box, you should use the following commands:
Command
Description
vagrant suspend
Saves the state of the VM
vagrant resume
Resumes the previous state of theVM
vagrant ssh
SSHs into the VM
vagrant reload
Halts the VM and then brings it back up
vagrant up
Brings up the VM according to specified Vagrantfile
vagrant destroy
(A DANGEROUS COMMAND)
Stops the VM & permanently destroys the VM and its contents
To manage the Vagrant box within the box, you should use the following commands:
Command
Description
workon ion
Initialize virtualenvwrapper
fab runserver
Run a server in development
./manage.py migrate
Migrate the database if not already
./manage.py shell_plus
Enter a Python shell
./manage.py collectstatic
Collect static files into a directory
You should ALWAYS make sure workon ion
has been run after SSH-ing into the VM. The database should be migrated fairly regularly (especially after changes in the database/models) in development.
Running fab runserver
should make the server accessible from localhost:8080
(on your host machine's web browser).
Running ./setup.py test
should test your current code base against the Ion test suite.
Code base
Overall Structure
Root
The root of the Ion git repository is split into many parts in order to allow developers to access information quickly:
config
: Contains scripts/files used provision the Vagrant boxcron
: Contains cron bash scripts that are only run on productiondocs
: Contains old Ion docsintranet
: Contains most of Ion's codeIon.egg-info
: Contains information about the Python Ion eggsmigrations
: Skeleton directory only created for migrationsscripts
: Contains scripts useful for Ion developers
Some useful files in the root of the Ion git repository include:
COPYING
: Contains the GPLv2+ for the Ion codefabfile.py
: Describes behavior offab
. Used for development/deployment.manage.py
: Contains wrapper for Django shell management commandsREADME.rst
: Contains the READMErequirements.txt
: Contains Ion's dependenciessetup.py
: Describes the Python Ion packageVagrantfile
: Describes configuration of the Vagrant box
Intranet
Some useful sub directories of the intranet
directory include (as per Django best practices):
apps
: Contains the vast majority of Django appsmiddleware
: Contains Django middlewaresettings
: Contains Django settings for Ionstatic
: Contains CSS, images, JS, SVGs, themes, and useful documentstemplates
: Contains Django templates and email templatestest
: Contains the Ion base test suiteutils
: Contains side-wide utilities
All other files in this directory are per Django convention. If you do not know what they do, Google it.
Within the apps
directory, there are multiple Django apps with descriptive names.
Last updated