Giter Club home page Giter Club logo

myfirstpythonapi's Introduction

myFirstPythonAPI

A python restful API to manage integration with Python (could be bots, flask pages and etcetera).

The API is configured to deploy at Heroku

  1. The current version contains

    • User management
    • Group management
    • Bot Management
    • Test Pages
    • at /digitalParrot a dummy bot that sends static answer (for test porpouse)
  2. What is pending ?

    • CI with Travis
    • Link Bot with User
    • Authentication

How to build locally ?

  1. ENV VARS - You need to create environment vars at local and heroku environments
    1. SECRET_KEY - the secret key of the API host
    2. PORT - The port used to test (HEROKU only)
      1. DATABASE_URL - The DB connection url (HEROKU ENV - if you just want to test locally you can skip this part)
  2. Install Python Dependencies
    • pip install -r requirements.txt
  3. Create and Connect Heroku account (HEROKU ENV - if you just want to test locally you can skip this part)
  4. Prepare database and django static file (always do this when you change views or Models)
    • LOCAL ENV
    • Start Django Migrate
      • python manage.py migrate
    • If is justa a Update on a existing table you can do this, before migrate
      • python manage.py makemigrations

Running Local Test

  • Just Python and Django
    • python manage.py runserver
  • Using Heroku on Windows
    • heroku local web -f Procfile.windows
  • Open http://127.0.0.1:8000/ at your browser
  • HAVE FUN !

FAQ

##. Tips to run at Heroku

  1. deploy HEROKU (HEROKU ENV - if you just want to test locally you can skip this part)
    • If you already had connect in Heroku your GitHub account you should (FIRST TIME only)
    • disable collectstatic frrom Django before create the static folders
    • heroku config:set DISABLE_COLLECTSTATIC=1
  2. After Django migrate and collectstatic and build
    • Start the scallabe Dyno
    • heroku ps:scale web=1

Python on Heroku Documentation

For more information about using Python on Heroku, see these Dev Center articles:

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.