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
def imageDetailPage(request, slug1, slug2): | |
category = Category.objects.get(slug=slug1) | |
image = Image.objects.get(slug=slug2) | |
context = {} | |
context['category'] = category | |
context['image'] = image | |
return render(request, 'main/image.html', context) |
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 | |
import openai | |
import config | |
openai.api_key = config.OPENAI_API_KEY | |
def generateBlogTopics(prompt1): | |
response = openai.Completion.create( |
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 flask import Flask, render_template, request | |
import config | |
import blog | |
def page_not_found(e): | |
return render_template('404.html'), 404 | |
app = Flask(__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
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Skolo</title> | |
<!-- Bootstrap CSS --> |
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 tweepy | |
import config | |
import json | |
def getClient(): | |
client = tweepy.Client(bearer_token=config.BEARER_TOKEN, | |
consumer_key=config.API_KEY, | |
consumer_secret=config.API_KEY_SECRET, | |
access_token=config.ACCESS_TOKEN, |
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
@app.route('/classify', methods=["GET", "POST"]) | |
def classify(): | |
query = 'Polokwane lang:en -is:retweet' | |
if request.method == 'POST': | |
query = '{} lang:en -is:retweet'.format(request.form['query']) | |
max_results = 20 |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content="Skolo Online Learning"> | |
<title>Skolo</title> | |
<link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='images/favicon.png') }}"> |
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 openai | |
import config | |
openai.api_key = config.OPENAI_API_KEY | |
def openAIQuery(query): | |
response = openai.Completion.create( | |
engine="davinci-instruct-beta-v3", | |
prompt=query, | |
temperature=0.8, |
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 flask import Flask, render_template, request | |
import config | |
import aicontent | |
def page_not_found(e): | |
return render_template('404.html'), 404 | |
app = Flask(__name__) | |
app.config.from_object(config.config['development']) |
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 | |
import openai | |
import config | |
openai.api_key = config.OPENAI_API_KEY | |
def runSomeCode(): | |
response = openai.Completion.create( | |
engine="code-davinci-001", |