Skip to content

Instantly share code, notes, and snippets.

View makmac213's full-sized avatar

Mark Allan B. Meriales makmac213

View GitHub Profile
@makmac213
makmac213 / AWS Instance Setup Guide
Last active October 27, 2017 08:14
AWS Instance Setup Guide
# Setup apache2 mysql php
$ sudo apt-get install tasksel
$ sudo tasksel install lamp-server
# python setup tools
$ sudo apt-get install python-setuptools
$ sudo apt-get install python-pip
import threading
import re
from django.conf import settings
from django.http import HttpResponseRedirect
from django.contrib import messages
from django.utils.translation import ugettext as _
# prevent python threading issue, use threading.local to instead of global var
@makmac213
makmac213 / model_to_fixture.py
Last active December 11, 2015 22:48
A command tool that generates fixture data (json) based from existing Models. This can be helpful when doing testing.
"""
Mark Allan B. Meriales
A command tool that generates fixture data (json)
based from existing Models. This can be helpful when
doing testing.
"""
from django.core.management.base import BaseCommand
from django.db import models