Python rest_framework_jwt module throws Invalid payload
beacause
missing username in Facebook social authentication, the module is
patched to get around this validation. But better to check and fix it
ASAP.
Patches are locates in semitki/patches
directory and applied at
container build.
Front end relies heavily in JavaScript 1.6 (ECMAScript 6), web browser requiremenst follow, any version below stated here or not listed, please check the compatibility table link.
- Firefox => 52
- Chrome => 56
- Edge => 13
- Safari => 10
- iOS => 10
Clone the code from github
git clone [email protected]:semitki/semitki.git
Copy the sample configuration files and edit accordingly.
cp semitki/variables.env.sample semitki/variables.env
cp semitki/front/config.js.sample semitki/front/config.js
Besides the code you'll need various tools.
cd semitki
docker build -t semitki_app .
Push image to public docker registry
docker push semitki/api
cd semitki
docker-compose up
Browse the API at http://127.0.0.1:8000 and the web frontend at http://127.0.0.1:9080
We use:
Run the API
cd semitki/api
virtualenv -p $(which python2.7) ENV
. ENV/bin/activate
pip install -U pip
pip install -r requirements.txt
ENV/bin/python manage runserver 0.0.0.0:8000
ENV/bin/python manage migrate
ENV/bin/python manage migrations sonetworks
import os
import django
import django.settings
os.environ.setdefault("DJANGO_SETTINGS_DEFAULT",
"sonetworks.settings")
settings.configure()
django.setup()
npm install -g bower grunt-cli less
cd semitki/front
npm install
bower install
grunt
Running grunt will create a semitki/frontend/dist
directory which
should be accesable by an HTTP server. When running with docker-compose
dist
gets mounted in the path /usr/share/nginx/html
within the web
container.
Some grunt tasks have both development
and production
targets, the
default is to execute development targets.
Every time you install a new component through bower, make sure to add
--save
option in order to update bower.json
with the new dependency.
bower install --save
git commit -m"My new bower component" front/bower.json
If running in Docker, execute a bash shell within the container running the django app.
docker exec -it semitki_app_1 bash
Once in a shell running within the environment of the web application, you can run commands of manage.py for the Django app.
ENV/bin/python manage.py createsuperuser
Set TIME_ZONE = False
in settings.py
and use something like the code
below for date comparison.
from django.utils.timezone import utc
datetime.utcnow().replace(tzinfo=utc)