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 __future__ import absolute_import, unicode_literals | |
from celery import shared_task | |
@shared_task | |
def add(x, y): | |
return x + y |
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 __future__ import absolute_import, unicode_literals | |
import os | |
from celery import Celery | |
from datetime import timedelta | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '<project name>.settings') | |
app = Celery('<project name>') | |
app.config_from_object('django.conf:settings', namespace='CELERY') |
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
python manage.py startapp <app name> |
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 json | |
def get_slots(intent_request): | |
return intent_request['sessionState']['intent']['slots'] | |
def get_slot(intent_request, slotName): | |
slots = get_slots(intent_request) | |
if slots is not None and slotName in slots and slots[slotName] is not None: | |
return slots[slotName]['value']['interpretedValue'] | |
else: |
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
python -m django –version |
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
python manage.py startapp <project-name> |
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
STATIC_URL = '/static/' | |
STATICFILES_DIRS = [BASE_DIR / 'static'] | |
MEDIA_URL = '/media/' | |
MEDIA_ROOT = BASE_DIR / 'media' |
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 django.shortcuts import render | |
from .models import Image | |
from .forms import ImageForm | |
from django.http import JsonResponse | |
import os, shutil | |
import glob | |
import cv2 | |
import pytesseract | |
def index(request): |
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
const alertBox = document.getElementById('alert-box') | |
const imageBox = document.getElementById('image-box') | |
const imageForm = document.getElementById('image-form') | |
const confirmBtn = document.getElementById('confirm-btn') | |
const input = document.getElementById('id_file') | |
const text = document.getElementById('text') | |
const csrf = document.getElementsByName('csrfmiddlewaretoken') | |
input.addEventListener('change', ()=> { | |
text.innerHTML = `<p>Select the text portion of the image</p>` |
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
{% load static %} | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Bootstrap CSS --> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-uWxY/CJNBR+1zjPWmfnSnVxwRheevXITnMqoEIeG1LJrdI0GlVs/9cVSyPYXdcSF" crossorigin="anonymous"> |
NewerOlder