Curated list of best practices for creating API
Following Apigee api design guide
- There should be only 2 base URLs per resource
- First is for collection, eg.
/dogs
- Second is for element, eg.
/dogs/1234
- First is for collection, eg.
#!/bin/bash | |
NAME="hello_app" # Name of the application | |
DJANGODIR=/webapps/hello_django/hello # Django project directory | |
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
USER=hello # the user to run as | |
GROUP=webapps # the group to run as | |
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
Following the same-name course on Lynda.com
__var_name
and self.var_name
in model@var_name.setter
...serialize()
for convert a class instance to dictionary typeapp.error_handler_spec
dictionary to map error handler to different handlerdef camel_to_underscore(name): | |
""" | |
Convert a name from camel case convention to underscore lower case convention. | |
Args: | |
name (str): name in camel case convention. | |
Returns: | |
name in underscore lowercase convention. | |
""" | |
camel_pat = compile(r'([A-Z])') |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/khanh.nguyen/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
ZSH_THEME="refined" |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta | |
name="viewport" | |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" | |
/> | |
<title>chat.js - by SingaporeJS</title> |