- Prerequisites
- Install Python 3
- Install Pip
- Install Virtualenv
- Install Postgres
- Install Django
- Installation
- Create project
| #!/bin/bash | |
| # Update CentOS with any patches | |
| sudo yum update -y --exclude=kernel | |
| # Tools | |
| sudo yum install -y nano unzip screen wget | |
| # Apache 2 | |
| sudo yum install -y httpd httpd-devel httpd-tools |
Install Graphene
pip install graphene-django
Register graphene-django
In Project > Settings.py
graphene-django to INSTALLED_APPS array| // Install sitemap-generator first | |
| const SitemapGenerator = require('sitemap-generator'); | |
| // create generator | |
| var generator = SitemapGenerator('http://localhost:8080/', { | |
| maxDepth: 10, | |
| filepath: 'src/sitemap.xml', | |
| maxEntriesPerFile: 50000, | |
| stripQuerystring: true |
// Return multiple className which separate by space
// Usage : Really useful when adding multiple classes to className as modules
export function classes(classArray) {
return classArray.join(' ');
}
const squareBox = <div className={classes([styles['shape'], styles.square ])}>
| Usage | Command |
|---|---|
Open postgres with postgres user permission |
psql -U postgres |
| Check Postgres version | select version(); |
| Show all users with permissions | \du |
| List all databases | \l |
| Create a database | CREATE DATABASE db_name; |
| Grant all permission of a database to Postgres user | GRANT ALL PRIVILEGES ON DATABASE db_name TO pg_user; |
| Connect to a database | \c db_name |
| Connect to a database as specific user | \c db_name pg_user |
| SELECT conrelid::regclass AS table_from | |
| , conname | |
| , pg_get_constraintdef(c.oid) | |
| FROM pg_constraint c | |
| JOIN pg_namespace n ON n.oid = c.connamespace | |
| WHERE contype IN ('f', 'p ') | |
| AND n.nspname = 'public' -- your schema here | |
| ORDER BY conrelid::regclass::text, contype DESC; |
1 β #!/bin/bash
2 β
3 β cd /Users/turbo/Code/Mackup
4 β mackup backup -f
5 β git add .
6 β git commit -m "Updated changes"
7 β git push| { | |
| "compilerOptions": { | |
| /* Basic Options */ | |
| "target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */, | |
| "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, | |
| "lib": [ | |
| "esnext", | |
| "dom" | |
| ] /* Specify library files to be included in the compilation. */, | |
| // "allowJs": true, /* Allow javascript files to be compiled. */ |