If you know M-BoF, you don't need to know anything else.
Use terminal, iTerm, etc. Not XTerm.
-
Install Vagrant - https://www.vagrantup.com/
-
Start Vagrant
cd ocellus
vagrant up
vagrant ssh
cd /vagrant
-
Install Bower, Grunt, JsHint and Watch packages
cd mbofui
bower install
npm cache clean
npm install
grunt dev
to lint and concatenate js orgrunt js-dev
to do the same plus Watch (which concatenates and lints on changes to js)
-
Prepare the application configuration
cd /vagrant/hacks_mbof
cp settings.py.template settings.py
- Edit
settings.py
to set various values:SECRET_KEY
A secret key can be generated at http://www.miniwebtool.com/django-secret-key-generator/
-
Initialize Database
cd /vagrant
python manage.py migrate
python manage.py loaddata mbof/fixtures/dev_data.json
-
Start the application server
- Run the development app server
- Without remote user specified
python manage.py runserver
- With remote user specified
sh runAsUser.sh bjensen
bjensen
is a user included in the test data. Others are available. For the purposes of the HWF event, use only known users.
- Without remote user specified
- Run the development app server
-
Browse to...
- M-BoF homepage: http://localhost:18000/
- REST API
- Root: http://localhost:18000/api/ (Note trailing slash.)
- Events: http://localhost:18000/api/events/
- Current Events: http://localhost:18000/api/events/current/
- Upcoming Events: http://localhost:18000/api/events/upcoming/
- Users: http://localhost:18000/api/users/
- Current authen. user: http://localhost:18000/api/me/
- Testing UI:
- Events list: http://localhost:18000/api/events/ (Note trailing slash.)
- Events detail: http://localhost:18000/api/events/1/
- DB admin: http://localhost:18000/admin/ (Note trailing slash.)
This is the procedure for updating the fixture files after adding dummy data to the DB.
- Connect to the SQLite DB by opening the
db.sqlite3
file with a compatible client. (If a MySQL DB is used for the project later, running in the Vagrant VM, the connection can be made from your host system via the forwarded port defined in the Vagrant file.) - Delete all tables.
- Apply the migrations to recreate the tables:
python manage.py migrate
- Load the existing fixtures:
python manage.py loaddata mbof/fixtures/dev_data.json
- Make changes to the DB needed to exercise application features.
- Save the updated DB to a fixture file:
python manage.py dumpdata --indent 4 mbof > mbof/fixtures/dev_data.json
- Commit the updated fixture file to the project.
- Display BoFs within viewing area
- For now, return all BoFs.
- For implementation later: Find BoFs within radius of a point
- convert radius into +/- degrees lat/lon
- calculate within web service
- see: http://stackoverflow.com/a/1253545/543738
- see: http://www.movable-type.co.uk/scripts/latlong.html
- Link BoFs to user
- get user from api by loginname
- Create BoF
- Use REMOTE_USER
- Set PostingTime and StartTime to current time
- Set EndTime to five days from current time