This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| # -*- coding: utf-8 -*- | |
| import csv | |
| import xml.etree.ElementTree as ET | |
| import logging | |
| import ipaddress | |
| from udger import Udger | |
| from db import db_session | |
| from sqlalchemy import text |
This file contains hidden or 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
| #! *-* coding: utf-8 *-* | |
| import csv | |
| import config | |
| import requests | |
| from datetime import datetime | |
| today = datetime.now() | |
This file contains hidden or 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
| # *-* coding: utf-8 *-* | |
| import csv | |
| d = {} | |
| j = {} | |
| followups = [] | |
| with open('data/campaign1.csv', 'r') as f1: |