GithubHelp home page GithubHelp logo

hackfun_backend's Introduction

Project

Requirements

Docker and docker-compose
Python version: 3.7+
Package listed in requirements.txt

Install

testing at Ubuntu 18.04

clone the project

git clone [email protected]:allen0099/backend
cd backend

setup python3 virtual environment

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7 python3.7-dev python3.7-venv python3.7-doc binfmt-support
# install mysql requirements
sudo apt install libmysqlclient-dev mysql-server

python3.7 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

MySQL database docker compose

./docker/startDockerCompose.sh

Flask shell

cd ./sh
./startFlaskShell.sh
>>> db.create_all()
>>> exit
# start the server
./startFlaskServer.sh

WARNING: listen at 0.0.0.0 may cause some horrible problem, use at your own risk

# using uwsgi
uwsgi --socket 0.0.0.0:8080 --protocol=http --master --enable-threads -w wsgi:application --processes 4

To make it available when system up

sudo cp ./docker/backend.service /etc/systemd/system/backend.service
sudo systemctl start backend.service
sudo systemctl enable backend.service

setup nginx config

# edit nginx config
sudo cp backend /etc/nginx/sites-available/backend
sudo ln -s /etc/nginx/sites-available/backend /etc/nginx/sites-enabled
sudo nginx -t
sudo systemctl restart nginx

recommend using PyCharm for IDE
plugins:
Git Commit Template
GitToolBox

Contact

allen0099

hackfun_backend's People

Contributors

allen0099 avatar dependabot[bot] avatar

Stargazers

 avatar

hackfun_backend's Issues

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.