This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# items/forms.py | |
from django import forms | |
from .models import ItemLocation | |
# define your models forms here | |
class ItemLocationAdminForm(forms.ModelForm): | |
qty_on_hand = forms.IntegerField() | |
qty_on_order = forms.IntegerField() | |
qty_in_transit = forms.IntegerField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
from celery import Celery | |
from config import config | |
celery = Celery() | |
db = SQLAlchemy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from app import db | |
from datetime import datetime | |
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, Boolean, Text, Float | |
from sqlalchemy.orm import relationship | |
from werkzeug.security import generate_password_hash, check_password_hash | |
# Define application db.Models | |
class User(db.Model): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import time | |
import pymongo | |
import config | |
import json | |
import csv | |
import GeoIP | |
import requests | |
from celery.signals import task_postrun | |
from celery.utils.log import get_task_logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
from flask import Blueprint, jsonify, url_for | |
from app import db | |
from app.models import User | |
home = Blueprint('home', __name__) | |
@home.before_app_first_request | |
def init_db(): | |
db.create_all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from celery import Celery | |
from celery.schedules import crontab | |
from app import create_app | |
from app.tasks import log | |
def create_celery(app): | |
celery = Celery(app.import_name, | |
backend=app.config['CELERY_RESULT_BACKEND'], | |
broker=app.config['CELERY_BROKER_URL']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from kombu import Queue, Exchange | |
BASEDIR = os.path.abspath(os.path.dirname(__file__)) | |
class Config(object): | |
DEBUG = False | |
SECRET_KEY = os.urandom(32) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
from click import echo | |
from flask_mail import Mail | |
from app import create_app | |
app = create_app('development') | |
app.config.update(dict( | |
MAIL_SERVER='localhost', | |
MAIL_PORT=1025, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
## Monit control file | |
############################################################################### | |
## | |
## Comments begin with a '#' and extend through the end of the line. Keywords | |
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'. | |
## | |
## Below you will find examples of some frequently used statements. For | |
## information about the control file and a complete list of statements and | |
## options, please have a look in the Monit manual. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from from import Flask, render_template, Response, jsonify, url_for, flash | |
from flask_sqlalchemy import SQLAlchemy | |
from flask_httpauth import HTTPBasicAuth | |
from models import User, Lead, Company | |
import config | |
app = Flask(__name__) | |
db = SQLAlchemy(app) | |
auth = HTTPBasicAuth() | |
DEBUG = True |