Mom-backend is a Django backend used by the Mom Android application.
This is a school project for IG2I, a computer sciences engineering school in nothern France.
In order to get mom-backend, you can
- Run
$ git clone https://github.com/Richard-Degenne/mom-backend/
; - Donwload a ZIP archive by clicking here
Position into the mom-backed folder by running
$ cd mom-backend
(mom-backend-master
if you have used the ZIP archive).
Make sure you have pip installed. Then run
$ pip install -r requirements.txt
This will install every library mom-backend needs to run. It can take a while.
Create a file in the mom
folder, called secrets.py
. In this file, write the following
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '<database_name>',
'USER': '<database_user>',
'PASSWORD': '<database_user_password>',
'HOST': '<database_host>',
'PORT': '<database_port>',
}
}
and replace every angle-bracketed name with consistent values.
Save the file and then run
$ python manage.py migrate
This is set up the database for mom-backend. It can take a while.
Since mom-backend uses the Google API, you need a valid Google API key. Open again the secrets.py
file, and add the following line.
google_api_key = "<google_api_key>"
Replace the angle-bracketed value by the actual key.
Run the following command to feed the database with the necessary data
$ python manage.py loaddata backend/fixtures/data.json
That's it! You're all set up! You can now run the mom-backend server with the following command.
$ python manage.py runserver 0.0.0.0:8000
The server will remain active until you <Ctrl-C>
out of it.