Inspired and edited from this Digital Ocean tutorial.
Follow the steps on this gist to setup a LEMP stack with PHP 7.0.
The steps assume Nginx has been configured correctly.
For the domains example.com
and test.com
, create the folders.
Inspired and edited from this Digital Ocean tutorial.
Follow the steps on this gist to setup a LEMP stack with PHP 7.0.
The steps assume Nginx has been configured correctly.
For the domains example.com
and test.com
, create the folders.
Logging is done in two places:
Clear logs with:
> laravel.log
sudo bash -c '>error.log' #for nginx
#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.
Run the following commands in sequence.
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
from elasticsearch import Elasticsearch | |
es = Elasticsearch() | |
res = es.get(index="belajar", doc_type='pesan', id=1) | |
print(res['_source']) |
Github and Travis | |
#prereq for travis installation: | |
1. install travis-cli | |
1.1 ruby --version | |
-> gives 2.3 | |
(1.2 sudo apt-get install pkg-config) | |
1.2 sudo apt-get install build-essential | |
sudo apt-get install libffi-dev | |
#install travis |
class ChatLocaleMiddleware(object): | |
def process_request(self, request): | |
if request.path in ['/jsi18n/']: | |
return None | |
match = SHOPPER_CHAT_PATH.match(request.path) | |
if match is not None: | |
appid = match.groups()[0] | |
try: | |
store = Store.objects.get(appid=appid) |
from django.db import models | |
from django.conf import settings | |
import dropbox | |
class RequestToken(models.Model): | |
key = models.CharField(max_length=100) | |
secret = models.CharField(max_length=100) | |
user = models.ForeignKey('auth.User') |
# Add this to your common app in a file called `backends.py` | |
from logging import getLogger | |
from django.core.mail.backends.filebased import EmailBackend as FBEmailBackend | |
from django.core.mail.backends.smtp import EmailBackend as SmtpEmailBackend | |
class LoggingFileBasedEmailBackend(FBEmailBackend): | |
"""A wrapper around ``filebased.EmailBackend`` that logs every email. |