The client and server for the SF Osaka Sister city app. The letters SFO should be pronounced, not said, so it all comes out as one word.
- Django/Python backend
- Qt 5.x Android/iOS app
- Clone the repo
- Get a copy of machine_conf.py from someone
- /server% virtualenv . -p python3
- /server% bin/pip install -r requirements.txt
You will have to create your machine_conf.py for settings that aren't in settings.py:
- DEBUG
- SECRET_KEY
- STATIC_ROOT (this is only necessary to generate the static files)
- DATABASES
Setup the 'database'. (The database will depend on your machine_conf.py, but the instructions should be the same)
- /server/sfosaka% ../bin/python manage.py makemigrations (should be noop if you're installing for the first time)
- /server/sfosaka% ../bin/python manage.py migrate
- /server/sfosaka% ../bin/python manage.py syncdb
(On updates, skip makemigrations, since those should be checked in)
Setup the static files (in this case, only the admin .css files)
- /server/sfosaka% ../bin/python manage.py collectstatic
This will place the files in STATIC_ROOT (according to your machine_conf.py)
It should be ready to serve. requirements.txt installs gunicorn, but for localhost serving, django has its own server
- /server/sfosaka% ../bin/python manage.py runserver
For gunicorn:
- /server/sfosaka% ../bin/gunicorn -w 4 -b :8001 sfosaka.wsgi:application
(This should be run through apache or nginx)
We're using nginx. The configuration isn't covered here, but in addition to the standard django configuration, you need to point to the static files. (I'm sure there's a better way)
location /static {
root <STATIC_ROOT>; #this is the path in from machine_conf.py, minus the 'static' part.
}
Prerequites: Qt 5.x
- Build FJClient. This is the Futomen JSON client. Just some basic HTTP/JSON marshalling
- Build SFOSaka This should be repeated for every client. SFOContext.cpp has the servername in it.
- mapbox requires an API key which is not checked in. Until I figure out how to put it in a separate file, you have to edit the MapPage.qml file
Android notes: OpenSSL needs to be built. See the Qt specific note, but I found that the OpenSSL setup more useful to configure.