GithubHelp home page GithubHelp logo

semitki

Shipping faster with ZenHub Codeship Status for semitki/semitki Codacy Badge

Notes

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.

Requirements

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

Compatibility table

Development setup

Clone the code from github

git clone [email protected]:semitki/semitki.git

Settings

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

Tooling

Besides the code you'll need various tools.

Build container image

cd semitki
docker build -t semitki_app .

Push image to public docker registry

docker push semitki/api

Run in Docker with docker-compose

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

Backend development

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

Importing models from non-Django code

import os
import django
import django.settings

os.environ.setdefault("DJANGO_SETTINGS_DEFAULT",
  "sonetworks.settings")
settings.configure()
django.setup()

Frontend development

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.

Adding new bower components

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

Django App

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

Misc notes

Avoid received a naive datetime while time zone support is enabled

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)

semitki's Projects

semitki doesnโ€™t have any public repositories yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.