Giter Site home page Giter Site logo

api's Introduction

Job API Client

buddy pipeline coverage svg

Requirements

  1. Python 3.7.4
  2. Pipenv
  3. Postgree

Installation

  • Install required packages
$ pipenv install
  • Create database (if needed):
psql -U gitpod -c 'DROP DATABASE jobcore;'
psql -U gitpod -c 'CREATE DATABASE jobcore;'
psql -U gitpod -c 'CREATE EXTENSION unaccent;' -d jobcore
  • Copy and rename jobcore/.env.example to jobcore/.env and set environment variables
  • Generate a new Secret Key $ pipenv run genkey or $ openssl rand -base64 32

Run migrations: $ pipenv run migrate

Run django: $ pipenv run start

Lod fixtures (if needed)

$ python3 manage.py reset
$ pipenv run seed [development|production]

Run tests

$ pipenv run tests

Note: If you are running a particular test:

  • For a particular test: pytest api/tests/test_invites.py

Extra useful stuff

Find static files:

python manage.py findstatic --verbosity 2 social-media/facebook.png

Packages i don;t know if I should install

distribute==0.6.27
poster==0.8.1
wsgiref==0.1.2

Heroku

Adding public keys to heroku

heroku keys:add ~/.ssh/path/to/public/key

Heroku config vars

heroku config:set GITHUB_USERNAME=joesmith

Start python shell

heroku run python manage.py shell

Deploy

git push heroku master

add remote

heroku git:remote -a jobcore

Postgres docker

Postgres

Build

docker build -t jobcore/bd -f ./DockerfileForPostgres .

Run

docker run -it -p 5432:5432 -h localhost --ip 127.0.0.1 jobcore/bd

Django App

Build

docker build -t jobcore/app -f ./DockerfileForLiveReloadApp .

Run (pwd: fish shell variable pwd)

docker run -it -p 5000:5000 -v (pwd):/app jobcore/app

Restoring a postgree dump

psql -U gitpod -c 'DROP DATABASE jobcore;'; psql -U gitpod -c 'CREATE DATABASE jobcore;'; psql -U gitpod -c 'CREATE EXTENSION unaccent;' -d jobcore; psql -U gitpod -c 'CREATE ROLE <role_name> WITH SUPERUSER'; pg_restore -c -d jobcore [dumpfile_name]

CREATING AN ADMIN usER

pipenv shell createsuperuser now enter username and password

api's People

Contributors

alacret avatar alanthinks avatar alesanchezr avatar dependabot[bot] avatar gvizquel avatar ixaxtav avatar josed18 avatar josegomezr avatar llaveluis avatar overflow avatar

Watchers

 avatar

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.