Once per server:
apt-get update && apt-get upgrade
apt-get install libapache2-mod-wsgi
apt-get install python-setuptools python-dev build-essential
easy_install -U pip
#rtl-support .tt-dropdown-menu { | |
text-align: right; | |
} |
require_relative "test_helper" | |
require "open-uri" | |
require "net/http" | |
class EmojiTest < Blog::Test | |
def test_no_emoji | |
posts.each do |post| | |
content = File.read(post) | |
refute_match /:[a-zA-Z0-9_]+:/, content, |
.flex-display(@display: flex) { | |
display: @display; | |
} | |
.flex(@columns: initial) { | |
flex: @columns; | |
} | |
.flex-direction(@direction: row) { | |
flex-direction: @direction; |
$ mkdir ~/selenium
$ cd ~/selenium
$ wget http://goo.gl/rQhaxb
$ mv selenium-server-standalone-2.49.1.jar ~/selenium/
server { | |
listen 80; | |
server_name example.com; | |
location / { | |
proxy_pass http://127.0.0.1:3000; | |
} | |
location ~ ^/(images/|scripts/|styles/|robots.txt|humans.txt|favicon.ico) { | |
root /your/app/public/folder; |
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:
def read_lines_from_file_as_data_chunks(file_name, chunk_size, callback, return_whole_chunk=False): | |
""" | |
read file line by line regardless of its size | |
:param file_name: absolute path of file to read | |
:param chunk_size: size of data to be read at at time | |
:param callback: callback method, prototype ----> def callback(data, eof, file_name) | |
:return: | |
""" | |
def read_in_chunks(file_obj, chunk_size=5000): |
import bjoern | |
import os, signal | |
from django.core.wsgi import get_wsgi_application | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings') | |
app = get_wsgi_application() | |
NUM_WORKERS = 8 |
#!/usr/bin/env python | |
import multiprocessing | |
import random | |
import string | |
import time | |
def fill_output(): | |
to_fill = num_lines - len(last_output_per_process) |