- Abstract
- Current Infrastructure
- Motivation
- The
URLResolver
API- Interface
- Usage
#!/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 |
{% if messages %} | |
{% for message in messages %} | |
<div class="alert {% if message.tags %} alert-{{ message.tags }}{% endif %}">{{ message|safe }}</div> | |
{% endfor %} | |
{% endif %} | |
{% if form.errors %} | |
<div class="alert alert-error"> | |
<h4>Please fix the following errors</h4> | |
<ul> |
#!/bin/sh | |
# Sublime Text 3 Install (last update: Monday 13 March 2017) | |
# | |
# No need to download this script, just run it on your terminal: | |
# | |
# curl -L git.io/sublimetext | sh | |
# Detect the architecture |
1000;"ENTRADAS OU AQUISIÇÕES DE SERVIÇOS DO ESTADO" | |
1100;"COMPRAS PARA INDUSTRIALIZAÇÃO, COMERCIALIZAÇÃO OU PRESTAÇÃO DE SERVIÇOS" | |
1101;"Compra para industrialização ou produção rural" | |
1102;"Compra para comercialização" | |
1111;"Compra para industrialização de mercadoria recebida anteriormente em consignação industrial" | |
1113;"Compra para comercialização, de mercadoria recebida anteriormente em consignação mercantil" | |
1116;"Compra para industrialização ou produção rural originada de encomenda para recebimento futuro" | |
1117;"Compra para comercialização originada de encomenda para recebimento futuro" | |
1118;"Compra de mercadoria para comercialização pelo adquirente originário, entregue pelo vendedor remetente ao destinatário, em venda à ordem" | |
1120;"Compra para industrialização, em venda à ordem, já recebida do vendedor remetente" |
Backup: | |
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
Restore: | |
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres |
# the mixin | |
class JSONFieldFormMixin(object): | |
""" | |
Given that a model has some kind of TextField ``json_storage_field`` with | |
a string of JSON formatted data inside, this mixin adds handling of this | |
field to a ModelForm. | |
It will read the text field, convert to Python dict, fill the form fields | |
that are given via ``json_fields`` and on saving will write this back to |
#Vue.js component for Select2
A select2 component for vue.js. Quickly create select2 components, load data via ajax and retrieve selected values and newly created tags.
#Usage
Download and register the component:
Vue.component(
Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"
This is a guide to show you step by step how this can be setup. If you just want to get started, use the cookiecuter I set up cookiecutter-django-reactjs. It basically is a fork of pydanny's cookiecutter, just added the front-end stuff :).
I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)
Main features:
- Django REST APIs
#!/usr/bin/env bash | |
set -e | |
# https://docs.docker.com/engine/install/ubuntu/ | |
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 2>/dev/null | |
sudo echo "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') bionic stable" > /etc/apt/sources.list.d/docker.list | |
sudo apt-get -y update |