GithubHelp home page GithubHelp logo

code-project-backend's Introduction

Code - Backend

To install dependencies

pip install -r requirements.txt

To run the server

  1. With gunicorn

    gunicorn --reload app:app
    
  2. With python

    python3 app.py
    

How to use gunicorn for linux

  1. Starting a Gunicorn server: The basic command to start a Gunicorn server is:
    gunicorn your_app_module:app
    
  • Replace your_app_module with the name of the Python module where your Flask application object (app) is defined.
  1. Specifying the number of worker processes: You can control the number of worker processes using the -w or --workers option. For example, to start the server with 4 worker processes, use:

    gunicorn -w 4 your_app_module:app
    
  2. Setting the bind address and port: The -b or --bind option allows you to specify the address and port on which the server should bind. For example, to bind to localhost on port 8000, use:

    gunicorn -b localhost:8000 your_app_module:app
    
  • Logging options: Gunicorn provides various options to configure logging. For example, you can set the log level using the --log-level option. The available log levels are debug, info, warning, error, and critical. To set the log level to info, use:
  1. gunicorn --log-level info your_app_module:app
  • Graceful shutdown: To gracefully shutdown the Gunicorn server, send a SIGTERM or SIGINT signal to the process. For example, you can use Ctrl+C in the terminal where the server is running to send the SIGINT signal and initiate a graceful shutdown.

60b93a68164711eea88ae3300d621ca4

code-project-backend's People

Contributors

gamitej avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

adarshsable

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.