Skip to content

Instantly share code, notes, and snippets.

View hir4k's full-sized avatar

Hirak hir4k

  • India
View GitHub Profile
@hir4k
hir4k / django-styleguide.md
Last active March 22, 2025 02:43
An opinionated django style guide.
  • views.py - manage template rendering
  • forms.py - validate input data
  • services.py - all business logic goes here (call model to CRUD data in db, calling apis, tasks etc.)
  • models.py - represent db table, and do basic things like save,update,retrieve,delete in database.
  • views call services
  • services call models
  • forms only validate data
@hir4k
hir4k / Caddyfile
Created July 12, 2023 23:49
Django Caddy Config Copied From Baserow
{
{$BASEROW_CADDY_GLOBAL_CONF}
}
{$BASEROW_CADDY_ADDRESSES} {
handle /api/* {
reverse_proxy {$PRIVATE_BACKEND_URL:localhost:8000}
}
handle /ws/* {
@hir4k
hir4k / node_nginx_ssl.md
Created December 17, 2021 12:43 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@hir4k
hir4k / django_deploy.md
Created April 4, 2020 14:49 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.