Giter Site home page Giter Site logo

drewdru / fastdrewdru Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 146 KB

backend for https://github.com/drewdru/sitedrewdru

Home Page: https://drewdru.com

License: GNU General Public License v3.0

Python 92.98% Mako 1.28% Shell 5.42% Dockerfile 0.32%
fastapi pydantic personal-website sentry celery docker website portfolio career developer

fastdrewdru's Introduction

fastDrewDru

Backend for personal website(drewdru.com) and fun

Microservices

Frontend repository: https://github.com/drewdru/sitedrewdru

Dependencies

  1. Python >= 3.8.0
  2. requiremets.txt
  3. PostgreSql
  4. Redis
  5. Nginx

Local Deployment

Configure project

Create and configure .env file:

cp .env.example .env && cp .env.example .env.test && cp .env.example .env.ci
# if you use Docker: && cp .env.example .env.docker

To get a string for SECRET_KEY run:

openssl rand -hex 32

Build dependencies

virtualenv env -p python3
source env/bin/activate
pip install -r requirements.txt

Migrate

python manage.py migrations upgrade head

Manage progect

Run project

python manage.py run [--prod]

Run tests

python manage.py test

Add new microservice

python manage.py createapp microservice_name

Run migrations commands

python manage.py migrations -h [--prod]
# Autogenerate migrations
python manage.py migrations revision --autogenerate -m "Autogenerate migrations" [--prod]

Deployment

Change enviromet variables in .env.prod

cp .env.example .env.prod && cp .env.example .env.test

Build dependencies

virtualenv env -p python3
source env/bin/activate
pip install -r requirements.txt

Migrate

python manage.py migrations upgrade head

Run systemd service

Configure paths in etc/fastDrewDru.service

sudo cp etc/fastDrewDru.service /etc/systemd/system/fastDrewDru.service
sudo systemctl daemon-reload
sudo systemctl start fastDrewDru.service
sudo systemctl enable fastDrewDru.service
sudo service fastDrewDru status # use restart on deploy

Configure NGINX

Configure paths in etc/nginx/sites-available/fastDrewDru.conf

sudo cp etc/nginx/sites-available/fastDrewDru.conf /etc/nginx/sites-available/fastDrewDru.conf
sudo ln -s /etc/nginx/sites-available/fastDrewDru.conf /etc/nginx/sites-enabled/fastDrewDru.conf
sudo service nginx reload

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.