diff --git a/Daryll_Dade/README.txt b/Daryll_Dade/README.txt deleted file mode 100644 index e69de29..0000000 diff --git a/KatherineK/animal.py b/KatherineK/animal.py deleted file mode 100644 index 2d053ca..0000000 --- a/KatherineK/animal.py +++ /dev/null @@ -1,59 +0,0 @@ - -# Create parent class Animal, with methods run, walk, and display_health -class Animal(object) : - def __init__(self, name, health=150): - self.health = health - self.name = name - print self.name + " created" - - def walk(self, repeat): - self.health -= 1 * repeat - return self - - def run(self, repeat): - self.health -= 5 * repeat - return self - - def display_health(self): - print self.health - return self - -#Creating three instances of Animal class -GwendolyntheGiraffe = Animal("Gwen") -LarrytheLion = Animal("Larry") -BobtheBear = Animal("Bob") - -#Walking and Running an instance of Animal class - -BobtheBear.walk(3).run(2).display_health() - -# create class Dog, inheriting traits from Animal, with method .pet() -class Dog(Animal) : - def __init__(self, name, health): - super(Dog, self).__init__(name, health) - - def pet(self, repeat): - self.health += 5 * repeat - return self - -# Create instance of Dog, call methods .run(), .walk(), and .pet() - -Rowdy = Dog("Rowdy", 150) -Rowdy.walk(3).run(2).pet(1).display_health() - - -# Create class Dragon, inheriting from Animal, with method .fly() -class Dragon(Animal) : - def __init__(self, name, health): - super(Dragon, self).__init__(name, health) - - def fly(self): - self.health -= 10 - - def display(self): - self.display_health() - print "I am a dragon" - -# Create instance of Dragon, call method .fly() -Puff = Dragon("Puff", 170) -Puff.display() diff --git a/KatherineK/books/books.mwb b/KatherineK/books/books.mwb deleted file mode 100644 index 7a5f0f5..0000000 Binary files a/KatherineK/books/books.mwb and /dev/null differ diff --git a/KatherineK/books/mysqlconnection.py b/KatherineK/books/mysqlconnection.py deleted file mode 100644 index ea8f008..0000000 --- a/KatherineK/books/mysqlconnection.py +++ /dev/null @@ -1,42 +0,0 @@ - - -""" import the necessary modules """ -from flask_sqlalchemy import SQLAlchemy -from sqlalchemy.sql import text -# Create a class that will give us an object that we can use to connect to a database -class MySQLConnection(object): - def __init__(self, app, db): - config = { - 'host': 'localhost', - 'database': db, # we got db as an argument - 'user': 'root', - 'password': 'root', - 'port': '3306' # change the port to match the port your SQL server is running on - } - # this will use the above values to generate the path to connect to your sql database - DATABASE_URI = "mysql://{}:{}@127.0.0.1:{}/{}".format(config['user'], config['password'], config['port'], config['database']) - app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI - app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True - # establish the connection to database - self.db = SQLAlchemy(app) - # this is the method we will use to query the database - def query_db(self, query, data=None): - result = self.db.session.execute(text(query), data) - if query[0:6].lower() == 'select': - # if the query was a select - # convert the result to a list of dictionaries - list_result = [dict(r) for r in result] - # return the results as a list of dictionaries - return list_result - elif query[0:6].lower() == 'insert': - # if the query was an insert, return the id of the - # commit changes - self.db.session.commit() - # row that was inserted - return result.lastrowid - else: - # if the query was an update or delete, return nothing and commit changes - self.db.session.commit() -# This is the module method to be called by the user in server.py. Make sure to provide the db name! -def MySQLConnector(app, db): - return MySQLConnection(app, db) diff --git a/KatherineK/books/mysqlconnection.pyc b/KatherineK/books/mysqlconnection.pyc deleted file mode 100644 index db72c4c..0000000 Binary files a/KatherineK/books/mysqlconnection.pyc and /dev/null differ diff --git a/KatherineK/books/server.py b/KatherineK/books/server.py deleted file mode 100644 index 3e769d5..0000000 --- a/KatherineK/books/server.py +++ /dev/null @@ -1,79 +0,0 @@ -#### CURRENT PROBLEM -- LINES 40 AND 52 - LIST ITEMS, NOT SURE HOW TO PULL THE TITLES!!!!!! - -import random, md5 -from flask import Flask, render_template, request, redirect, session, flash -from mysqlconnection import MySQLConnector -import sqlalchemy -app = Flask(__name__) -app.secret_key = "secret" -mysql = MySQLConnector(app, 'bookdb') - -# def collection(): -# select_query = "SELECT * from books" -# books = mysql.query_db(select_query) -# return books - - -@app.route('/', methods=["get", "post"]) -def index(): - select_query = "SELECT * from books" - books = mysql.query_db(select_query) - return render_template('index.html', books=books) - -@app.route('/add', methods=['POST']) -def add(): - return render_template('add.html') - -@app.route('/addbook', methods=['POST']) -def addbook(): - form_data = request.form - insert_query = "INSERT INTO books (title, author, year_published, created_at, updated_at) VALUES (:title, :author, :year_published, NOW(), NOW())" - query_data = {"title": request.form['title'], 'author': request.form['author'], "year_published": request.form['year_published']} - mysql.query_db(insert_query, query_data) - return redirect ('/') - -@app.route('/update/', methods=['POST']) -def update(idbooks): - select_query = "SELECT * from books where idbooks = :idbooks" - query_data = {"idbooks": idbooks} - book = mysql.query_db(select_query, query_data) - idbooks = book[0]['idbooks'] - title = book[0]['title'] - author = book[0]['author'] - year_published = book[0]['year_published'] - return render_template("update.html", title=title, author=author, year_published=year_published, idbooks=idbooks) - -@app.route('/updateconfirm/', methods=['POST']) -def updateconfirm(idbooks): - idbooks = int(idbooks) - update_query = "UPDATE books SET title= :title, author= :author, year_published= :year_published WHERE idbooks= :idbooks" - query_data = {"title": request.form['title'], 'author': request.form['author'], "year_published": int(request.form['year_published']), "idbooks": idbooks} - mysql.query_db(update_query, query_data) - return redirect('/') - -@app.route('/delete/', methods=['POST']) -def delete(idbooks): - select_query = "SELECT * from books where idbooks = :idbooks" - query_data = {"idbooks": idbooks} - book = mysql.query_db(select_query, query_data) - idbooks = book[0]['idbooks'] - if len(book) > 0 : - title = book[0]['title'] - return render_template("delete.html", idbooks=idbooks, title=title) - else : - return redirect ('/') - -@app.route('/deleteconfirm/', methods=['POST']) -def deleteconfirm(idbooks): - idbooks = int(idbooks) - delete_query = "DELETE from books where idbooks = :idbooks" - query_data = {"idbooks": idbooks} - mysql.query_db(delete_query, query_data) - - return redirect ('/') - -@app.route('/cancel', methods=['POST']) -def cancel(): - return redirect ('/') - -app.run(debug=True) diff --git a/KatherineK/books/static/css/index.css b/KatherineK/books/static/css/index.css deleted file mode 100644 index 12a6830..0000000 --- a/KatherineK/books/static/css/index.css +++ /dev/null @@ -1,20 +0,0 @@ -body { - color: white; - font-weight: bold; -} - -h1 { - background-color: rgb(49, 83, 119); - color: white; - width: 700px; -} - -table { - background-color: rgb(153, 107, 90); - width: 700px; - -} - -form { - display: inline-block; -} diff --git a/KatherineK/books/static/img/shelf1.jpg b/KatherineK/books/static/img/shelf1.jpg deleted file mode 100644 index 11ae39b..0000000 Binary files a/KatherineK/books/static/img/shelf1.jpg and /dev/null differ diff --git a/KatherineK/books/static/img/shelf2.png b/KatherineK/books/static/img/shelf2.png deleted file mode 100644 index fec630d..0000000 Binary files a/KatherineK/books/static/img/shelf2.png and /dev/null differ diff --git a/KatherineK/books/static/img/shelf3.jpg b/KatherineK/books/static/img/shelf3.jpg deleted file mode 100644 index 9988265..0000000 Binary files a/KatherineK/books/static/img/shelf3.jpg and /dev/null differ diff --git a/KatherineK/books/static/img/shelf4.png b/KatherineK/books/static/img/shelf4.png deleted file mode 100644 index 765587c..0000000 Binary files a/KatherineK/books/static/img/shelf4.png and /dev/null differ diff --git a/KatherineK/books/static/img/shelf5.png b/KatherineK/books/static/img/shelf5.png deleted file mode 100644 index 5ded201..0000000 Binary files a/KatherineK/books/static/img/shelf5.png and /dev/null differ diff --git a/KatherineK/books/templates/add.html b/KatherineK/books/templates/add.html deleted file mode 100644 index 8f32e43..0000000 --- a/KatherineK/books/templates/add.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Add a Book - - - -
-

Add a Book:

-
- -
-
- -
-
- -
-
- -
-
- - - - diff --git a/KatherineK/books/templates/delete.html b/KatherineK/books/templates/delete.html deleted file mode 100644 index c9f4ea1..0000000 --- a/KatherineK/books/templates/delete.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Delete a Book - - - -
-

Delete {{ title }}?

- -
- -
-
- -
- -
- - - - diff --git a/KatherineK/books/templates/index.html b/KatherineK/books/templates/index.html deleted file mode 100644 index 887ce36..0000000 --- a/KatherineK/books/templates/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Library - - - - - - -
-

Your Library

- - - - - - - - - - {% for book in books %} - - - - - - - {% endfor %} -
TitleAuthorPublishedDate Added
{{ book['title'] }} {{ book['author'] }} {{ book['year_published'] }} {{ book['created_at'] }} -
- -
-
- -
-
-
-
- -
-
- - - diff --git a/KatherineK/books/templates/update.html b/KatherineK/books/templates/update.html deleted file mode 100644 index e50c16f..0000000 --- a/KatherineK/books/templates/update.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Update a Book - - - -
-

Update {{ title }}

-
- -
-
- -
-
- -
-
- -
-
- -
-
- - - - diff --git a/KatherineK/callcenter.py b/KatherineK/callcenter.py deleted file mode 100644 index da32bcb..0000000 --- a/KatherineK/callcenter.py +++ /dev/null @@ -1,92 +0,0 @@ - -# "Hacker Level" - -#Create class CallCenter, with methods add, remove, removebyphone, info, and sort - -class CallCenter(object) : - def __init__(self) : - self.calls = [] - self.queuesize = 0 - - def add(self, call) : - self.calls.append(call) - self.queuesize += 1 - - def remove(self, call) : - self.calls.remove(call) - self.queuesize -= 1 - - def removebyphone(self, phone) : - for calls in self.calls : - if calls.phone == phone : - self.remove(calls) - print "------------------" - self.info() - - def info(self) : - for calls in self.calls : - calls.display() - print self.queuesize - -# Selection sorts by hour, then bubble sorts by min. Yes, I know I could just use .sort() but this is good practice - def sort(self) : - a = 0 - temp = 0 - for calls in self.calls : - for i in range(a, len(self.calls)) : - if self.calls[a].hour > self.calls[i].hour : - temp = self.calls[a] - self.calls[a] = self.calls[i] - self.calls[i] = temp - a += 1 - for calls in self.calls : - for i in range(a, len(self.calls)) : - if self.calls[a].hour == self.calls[i].hour and self.calls[a].min > self.calls[a].min : - self.calls[a], self.calls[i] = self.calls[i], self.calls[a] - print "------------------" - self.info() - - -# create class Call, with method display - -class Call(object): - id = 1 - def __init__(self, name, phone, hour, min, reason, id=id): - self.id = Call.id - self.name = name - self.phone = phone - self.hour = hour - self.min = min - self.reason = reason - Call.id += 1 - - def display(self): - print "Id: {} / Name: {} / Phone: {} / Time: {}:{} / Reason: {}".format(self.id, self.name, self.phone, self.hour, self.min, self.reason) - -# Testing: - -# Create new instance of CallCenter -callcenter1 = CallCenter() - -# Create 5 instances of Call -call1 = Call('Holly', 214, 1, 30, "question") -call2 = Call('Phylis', 225, 2, 30, "question") -call3 = Call('GlAdos', 298, 3, 30, "complaint") -call4 = Call('Chel', 456, 1, 20, "inaudible") -call5 = Call('Annie', 879, 6, 30, "question") - -# Add calls using .add() method - -incoming = [call1, call2, call3, call4, call5] - -for calls in incoming : - CallCenter.calls.add(calls) - -# Print info using .info() method, which calls .display() method in the Call class -callcenter1.info() - -# Remove a call from the call log by phone number, print remaining -callcenter1.removebyphone(214) - -#Sort the call log by time of call -callcenter1.sort() diff --git a/KatherineK/comparelists.py b/KatherineK/comparelists.py deleted file mode 100644 index 6f6ae2b..0000000 --- a/KatherineK/comparelists.py +++ /dev/null @@ -1,15 +0,0 @@ -a = [1,2,3] -b = [1,2,3] -same = 0 - -if len(a) != len(b) : - print "These lists are not the same." -else : - for i in range (0, len(a)) : - if a[i] != b[i] : - print "These lists are not the same." - break - elif a[i] == b[i] : - same += 1 -if same == len(a) : - print "These lists are the same." diff --git a/KatherineK/datetime/apps/__init__.pyc b/KatherineK/datetime/apps/__init__.pyc deleted file mode 100644 index 524e56d..0000000 Binary files a/KatherineK/datetime/apps/__init__.pyc and /dev/null differ diff --git a/KatherineK/datetime/apps/datetimeapp/__init__.pyc b/KatherineK/datetime/apps/datetimeapp/__init__.pyc deleted file mode 100644 index 8e52338..0000000 Binary files a/KatherineK/datetime/apps/datetimeapp/__init__.pyc and /dev/null differ diff --git a/KatherineK/datetime/apps/datetimeapp/admin.py b/KatherineK/datetime/apps/datetimeapp/admin.py deleted file mode 100644 index 4255847..0000000 --- a/KatherineK/datetime/apps/datetimeapp/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/KatherineK/datetime/apps/datetimeapp/admin.pyc b/KatherineK/datetime/apps/datetimeapp/admin.pyc deleted file mode 100644 index 1babeb7..0000000 Binary files a/KatherineK/datetime/apps/datetimeapp/admin.pyc and /dev/null differ diff --git a/KatherineK/datetime/apps/datetimeapp/apps.py b/KatherineK/datetime/apps/datetimeapp/apps.py deleted file mode 100644 index f5268b7..0000000 --- a/KatherineK/datetime/apps/datetimeapp/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class DatetimeappConfig(AppConfig): - name = 'datetimeapp' diff --git a/KatherineK/datetime/apps/datetimeapp/migrations/__init__.pyc b/KatherineK/datetime/apps/datetimeapp/migrations/__init__.pyc deleted file mode 100644 index 63f9fcc..0000000 Binary files a/KatherineK/datetime/apps/datetimeapp/migrations/__init__.pyc and /dev/null differ diff --git a/KatherineK/datetime/apps/datetimeapp/models.py b/KatherineK/datetime/apps/datetimeapp/models.py deleted file mode 100644 index c827610..0000000 --- a/KatherineK/datetime/apps/datetimeapp/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/KatherineK/datetime/apps/datetimeapp/models.pyc b/KatherineK/datetime/apps/datetimeapp/models.pyc deleted file mode 100644 index ec6ea14..0000000 Binary files a/KatherineK/datetime/apps/datetimeapp/models.pyc and /dev/null differ diff --git a/KatherineK/datetime/apps/datetimeapp/static/datetimeapp/css/main.css b/KatherineK/datetime/apps/datetimeapp/static/datetimeapp/css/main.css deleted file mode 100644 index 69a2e27..0000000 --- a/KatherineK/datetime/apps/datetimeapp/static/datetimeapp/css/main.css +++ /dev/null @@ -1,15 +0,0 @@ -body { - background-color: rgb(179, 239, 196); - text-align: center; -} - -h2, .datetime { - border-color: black; - border-style: dotted; - border-width: 2px; - width: 400px; -} - -.datetime { - font-size: 24px; -} diff --git a/KatherineK/datetime/apps/datetimeapp/templates/datetimeapp/index.html b/KatherineK/datetime/apps/datetimeapp/templates/datetimeapp/index.html deleted file mode 100644 index 196ade0..0000000 --- a/KatherineK/datetime/apps/datetimeapp/templates/datetimeapp/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Datetime - {% load static %} - - - - -

The current date and time:

- -
- {{ date }} -
- {{ time }} -
- - - - diff --git a/KatherineK/datetime/apps/datetimeapp/tests.py b/KatherineK/datetime/apps/datetimeapp/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/KatherineK/datetime/apps/datetimeapp/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/KatherineK/datetime/apps/datetimeapp/urls.py b/KatherineK/datetime/apps/datetimeapp/urls.py deleted file mode 100644 index 55d79ec..0000000 --- a/KatherineK/datetime/apps/datetimeapp/urls.py +++ /dev/null @@ -1,9 +0,0 @@ - - -from django.conf.urls import url -from . import views - - -urlpatterns = [ - url(r'^$', views.index), -] diff --git a/KatherineK/datetime/apps/datetimeapp/urls.pyc b/KatherineK/datetime/apps/datetimeapp/urls.pyc deleted file mode 100644 index 30ff12d..0000000 Binary files a/KatherineK/datetime/apps/datetimeapp/urls.pyc and /dev/null differ diff --git a/KatherineK/datetime/apps/datetimeapp/views.py b/KatherineK/datetime/apps/datetimeapp/views.py deleted file mode 100644 index 60b2958..0000000 --- a/KatherineK/datetime/apps/datetimeapp/views.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals -from django.shortcuts import render, redirect -from django.http import HttpResponse -from django.contrib import messages -from time import gmtime, strftime -from django.utils.crypto import get_random_string -from models import * - -def index(request): - date = strftime("%Y-%m-%d", gmtime()) - time = strftime("%H:%M:%S", gmtime()) - print get_random_string(length=14) - context = { - "date": date, - "time": time - } - return render(request, "datetimeapp/index.html", context) diff --git a/KatherineK/datetime/apps/datetimeapp/views.pyc b/KatherineK/datetime/apps/datetimeapp/views.pyc deleted file mode 100644 index 8596738..0000000 Binary files a/KatherineK/datetime/apps/datetimeapp/views.pyc and /dev/null differ diff --git a/KatherineK/datetime/datetime.zip b/KatherineK/datetime/datetime.zip deleted file mode 100644 index df2f123..0000000 Binary files a/KatherineK/datetime/datetime.zip and /dev/null differ diff --git a/KatherineK/datetime/db.sqlite3 b/KatherineK/datetime/db.sqlite3 deleted file mode 100644 index da0ecc6..0000000 Binary files a/KatherineK/datetime/db.sqlite3 and /dev/null differ diff --git a/KatherineK/datetime/main/__init__.pyc b/KatherineK/datetime/main/__init__.pyc deleted file mode 100644 index da2b2ca..0000000 Binary files a/KatherineK/datetime/main/__init__.pyc and /dev/null differ diff --git a/KatherineK/datetime/main/settings.pyc b/KatherineK/datetime/main/settings.pyc deleted file mode 100644 index 2088046..0000000 Binary files a/KatherineK/datetime/main/settings.pyc and /dev/null differ diff --git a/KatherineK/datetime/main/urls.py b/KatherineK/datetime/main/urls.py deleted file mode 100644 index 9d3abda..0000000 --- a/KatherineK/datetime/main/urls.py +++ /dev/null @@ -1,22 +0,0 @@ -"""main URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url, include -from django.contrib import admin - -urlpatterns = [ - url(r'^', include('apps.datetimeapp.urls')), - url(r'^datetime/', include("apps.datetimeapp.urls")), -] diff --git a/KatherineK/datetime/main/urls.pyc b/KatherineK/datetime/main/urls.pyc deleted file mode 100644 index c864c06..0000000 Binary files a/KatherineK/datetime/main/urls.pyc and /dev/null differ diff --git a/KatherineK/datetime/main/wsgi.py b/KatherineK/datetime/main/wsgi.py deleted file mode 100644 index 064e759..0000000 --- a/KatherineK/datetime/main/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for main project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - -application = get_wsgi_application() diff --git a/KatherineK/datetime/main/wsgi.pyc b/KatherineK/datetime/main/wsgi.pyc deleted file mode 100644 index 14707fd..0000000 Binary files a/KatherineK/datetime/main/wsgi.pyc and /dev/null differ diff --git a/KatherineK/findcharacters.py b/KatherineK/findcharacters.py deleted file mode 100644 index 228ab84..0000000 --- a/KatherineK/findcharacters.py +++ /dev/null @@ -1,15 +0,0 @@ -# input -word_list = ['hello','world','my','name','is','Anna'] -char = 'o' - -# expected output -# new_list = ['hello','world'] - -new_list = [] - -for word in word_list: - for letter in word: - if letter == char: - new_list.append(word) - break -print new_list diff --git a/KatherineK/hospital.py b/KatherineK/hospital.py deleted file mode 100644 index acfd711..0000000 --- a/KatherineK/hospital.py +++ /dev/null @@ -1,170 +0,0 @@ -# Hospital Assignment - -# Create Hospital with methods admit, discharge -import random - -class Hospital(object): - def __init__(self, name, capacity): - self.name = name - self.capacity = capacity - self.patients = [] - self.meds = 10 - - def admit(self, patient): - if len(self.patients) == self.capacity : - print "There are no beds available at this time." - else: - self.patients.append(patient) - patient.inpatient() - print "Patient admitted." - return self - - def discharge(self, patient): - self.patients.remove(patient) - print "Patient discharged." - return self - - def dispense(self, pills): - self.meds -= pills - return self - -class Doctor(object): - def __init__(self, name): - self.name = name - print "Hello, Dr. {}." .format(self.name) - - def admit(self, patient, reply): - if reply == "Y" or reply == "y" or reply == "Yes" : - mercywest.admit(patient) - return self - else: - initiatenewpatient() - - def discharge(self, patient): - mercywest.discharge(patient) - return self - - def choosetreatment(self, patient): - self.treat(patient, raw_input("Would you like to prescribe medication (M), or perform surgery (S)?")) - - def treat(self, patient, plan): - if plan == "M" or plan == "m": - self.medicate(patient, int(raw_input("How many pills (1-10) would you like to prescribe?"))) - if plan == "S" or plan == "s" : - self.surgery(patient) - - def medicate(self, patient, pills): - mercywest.dispense(pills) - if patient.allergies == 1 : - allergicreaction = random.random()*100 - if allergicreaction <= 40 : - patient.sicken(30) - print "Your patient had an allergic reaction to the medication you prescribed." - return self - patient.heal(20) - patient.display() - return self - - def surgery(self, patient): - outcome = random.random()*100 - if outcome <= 10 : - print "Your patient coded on the table and died." - return self - if patient.health >= 50 : - patient.heal(30) - patient.display() - return self - patient.heal(10) - patient.display() - self.choosetreatment(patient) - return self - -# Create class Patient, add methods .heal() and .sicken() -class Patient(object): - id = 1 - def __init__(self, firstname, lastname, age): - self.id = Patient.id - self.firstname = firstname - self.lastname = lastname - self.age = age - allergies = random.random() - if allergies < 0.5 : - self.allergies = 1 - else : - self.allergies = 0 - self.bednumber = 0 - self.health = int((random.random())*100) - self.status = "New Patient" - Patient.id += 1 - print "New Patient status report:" - self.display() - - def inpatient(self): - self.bednumber = int(random.random()+100) - self.status = "Admitted" - return self - - def recover(self): - self.status = "Discharged" - self.bednumber = 0 - self.display - print "You patient has fully recovered! Good job Dr. {}!" .format(doctor.name) - - def heal(self, val): - if self.health > 100 : - self.recover - self.health += val - doctor.choosetreatment(self) - return self - - def sicken(self, val): - if self.health < 20 : - print "Your patient has died." - return self - self.health -= val - doctor.choosetreatment(patient) - return self - - def display(self): - print "*"*25 - print "Stats:" - print "{}, {} // Age: {}" .format(self.lastname, self.firstname, self.age) - print "{} // Bednumber: {}" .format(self.status, self.bednumber) - print "Allergies: {} // Current Health: {}/100" .format(self.allergies, self.health) - print "*"*25 - - - - -#GamePlay: - - - -# Create an instance of Hospital - -mercywest = Hospital("Mercy West", 5) - -# Create and instance of doctor - -doctor = Doctor(raw_input("You are a doctor at Mercy West Hospital. What is your name? ")) - -# Create a new patient: - -def initiatenewpatient(): - - patient = Patient(raw_input("You have a new patient. What is his/her first name? "), raw_input("What is his/her last name? "), raw_input("What is his/her age? ")) - - if patient.health > 75 : - print "Your patient needs treatment." - else : - print "Your patient needs treatment urgently." - doctor.admit(patient, raw_input("Would you like to admit him/her to your hospital? Y/N --")) - - print "Your patient needs a treatment plan. You can choose between medication and surgery. Medication may cause an allergic reaction, but can improve patient health. Surgery can, in rare cases, be fatal, but if your patient's health is over 50, it may be curative." - - doctor.choosetreatment(patient) - -# Begin Game - -initiatenewpatient() - diff --git a/KatherineK/multi/apps/__init__.pyc b/KatherineK/multi/apps/__init__.pyc deleted file mode 100644 index 928669b..0000000 Binary files a/KatherineK/multi/apps/__init__.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/blogs_app/__init__.pyc b/KatherineK/multi/apps/blogs_app/__init__.pyc deleted file mode 100644 index 1f06eae..0000000 Binary files a/KatherineK/multi/apps/blogs_app/__init__.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/blogs_app/admin.py b/KatherineK/multi/apps/blogs_app/admin.py deleted file mode 100644 index 4255847..0000000 --- a/KatherineK/multi/apps/blogs_app/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/KatherineK/multi/apps/blogs_app/admin.pyc b/KatherineK/multi/apps/blogs_app/admin.pyc deleted file mode 100644 index 7cc75c4..0000000 Binary files a/KatherineK/multi/apps/blogs_app/admin.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/blogs_app/apps.py b/KatherineK/multi/apps/blogs_app/apps.py deleted file mode 100644 index 6b464d7..0000000 --- a/KatherineK/multi/apps/blogs_app/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class MultiConfig(AppConfig): - name = 'multi' diff --git a/KatherineK/multi/apps/blogs_app/migrations/__init__.pyc b/KatherineK/multi/apps/blogs_app/migrations/__init__.pyc deleted file mode 100644 index e44ea36..0000000 Binary files a/KatherineK/multi/apps/blogs_app/migrations/__init__.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/blogs_app/models.py b/KatherineK/multi/apps/blogs_app/models.py deleted file mode 100644 index c827610..0000000 --- a/KatherineK/multi/apps/blogs_app/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/KatherineK/multi/apps/blogs_app/models.pyc b/KatherineK/multi/apps/blogs_app/models.pyc deleted file mode 100644 index 44095fa..0000000 Binary files a/KatherineK/multi/apps/blogs_app/models.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/blogs_app/static/blogs/css/main.css b/KatherineK/multi/apps/blogs_app/static/blogs/css/main.css deleted file mode 100644 index 69a2e27..0000000 --- a/KatherineK/multi/apps/blogs_app/static/blogs/css/main.css +++ /dev/null @@ -1,15 +0,0 @@ -body { - background-color: rgb(179, 239, 196); - text-align: center; -} - -h2, .datetime { - border-color: black; - border-style: dotted; - border-width: 2px; - width: 400px; -} - -.datetime { - font-size: 24px; -} diff --git a/KatherineK/multi/apps/blogs_app/templates/blogs/destroy.html b/KatherineK/multi/apps/blogs_app/templates/blogs/destroy.html deleted file mode 100644 index bf8536d..0000000 --- a/KatherineK/multi/apps/blogs_app/templates/blogs/destroy.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/KatherineK/multi/apps/blogs_app/templates/blogs/display.html b/KatherineK/multi/apps/blogs_app/templates/blogs/display.html deleted file mode 100644 index 0c9c19c..0000000 --- a/KatherineK/multi/apps/blogs_app/templates/blogs/display.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/KatherineK/multi/apps/blogs_app/templates/blogs/edit.html b/KatherineK/multi/apps/blogs_app/templates/blogs/edit.html deleted file mode 100644 index 0c9c19c..0000000 --- a/KatherineK/multi/apps/blogs_app/templates/blogs/edit.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/KatherineK/multi/apps/blogs_app/templates/blogs/index.html b/KatherineK/multi/apps/blogs_app/templates/blogs/index.html deleted file mode 100644 index 48d78bc..0000000 --- a/KatherineK/multi/apps/blogs_app/templates/blogs/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Blogs - {% load static %} - - - - -

This is where blogs will go.

- -
-

The current date and time:

-

{{ date }}

-

{{ time }}

-
- - - - diff --git a/KatherineK/multi/apps/blogs_app/templates/blogs/new.html b/KatherineK/multi/apps/blogs_app/templates/blogs/new.html deleted file mode 100644 index 0c9c19c..0000000 --- a/KatherineK/multi/apps/blogs_app/templates/blogs/new.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/KatherineK/multi/apps/blogs_app/tests.py b/KatherineK/multi/apps/blogs_app/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/KatherineK/multi/apps/blogs_app/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/KatherineK/multi/apps/blogs_app/urls.py b/KatherineK/multi/apps/blogs_app/urls.py deleted file mode 100644 index 8edfed8..0000000 --- a/KatherineK/multi/apps/blogs_app/urls.py +++ /dev/null @@ -1,10 +0,0 @@ -from django.conf.urls import url -from . import views -urlpatterns = [ - url(r'^$', views.index), - url(r'^new$', views.new), - url(r'^create$', views.create), - url(r'^(?P\d+)$', views.display), - url(r'^(?P\d+)/edit$', views.edit), - url(r'^(?P\d+)/delete$', views.destroy) -] diff --git a/KatherineK/multi/apps/blogs_app/urls.pyc b/KatherineK/multi/apps/blogs_app/urls.pyc deleted file mode 100644 index 162913d..0000000 Binary files a/KatherineK/multi/apps/blogs_app/urls.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/blogs_app/views.py b/KatherineK/multi/apps/blogs_app/views.py deleted file mode 100644 index b52bab7..0000000 --- a/KatherineK/multi/apps/blogs_app/views.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals -from django.shortcuts import render, redirect -from django.http import HttpResponse -from django.contrib import messages -from time import gmtime, strftime -from django.utils.crypto import get_random_string -from models import * - -def index(request): - date = strftime("%Y-%m-%d", gmtime()) - time = strftime("%H:%M:%S", gmtime()) - print get_random_string(length=14) - context = { - "date": date, - "time": time - } - return render(request, "blogs/index.html", context) - # to add later as third argument: {"blogs: Blog.objects.all()"} - -def new(request): - return render(request, "blogs/new.html") - -def create(request): - return redirect("/new") - -def display(request, number): - return HttpResponse("placeholder to display blog {}" .format(number)) - # return render(request, "blogs/display.html", {"blog": Blog.objects.get(number=number)}) - -def edit(request, number): - return HttpResponse("placeholder to edit blog {}" .format(number)) - # return render(request, "blogs/edit.html", {"blog": Blog.objects.get(number=number)}) - -def destroy(request, number): - return redirect ('/') - # return render(request, "blogs/destroy.html", {"blog": Blog.objects.get(number=number)}) diff --git a/KatherineK/multi/apps/blogs_app/views.pyc b/KatherineK/multi/apps/blogs_app/views.pyc deleted file mode 100644 index d4c2c8a..0000000 Binary files a/KatherineK/multi/apps/blogs_app/views.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/surveys_app/__init__.pyc b/KatherineK/multi/apps/surveys_app/__init__.pyc deleted file mode 100644 index fbeee76..0000000 Binary files a/KatherineK/multi/apps/surveys_app/__init__.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/surveys_app/admin.py b/KatherineK/multi/apps/surveys_app/admin.py deleted file mode 100644 index 4255847..0000000 --- a/KatherineK/multi/apps/surveys_app/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/KatherineK/multi/apps/surveys_app/admin.pyc b/KatherineK/multi/apps/surveys_app/admin.pyc deleted file mode 100644 index f41c5c8..0000000 Binary files a/KatherineK/multi/apps/surveys_app/admin.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/surveys_app/apps.py b/KatherineK/multi/apps/surveys_app/apps.py deleted file mode 100644 index 11a79ab..0000000 --- a/KatherineK/multi/apps/surveys_app/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class SurveysAppConfig(AppConfig): - name = 'surveys_app' diff --git a/KatherineK/multi/apps/surveys_app/migrations/__init__.pyc b/KatherineK/multi/apps/surveys_app/migrations/__init__.pyc deleted file mode 100644 index 8c55aaf..0000000 Binary files a/KatherineK/multi/apps/surveys_app/migrations/__init__.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/surveys_app/models.py b/KatherineK/multi/apps/surveys_app/models.py deleted file mode 100644 index c827610..0000000 --- a/KatherineK/multi/apps/surveys_app/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/KatherineK/multi/apps/surveys_app/models.pyc b/KatherineK/multi/apps/surveys_app/models.pyc deleted file mode 100644 index 0a62726..0000000 Binary files a/KatherineK/multi/apps/surveys_app/models.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/surveys_app/templates/surveys/index.html b/KatherineK/multi/apps/surveys_app/templates/surveys/index.html deleted file mode 100644 index 0cdd361..0000000 --- a/KatherineK/multi/apps/surveys_app/templates/surveys/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Surveys - {% load static %} - - - -

This is where surveys will go.

- - diff --git a/KatherineK/multi/apps/surveys_app/templates/surveys/new.html b/KatherineK/multi/apps/surveys_app/templates/surveys/new.html deleted file mode 100644 index a1b31a9..0000000 --- a/KatherineK/multi/apps/surveys_app/templates/surveys/new.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/KatherineK/multi/apps/surveys_app/tests.py b/KatherineK/multi/apps/surveys_app/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/KatherineK/multi/apps/surveys_app/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/KatherineK/multi/apps/surveys_app/urls.py b/KatherineK/multi/apps/surveys_app/urls.py deleted file mode 100644 index e3ea740..0000000 --- a/KatherineK/multi/apps/surveys_app/urls.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.conf.urls import url -from . import views -urlpatterns = [ - url(r'^$', views.index), - url(r'^new$', views.new), -] diff --git a/KatherineK/multi/apps/surveys_app/urls.pyc b/KatherineK/multi/apps/surveys_app/urls.pyc deleted file mode 100644 index d0ff9d8..0000000 Binary files a/KatherineK/multi/apps/surveys_app/urls.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/surveys_app/views.py b/KatherineK/multi/apps/surveys_app/views.py deleted file mode 100644 index 1f97f85..0000000 --- a/KatherineK/multi/apps/surveys_app/views.py +++ /dev/null @@ -1,11 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.shortcuts import render, redirect -from django.http import HttpResponse - -def index(request): - return HttpResponse("placeholder for later to display all surveys created") - -def new(request): - return HttpResponse("placeholder for users to add a new survey")# Create your views here. diff --git a/KatherineK/multi/apps/surveys_app/views.pyc b/KatherineK/multi/apps/surveys_app/views.pyc deleted file mode 100644 index 37de849..0000000 Binary files a/KatherineK/multi/apps/surveys_app/views.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/users_app/__init__.pyc b/KatherineK/multi/apps/users_app/__init__.pyc deleted file mode 100644 index bbd4493..0000000 Binary files a/KatherineK/multi/apps/users_app/__init__.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/users_app/admin.py b/KatherineK/multi/apps/users_app/admin.py deleted file mode 100644 index 4255847..0000000 --- a/KatherineK/multi/apps/users_app/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/KatherineK/multi/apps/users_app/admin.pyc b/KatherineK/multi/apps/users_app/admin.pyc deleted file mode 100644 index 23282c5..0000000 Binary files a/KatherineK/multi/apps/users_app/admin.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/users_app/apps.py b/KatherineK/multi/apps/users_app/apps.py deleted file mode 100644 index cf63370..0000000 --- a/KatherineK/multi/apps/users_app/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class UsersAppConfig(AppConfig): - name = 'users_app' diff --git a/KatherineK/multi/apps/users_app/migrations/__init__.pyc b/KatherineK/multi/apps/users_app/migrations/__init__.pyc deleted file mode 100644 index b1b2a47..0000000 Binary files a/KatherineK/multi/apps/users_app/migrations/__init__.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/users_app/models.py b/KatherineK/multi/apps/users_app/models.py deleted file mode 100644 index c827610..0000000 --- a/KatherineK/multi/apps/users_app/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/KatherineK/multi/apps/users_app/models.pyc b/KatherineK/multi/apps/users_app/models.pyc deleted file mode 100644 index ad180b3..0000000 Binary files a/KatherineK/multi/apps/users_app/models.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/users_app/templates/users/index.html b/KatherineK/multi/apps/users_app/templates/users/index.html deleted file mode 100644 index d86d058..0000000 --- a/KatherineK/multi/apps/users_app/templates/users/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Users - {% load static %} - - - - This is where users will go. - - diff --git a/KatherineK/multi/apps/users_app/templates/users/login.html b/KatherineK/multi/apps/users_app/templates/users/login.html deleted file mode 100644 index 8d44f59..0000000 --- a/KatherineK/multi/apps/users_app/templates/users/login.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/KatherineK/multi/apps/users_app/templates/users/register.html b/KatherineK/multi/apps/users_app/templates/users/register.html deleted file mode 100644 index 8d44f59..0000000 --- a/KatherineK/multi/apps/users_app/templates/users/register.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/KatherineK/multi/apps/users_app/tests.py b/KatherineK/multi/apps/users_app/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/KatherineK/multi/apps/users_app/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/KatherineK/multi/apps/users_app/urls.py b/KatherineK/multi/apps/users_app/urls.py deleted file mode 100644 index 506f942..0000000 --- a/KatherineK/multi/apps/users_app/urls.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.conf.urls import url -from . import views -urlpatterns = [ - url(r'^$', views.index), - url(r'^new', views.register), - url(r'^register$', views.register), - url(r'^login$', views.login), -] diff --git a/KatherineK/multi/apps/users_app/urls.pyc b/KatherineK/multi/apps/users_app/urls.pyc deleted file mode 100644 index 9be2475..0000000 Binary files a/KatherineK/multi/apps/users_app/urls.pyc and /dev/null differ diff --git a/KatherineK/multi/apps/users_app/views.py b/KatherineK/multi/apps/users_app/views.py deleted file mode 100644 index aa64a79..0000000 --- a/KatherineK/multi/apps/users_app/views.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.shortcuts import render, redirect -from django.http import HttpResponse - -def index(request): - return HttpResponse("placeholder to display all the list of users") - -def register(request): - return HttpResponse("placeholder for users to create a new user record") - -def login(request): - return HttpResponse("placeholder for users to login") diff --git a/KatherineK/multi/apps/users_app/views.pyc b/KatherineK/multi/apps/users_app/views.pyc deleted file mode 100644 index b29f92b..0000000 Binary files a/KatherineK/multi/apps/users_app/views.pyc and /dev/null differ diff --git a/KatherineK/multi/db.sqlite3 b/KatherineK/multi/db.sqlite3 deleted file mode 100644 index da0ecc6..0000000 Binary files a/KatherineK/multi/db.sqlite3 and /dev/null differ diff --git a/KatherineK/multi/main/__init__.pyc b/KatherineK/multi/main/__init__.pyc deleted file mode 100644 index e741297..0000000 Binary files a/KatherineK/multi/main/__init__.pyc and /dev/null differ diff --git a/KatherineK/multi/main/settings.py b/KatherineK/multi/main/settings.py deleted file mode 100644 index 9a2c162..0000000 --- a/KatherineK/multi/main/settings.py +++ /dev/null @@ -1,123 +0,0 @@ -""" -Django settings for main project. - -Generated by 'django-admin startproject' using Django 1.11.5. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'zjve51c)864m$x4-fy3uw&o8px57w*+klpet79ww5_je@2%ip2' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'apps.blogs_app', - 'apps.surveys_app', - 'apps.users_app', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'main.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'main.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/KatherineK/multi/main/settings.pyc b/KatherineK/multi/main/settings.pyc deleted file mode 100644 index 180c546..0000000 Binary files a/KatherineK/multi/main/settings.pyc and /dev/null differ diff --git a/KatherineK/multi/main/urls.py b/KatherineK/multi/main/urls.py deleted file mode 100644 index 7c85c0e..0000000 --- a/KatherineK/multi/main/urls.py +++ /dev/null @@ -1,24 +0,0 @@ -"""main URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url, include -from django.contrib import admin - -urlpatterns = [ - url(r'^', include('apps.blogs_app.urls')), - url(r'^blogs/', include('apps.blogs_app.urls')), - url(r'^surveys/', include('apps.surveys_app.urls')), - url(r'^users/', include('apps.users_app.urls')), -] diff --git a/KatherineK/multi/main/urls.pyc b/KatherineK/multi/main/urls.pyc deleted file mode 100644 index 608343a..0000000 Binary files a/KatherineK/multi/main/urls.pyc and /dev/null differ diff --git a/KatherineK/multi/main/wsgi.py b/KatherineK/multi/main/wsgi.py deleted file mode 100644 index 064e759..0000000 --- a/KatherineK/multi/main/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for main project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - -application = get_wsgi_application() diff --git a/KatherineK/multi/main/wsgi.pyc b/KatherineK/multi/main/wsgi.pyc deleted file mode 100644 index bc6d3d0..0000000 Binary files a/KatherineK/multi/main/wsgi.pyc and /dev/null differ diff --git a/KatherineK/multi/manage.py b/KatherineK/multi/manage.py deleted file mode 100644 index 1a1848d..0000000 --- a/KatherineK/multi/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/KatherineK/multi/multi.zip b/KatherineK/multi/multi.zip deleted file mode 100644 index bc3d1ef..0000000 Binary files a/KatherineK/multi/multi.zip and /dev/null differ diff --git a/KatherineK/names.py b/KatherineK/names.py deleted file mode 100644 index 60233bc..0000000 --- a/KatherineK/names.py +++ /dev/null @@ -1,51 +0,0 @@ -# Part 1 - -students = [ - {'first_name': 'Michael', 'last_name' : 'Jordan'}, - {'first_name' : 'John', 'last_name' : 'Rosales'}, - {'first_name' : 'Mark', 'last_name' : 'Guillen'}, - {'first_name' : 'KB', 'last_name' : 'Tonel'} -] - -for i in range (0, len(students)) : - print "{} {}" .format(students[i]["first_name"],students[i]["last_name"]) - - -print "-------------------------" - -# Part 2 - - -users = { - 'Students': [ - {'first_name': 'Michael', 'last_name' : 'Jordan'}, - {'first_name' : 'John', 'last_name' : 'Rosales'}, - {'first_name' : 'Mark', 'last_name' : 'Guillen'}, - {'first_name' : 'KB', 'last_name' : 'Tonel'} - ], - 'Instructors': [ - {'first_name' : 'Michael', 'last_name' : 'Choi'}, - {'first_name' : 'Martin', 'last_name' : 'Puryear'} - ] - } - -i = 0 -a = 1 - -print "Students" -for items in users["Students"] : - print "{} - {} {} - {}" .format(a, users["Students"][i]["first_name"], users["Students"][i]["last_name"], len(users["Students"][i]["first_name"])+len(users["Students"][i]["last_name"])) - i += 1 - a += 1 - -i = 0 -a = 1 - -print "Instructors" -for items in users["Instructors"] : - print "{} - {} {} - {}" .format(a, users["Instructors"][i]["first_name"], users["Instructors"][i]["last_name"], len(users["Instructors"][i]["first_name"])+len(users["Instructors"][i]["last_name"])) - i += 1 - a += 1 - - - # diff --git a/KatherineK/ninjagold/server.py b/KatherineK/ninjagold/server.py deleted file mode 100644 index 736dfc6..0000000 --- a/KatherineK/ninjagold/server.py +++ /dev/null @@ -1,68 +0,0 @@ -import random -from flask import Flask, render_template, request, redirect, session -app=Flask(__name__) - -app.secret_key = "secret" - -@app.route('/', methods=['GET', 'POST']) -def index(): - if "goldcount" not in session : - session['goldcount'] = 0 - if "gold" not in session : - session['gold'] = 0 - if "activity" not in session : - session['activity'] = "" - if "earned" not in session : - session['earned'] = "" - if "log" not in session : - session['log'] = [] - - - - return render_template("index.html", goldcount=session['goldcount'], log=session['log']) - - - -@app.route('/process_money', methods=['POST']) -def process_money(): - if request.form['button'] == "farm": - session['gold'] = random.randrange(10,21) - session['activity'] = request.form['button'] - if request.form['button'] == "cave": - session['gold'] = random.randrange(5,11) - session['activity'] = request.form['button'] - if request.form['button'] == "house": - session['gold'] = random.randrange(2,6) - session['activity'] = request.form['button'] - if request.form['button'] == "casino": - session['gold'] = random.randrange(-50,51) - session['activity'] = request.form['button'] - session['goldcount'] += session['gold'] - if session['gold'] > 0 : - session['earned'] = "earned" - else : - session ['earned'] = "lost" - - earned=session['earned'] - gold=session['gold'] - location=session['activity'] - - entry = { - "gold": gold, - "location": location, - "earned": earned, - } - - session['log'].append(entry) - - return redirect ("/") - -@app.route('/reset', methods=['POST']) -def reset(): - session['goldcount'] = 0 - session['gold'] = 0 - session.pop('log') - return redirect ("/") - - -app.run(debug=True) diff --git a/KatherineK/ninjagold/static/css/index.css b/KatherineK/ninjagold/static/css/index.css deleted file mode 100644 index 02d469e..0000000 --- a/KatherineK/ninjagold/static/css/index.css +++ /dev/null @@ -1,74 +0,0 @@ -body { - background-color: #57a8a8; - font-family: sans-serif; -} - -h4, h1 { - margin-left: 20px; -} - -h5 { - font-size: 14px -} - - -p { - font-size: 10px; - font-style: italic; -} - -h5, p { - width: 100px; -} - -.center { - width: 1200px; - height: 100px; - padding: 20px; -} - -.actions { - padding: 10px; - text-align: center; - vertical-align: top; - border-style: solid; - border-width: 1px; - border-color: #2d5e5e; - display: inline-block; - width: 100px; - height: 110px; - background-color: #adf7f7; - color: #2d5e5e; -} - -#subtitle { - font-size: 8px; -} - -.activities { - margin-top: 50px; -} - -#log { - padding: 10px; - text-align: center; - vertical-align: top; - border-style: solid; - border-width: 1px; - border-color: #2d5e5e; - display: inline-block; - width: 480px; - margin-left: 20px; - background-color: #adf7f7; - color: #2d5e5e; -} - -#log p { - width: 460px; - text-align: left; - font-size: 12px; -} -.reset { - margin-top: 20px; - margin-left: 20px; -} diff --git a/KatherineK/ninjagold/templates/index.html b/KatherineK/ninjagold/templates/index.html deleted file mode 100644 index d9daa03..0000000 --- a/KatherineK/ninjagold/templates/index.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Ninja Gold - - - -
-

Ninja Gold

-

Your Gold: {{goldcount}}

-
- -
-
-
Farm
-

(earns 10-20 golds)

-

-
- -
-
Cave
-

(earns 5-10 golds)

-

-
- -
-
House
-

(earns 2-5 golds)

-

-
- -
-
Casino
-

(earns/takes 50 golds)

-

-
- - -
- - - -
-

Activites:

-
- - - - {% for entry in log %} - - - - {% endfor %} - -
-

You {{ entry['earned'] }} {{ entry['gold'] }} gold at the {{ entry['location'] }}.

-
-
-
- - -
- -
- - - diff --git a/KatherineK/ninjagold/templates/login.html b/KatherineK/ninjagold/templates/login.html deleted file mode 100644 index 794a936..0000000 --- a/KatherineK/ninjagold/templates/login.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Login Page - - - - or - - - diff --git a/KatherineK/rockpaperscissors/mysqlconnection.py b/KatherineK/rockpaperscissors/mysqlconnection.py deleted file mode 100644 index ea8f008..0000000 --- a/KatherineK/rockpaperscissors/mysqlconnection.py +++ /dev/null @@ -1,42 +0,0 @@ - - -""" import the necessary modules """ -from flask_sqlalchemy import SQLAlchemy -from sqlalchemy.sql import text -# Create a class that will give us an object that we can use to connect to a database -class MySQLConnection(object): - def __init__(self, app, db): - config = { - 'host': 'localhost', - 'database': db, # we got db as an argument - 'user': 'root', - 'password': 'root', - 'port': '3306' # change the port to match the port your SQL server is running on - } - # this will use the above values to generate the path to connect to your sql database - DATABASE_URI = "mysql://{}:{}@127.0.0.1:{}/{}".format(config['user'], config['password'], config['port'], config['database']) - app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI - app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True - # establish the connection to database - self.db = SQLAlchemy(app) - # this is the method we will use to query the database - def query_db(self, query, data=None): - result = self.db.session.execute(text(query), data) - if query[0:6].lower() == 'select': - # if the query was a select - # convert the result to a list of dictionaries - list_result = [dict(r) for r in result] - # return the results as a list of dictionaries - return list_result - elif query[0:6].lower() == 'insert': - # if the query was an insert, return the id of the - # commit changes - self.db.session.commit() - # row that was inserted - return result.lastrowid - else: - # if the query was an update or delete, return nothing and commit changes - self.db.session.commit() -# This is the module method to be called by the user in server.py. Make sure to provide the db name! -def MySQLConnector(app, db): - return MySQLConnection(app, db) diff --git a/KatherineK/rockpaperscissors/mysqlconnection.pyc b/KatherineK/rockpaperscissors/mysqlconnection.pyc deleted file mode 100644 index 804e534..0000000 Binary files a/KatherineK/rockpaperscissors/mysqlconnection.pyc and /dev/null differ diff --git a/KatherineK/rockpaperscissors/rps.sql b/KatherineK/rockpaperscissors/rps.sql deleted file mode 100644 index 295f4d6..0000000 --- a/KatherineK/rockpaperscissors/rps.sql +++ /dev/null @@ -1,3 +0,0 @@ -select * from books - - diff --git a/KatherineK/rockpaperscissors/server.py b/KatherineK/rockpaperscissors/server.py deleted file mode 100644 index bb0aad8..0000000 --- a/KatherineK/rockpaperscissors/server.py +++ /dev/null @@ -1,124 +0,0 @@ -import random, md5, re -from flask import Flask, render_template, request, redirect, session, flash -from mysqlconnection import MySQLConnector -app = Flask(__name__) -app.secret_key = "secret" -mysql = MySQLConnector(app, 'roshambodb') -EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$') - - -@app.route('/') -def front(): - return render_template('front.html') - -@app.route('/game') -def game(): - # print mysql.query_db('select * from players') - if "response" not in session: - session['response'] = "" - if "wins" not in session: - session['wins'] = "" - if "losses" not in session: - session['losses'] = "" - if "ties" not in session: - session['ties'] = "" - return render_template('index.html', response=session['response'], wins=session['wins'], losses=session['losses'], ties=session['ties']) - -@app.route('/play', methods=['POST']) -def play(): - data = 0 - query= "select * from players where idplayers = 1" - player = mysql.query_db(query)[0] - print player - - computerplay = random.randrange(1, 4) - print computerplay - - button = int(request.form['button']) - - if button == computerplay : - data = player['ties'] + 1 - session["ties"] = data - query= '''UPDATE players - set ties = :result - where idplayers = 1''' - session['response'] = "It's a tie!" - - elif (button == 1 and computerplay == 3) or (button == 2 and computerplay == 3) or (button == 3 and computerplay == 1) : - data = player['losses'] + 1 - session["losses"] = data - query= '''UPDATE players - set losses =:result - where idplayers = 1''' - session['response'] = "You lost." - - elif (button == 1 and computerplay == 2) or (button == 2 and computerplay == 1) or (button == 3 and computerplay == 2) : - data = player['wins'] + 1 - session["wins"] = data - query= '''UPDATE players - set wins =:result - where idplayers = 1''' - session['response'] = "You won." - - print query - print data - print mysql.query_db(query, {'result': data}) - return redirect ('/game') - -@app.route('/reset', methods=["post"]) -def reset(): - query= '''UPDATE players - set losses = 0 - where idplayers = 1''' - mysql.query_db(query) - - query= '''UPDATE players - set wins = 0 - where idplayers = 1''' - mysql.query_db(query) - - query= '''UPDATE players - set ties = 0 - where idplayers = 1''' - mysql.query_db(query) - - session["ties"] = 0 - session["losses"] = 0 - session["wins"] = 0 - - return redirect ('/game') - -@app.route('/users/create', methods=['POST']) -def create_user(): - if len(request.form['username']) < 1 : - flash("Please enter a username") - return redirect ('/') - else : - username = request.form['username'] - if not EMAIL_REGEX.match(request.form['email']): - flash("Please enter a valid email address") - return redirect ('/') - else : - email = request.form['email'] - password = md5.new(request.form['password']).hexdigest() - - insert_query = "INSERT INTO players (username, email, password, created_at, updated_at) VALUES (:username,:email, :password, NOW(), NOW())" - query_data = { 'username': username, 'email': email, 'password': password } - mysql.query_db(insert_query, query_data) - - return redirect ("/game") - - -@app.route('/users/login', methods=['POST']) -def login_user(): - username = request.form['username'] - password = md5.new(request.form['password']).hexdigest() - user_query = "SELECT * FROM players where players.username = :username AND players.password = :password" - query_data = { 'username': username, 'password': password} - user = mysql.query_db(user_query, query_data) - if len(user) < 1 : - flash("Unable to locate user. Please register below.") - return redirect ('/') - return redirect ("/game") - -app.run(debug=True) diff --git a/KatherineK/rockpaperscissors/static/css/index.css b/KatherineK/rockpaperscissors/static/css/index.css deleted file mode 100644 index 60e9f49..0000000 --- a/KatherineK/rockpaperscissors/static/css/index.css +++ /dev/null @@ -1,52 +0,0 @@ -body { - background-color: #c4eded; -} - -h1 { - margin-left: 100px; -} - -button { - width: 100px; - height: 30px; - margin: 30px; - background-color: #e8a594; - border-radius: 10px; - border-color: #c93d1a; - border-style: solid; - border-width: 1px; - margin-left: 30px; -} - -button:hover { - background-color: #e2b9ae; -} - -.plays { - display: inline-block; - -} -.result, .score, .login { - background-color: #b5f2ee; - border-color: #173d3a; - margin-left: 30px; -} - -.reset { - background-color: #e8a594; - border-color: #c93d1a; - margin-left: 30px; -} - -.reset, .result, .score, .login { - border-radius: 10px; - border-style: solid; - border-width: 1px; - padding-left: 10px; - width: 100px; - -} - -.login { - margin-left: 200px; -} diff --git a/KatherineK/rockpaperscissors/static/js/rock.js b/KatherineK/rockpaperscissors/static/js/rock.js deleted file mode 100644 index 616e277..0000000 --- a/KatherineK/rockpaperscissors/static/js/rock.js +++ /dev/null @@ -1,18 +0,0 @@ - - -$(document).ready(function(){ - // $('form').hide(); -}); - -// $(document).on("click", "button", function() { -// if ($("this").siblings('form').is(":hidden")) { -// $("this").siblings('form').show(); -// } -// else { -// $("this").siblings('form').hide(); -// } -// }); - -$(document).on("click", ".enter", function() { - $("this").siblings('form').show(); -}); diff --git a/KatherineK/rockpaperscissors/templates/create.html b/KatherineK/rockpaperscissors/templates/create.html deleted file mode 100644 index 56f707b..0000000 --- a/KatherineK/rockpaperscissors/templates/create.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/KatherineK/rockpaperscissors/templates/front.html b/KatherineK/rockpaperscissors/templates/front.html deleted file mode 100644 index afc8198..0000000 --- a/KatherineK/rockpaperscissors/templates/front.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Front Page - - - - - - - - -

Rock, Paper, Scissors

- - {% with messages = get_flashed_messages() %} - {% if messages %} - {% for message in messages %} -

{{message}}

- {% endfor %} - {% endif %} - {% endwith %} - -
- -
- Username: -
- Password: - -
-
-
-
-
- -
- Username: -
-
-
- Email: -
- Password: - -
-
- - - diff --git a/KatherineK/rockpaperscissors/templates/index.html b/KatherineK/rockpaperscissors/templates/index.html deleted file mode 100644 index 2a73c22..0000000 --- a/KatherineK/rockpaperscissors/templates/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - Rock, Paper, Scissors - - - - -
-
-

Wins: {{wins}}

-

Losses: {{losses}}

-

Ties: {{ties}}

-
- -
- -

Rock, Paper, Scissors

- -
- -
- -
- -
- -
- -
- -
-

{{response}}

-
- -
- - - diff --git a/KatherineK/rockpaperscissors/templates/login.html b/KatherineK/rockpaperscissors/templates/login.html deleted file mode 100644 index 6dc1587..0000000 --- a/KatherineK/rockpaperscissors/templates/login.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Login Page - - - - - diff --git a/Kyle_Marienthal/FLASK/Counter/server.py b/Kyle_Marienthal/FLASK/Counter/server.py deleted file mode 100644 index a8cc8c6..0000000 --- a/Kyle_Marienthal/FLASK/Counter/server.py +++ /dev/null @@ -1,27 +0,0 @@ -from flask import Flask, request, redirect, render_template, session -app = Flask(__name__) - -app.secret_key = "this_is_a_secret" - -@app.route("/") -def index(): - if 'count' not in session: - session['count']=0 - session['count']+=1 - return render_template('index.html', count = session['count']) - -@app.route('/doubled') -def count_two(): - session['count'] +=1 - return redirect('/') - -@app.route('/reset') -def reset(): - session.pop('count') - session['count']=0 - return redirect('/') - - - - -app.run(debug=True) diff --git a/Kyle_Marienthal/FLASK/Counter/templates/index.html b/Kyle_Marienthal/FLASK/Counter/templates/index.html deleted file mode 100644 index 180f1e2..0000000 --- a/Kyle_Marienthal/FLASK/Counter/templates/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Count - - - -

Counter

-

{{ count }} times.

- Doublemint - Reset That Counter! - - diff --git a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/server.py b/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/server.py deleted file mode 100644 index b6d39a2..0000000 --- a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/server.py +++ /dev/null @@ -1,32 +0,0 @@ -from flask import Flask, request, redirect, render_template -app = Flask(__name__) - -@app.route("/") -def index(): - return render_template("index.html") - -@app.route("/left") -def left(): - return render_template("left.html") - -@app.route("/right") -def right(): - return render_template("right.html") - -@app.route("/Reddoor") -def Reddoor(): - return render_template("Reddoor.html") - -@app.route("/TBD") -def TBD(): - return render_template("TBD.html") - -@app.route('/life') -def life(): - return redirect('/') - -@app.route('/work') -def work(): - return render_template('work.html') - -app.run(debug=True) diff --git a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/static/img/pic.png b/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/static/img/pic.png deleted file mode 100644 index f118811..0000000 Binary files a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/static/img/pic.png and /dev/null differ diff --git a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/TBD.html b/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/TBD.html deleted file mode 100644 index dbbd41b..0000000 --- a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/TBD.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Choose Your Own Adventure - - -

Choose your own Adventure

-

You enter a room with no light suddenly a giant spider appears and it eats you. Game over nerd.

- Start Over - - diff --git a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/index.html b/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/index.html deleted file mode 100644 index 4e309d7..0000000 --- a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Choose Your Own Adventure - - -

Choose your own Adventure

-

You awake in a room with two doors. Where do you go?

- left - right - - diff --git a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/left.html b/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/left.html deleted file mode 100644 index 3ee7c4e..0000000 --- a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/left.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Choose Your Own Adventure - - -

Choose your own Adventure

-

You enter a room with a giant spider and it eats you. Game over nerd.

- Start Over - - diff --git a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/reddoor.html b/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/reddoor.html deleted file mode 100644 index 4ca20ea..0000000 --- a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/reddoor.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Choose Your Own Adventure - - -

Choose your own Adventure

-

You enter a room another room and the door locks behind you. You see a round red door and a tall black door. Which do you choose?

- NSFL - NSFW - - diff --git a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/right.html b/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/right.html deleted file mode 100644 index 1020cad..0000000 --- a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/right.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Choose Your Own Adventure - - -

Choose your own Adventure

-

You enter a room another room and the door locks behind you. You see a round red door and a tall black door. Which do you choose?

- Round Red Door - Tall Black Door - - diff --git a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/work.html b/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/work.html deleted file mode 100644 index 8beb2a8..0000000 --- a/Kyle_Marienthal/FLASK/choose_your_own_adventure/choose_your_own_adventure/templates/work.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Choose Your Own Adventure - - -

You have chosen poorly

-
we know you think this is bad, but take a closer looooooook
- its just a pair of feet - - diff --git a/Kyle_Marienthal/FLASK/full_friends/mysqlconnection.py b/Kyle_Marienthal/FLASK/full_friends/mysqlconnection.py deleted file mode 100644 index 54904e7..0000000 --- a/Kyle_Marienthal/FLASK/full_friends/mysqlconnection.py +++ /dev/null @@ -1,40 +0,0 @@ -""" import the necessary modules """ -from flask_sqlalchemy import SQLAlchemy -from sqlalchemy.sql import text -# Create a class that will give us an object that we can use to connect to a database -class MySQLConnection(object): - def __init__(self, app, db): - config = { - 'host': 'localhost', - 'database': 'full_friends', # we got db as an argument - 'user': 'root', - 'password': '', - 'port': '3306' # change the port to match the port your SQL server is running on - } - # this will use the above values to generate the path to connect to your sql database - DATABASE_URI = "mysql://{}:{}@127.0.0.1:{}/{}".format(config['user'], config['password'], config['port'], config['database']) - app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI - app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True - # establish the connection to database - self.db = SQLAlchemy(app) - # this is the method we will use to query the database - def query_db(self, query, data=None): - result = self.db.session.execute(text(query), data) - if query[0:6].lower() == 'select': - # if the query was a select - # convert the result to a list of dictionaries - list_result = [dict(r) for r in result] - # return the results as a list of dictionaries - return list_result - elif query[0:6].lower() == 'insert': - # if the query was an insert, return the id of the - # commit changes - self.db.session.commit() - # row that was inserted - return result.lastrowid - else: - # if the query was an update or delete, return nothing and commit changes - self.db.session.commit() -# This is the module method to be called by the user in server.py. Make sure to provide the db name! -def MySQLConnector(app, db): - return MySQLConnection(app, db) diff --git a/Kyle_Marienthal/FLASK/full_friends/server.py b/Kyle_Marienthal/FLASK/full_friends/server.py deleted file mode 100644 index a0c1f37..0000000 --- a/Kyle_Marienthal/FLASK/full_friends/server.py +++ /dev/null @@ -1,79 +0,0 @@ -from flask import Flask, request, redirect, render_template, session, flash -from datetime import datetime -from mysqlconnection import MySQLConnector - -app = Flask(__name__) -mysql = MySQLConnector(app, 'full_friends') - -import md5, os, binascii -password = 'password' - -app.secret_key = 'secret_key' - -def validate_registration(form_data): - errors = [] - if len('name') < 2: - errors.append('need longer name') - if len('username') < 2: - errors.append('need longer username') - if len('password') < 3: - errors.append('need longer password') - if 'confirm_password' != 'password': - errors.append('confirmation doesnt match password') - - - -# Name -# Username -# Password: -# Password Confirmation -# Date of Birth - -def login_validation(): - if len('username') < 2: - errors.append('need longer username') - if len('password') < 3: - errors.append('need longer password') -# Username -# Password - -@app.route("/") -def home(): - return render_template("login_registration.html") - -@app.route("/process", methods = ["POST"]) -def process(): - salt = binascii.b2a_hex(os.urandom(15)) - hashed_pw = md5.new(request.form['password'] + salt).hexdigest() - query = "INSERT INTO users(name, username, password, app_date, created_at, updated_at, salt) VALUES(:name, :username, :password, :app_date, now(), now(), :salt)" -# the data library needs to be in the same order - data = { - 'name':request.form['name'], - 'username':request.form['username'], - 'password':request.form['password'], - 'app_date':request.form['appointment_date'], - 'salt':request.form['salt'], - - } - print '**************',mysql.query_db(query, data) - print '&&&&&&&&&&&&',request.form['appointment_date'] - # print what the user put in the form - # date = datetime.strptime(request.form['appointment_date'], '%Y-%m-%d') - # # putting the user data into the string parseDDDD time func with default date format - # date_string = date.strftime('%b %d, %y') - # # variable equals a date string in the format that you want - # current_date = datetime.now() - # # makes the current date - # - # print date_string - # if date > current_date: - # # if the date is greater then that means the number is higher/its in the future (vice versa) - # errors.append("Are you from the future?") - - return redirect("/index") - -@app.route("/index") -def index(): - return render_template("friends.html") - -app.run(debug=True) diff --git a/Kyle_Marienthal/FLASK/full_friends/templates/friends.html b/Kyle_Marienthal/FLASK/full_friends/templates/friends.html deleted file mode 100644 index 1be977b..0000000 --- a/Kyle_Marienthal/FLASK/full_friends/templates/friends.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Friends - - -

Friends:

- - - - - - {% for friend in friends %} - - - - - - {% endfor %} -
- NameAgeFriend Since{# friends name #}{#friends age#}{#how long theyve been friends#}
-

Add a Friend:

-
-

-

-

-

- - -
- - - - - - diff --git a/Kyle_Marienthal/FLASK/full_friends/templates/login_registration.html b/Kyle_Marienthal/FLASK/full_friends/templates/login_registration.html deleted file mode 100644 index d232ff5..0000000 --- a/Kyle_Marienthal/FLASK/full_friends/templates/login_registration.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Login or Register - - -

Register

-
-

-

-

-

-

-

-

-

-

-

- -
-

Login

-
-

Username: -

-

Password: -

- - -
- - diff --git a/Kyle_Marienthal/FLASK/full_friends/templates/success.html b/Kyle_Marienthal/FLASK/full_friends/templates/success.html deleted file mode 100644 index e69de29..0000000 diff --git a/Kyle_Marienthal/FLASK/hello_world/server.py b/Kyle_Marienthal/FLASK/hello_world/server.py deleted file mode 100644 index 97fe5fc..0000000 --- a/Kyle_Marienthal/FLASK/hello_world/server.py +++ /dev/null @@ -1,8 +0,0 @@ -from flask import Flask, request, redirect, render_template -app = Flask(__name__) - -@app.route("/") -def index(): - return render_template("index.html") - -app.run(debug=True) diff --git a/Kyle_Marienthal/FLASK/hello_world/static/img/pickle_rick.jpg b/Kyle_Marienthal/FLASK/hello_world/static/img/pickle_rick.jpg deleted file mode 100644 index 1835a21..0000000 Binary files a/Kyle_Marienthal/FLASK/hello_world/static/img/pickle_rick.jpg and /dev/null differ diff --git a/Kyle_Marienthal/FLASK/hello_world/templates/index.html b/Kyle_Marienthal/FLASK/hello_world/templates/index.html deleted file mode 100644 index 61c0c03..0000000 --- a/Kyle_Marienthal/FLASK/hello_world/templates/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - RICK - - -

IIIIII'MMMMM PICKLE RIIIIIIIIIICK!!!

- rick as a pickle - - - diff --git a/Kyle_Marienthal/FLASK/rock_paper_scissors/server.py b/Kyle_Marienthal/FLASK/rock_paper_scissors/server.py deleted file mode 100644 index 2420a01..0000000 --- a/Kyle_Marienthal/FLASK/rock_paper_scissors/server.py +++ /dev/null @@ -1,80 +0,0 @@ -from flask import Flask, request, redirect, render_template, session, flash -app = Flask(__name__) -import random -app.secret_key = 'secret_key' - -def comp_choice(): - arr = ['rock', 'paper', 'scissors'] - return arr[random.randrange(0,3)] - -def result(user,comp): - if user == comp: - session['tie'] += 1 - return 'tie' - if user == 'rock': - if comp == 'scissors': - session['win'] += 1 - return 'win' - else: - session['lose'] += 1 - return 'lose' - if user == 'paper': - if comp == 'rock': - session['win'] += 1 - return 'win' - else: - session['lose'] += 1 - return 'lose' - if user == 'scissors': - if comp == 'paper': - session['win'] += 1 - return 'win' - else: - session['lose'] += 1 - return 'lose' -# session['win'] += 1 -# session['lose'] += 1 -# print result('rock',comp_choice()) - -@app.route("/") -def index(): - if 'win' not in session: - session['win'] = 0 - print session['win'] - if 'lose' not in session: - session['lose'] = 0 - print session['lose'] - if 'tie' not in session: - session['tie'] = 0 - print session['tie'] - return render_template("index.html", win = session['win'], lose = session['lose'], tie = session['tie']) - - -@app.route('/selection', methods = ['POST']) -def select(): - outcome = result(request.form.keys()[0],comp_choice()) - print outcome - return redirect('/') - -@app.route('/reset', methods = ['POST']) -def reset(): - session.pop('win') - session['win'] = 0 - session.pop('tie') - session['tie'] = 0 - session.pop('lose') - session['lose'] = 0 - return redirect('/') - - - - - -# @app.route('/selection', methods=["POST"]) -# def (): -# -# return redirect('/') - - - -app.run(debug=True) diff --git a/Kyle_Marienthal/FLASK/rock_paper_scissors/templates/index.html b/Kyle_Marienthal/FLASK/rock_paper_scissors/templates/index.html deleted file mode 100644 index 638d49c..0000000 --- a/Kyle_Marienthal/FLASK/rock_paper_scissors/templates/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - ROCK PAPER SCISSORS - - -

Wins: {{win}}

-

Losses: {{lose}}

-

Ties: {{tie}}

-

Rock Paper Scissors

- {% with messages = get_flashed_messages() %} - {% if messages %} - {% for message in messages %} -

{{ messages }}

- {% endfor %} - {% endif %} - {% endwith %} -
- - - - -
-
-
- -
-
- - - - - diff --git a/Kyle_Marienthal/SQL/friendships.sql b/Kyle_Marienthal/SQL/friendships.sql deleted file mode 100644 index 04b4e33..0000000 --- a/Kyle_Marienthal/SQL/friendships.sql +++ /dev/null @@ -1,13 +0,0 @@ -select * -from users; - -insert into friendships (user_id, friend_id, created_at, updated_at) -values (2, 1, now(), now()), -(3, 1, now(), now()), -(4, 1, now(), now()); - - -select users.first_name, users.last_name, user2.first_name as friend_first_name, user2.last_name as friend_last_name -from users -left join friendships on users.id = friendships.user_id -left join users as user2 on user2.id = friendships.friend_id; diff --git a/Kyle_Marienthal/amazon.mwb b/Kyle_Marienthal/amazon.mwb deleted file mode 100644 index 522eb69..0000000 Binary files a/Kyle_Marienthal/amazon.mwb and /dev/null differ diff --git a/Kyle_Marienthal/animal.py b/Kyle_Marienthal/animal.py deleted file mode 100644 index 39de512..0000000 --- a/Kyle_Marienthal/animal.py +++ /dev/null @@ -1,47 +0,0 @@ -class Animal(object): - def __init__(self, name): - self.name = name - self.health = 100 - # print 'animal created, name: {}, health: {}'.format(self.name, self.health) - - def walk(self): - self.health -= 1 - return self - - def run(self): - self.health -= 5 - return self - - def display_health(self): - print 'im a dog , my name is' + self.name - print 'i have ' + str(self.health) + ' health left' - - -class Dog(Animal): - def __init__(self, name): - super(Dog, self).__init__(name) - self.health = 150 - - def pet(self): - self.health += 5 - return self - - -class Dragon(Animal): - def __init__(self, name): - super(Dragon, self).__init__(name) - self.health = 170 - - def fly(self): - self.health -= 10 - - def display_health(self): - print 'I am a Dragon' - super(Dragon, self).displayHealth() - - - - -dog = Dog('Fido') -# dog.walk().walk().walk().run().run().display_health() -# dog.walk().walk().walk().run().pet().display_health() diff --git a/Kyle_Marienthal/bike.py b/Kyle_Marienthal/bike.py deleted file mode 100644 index c3a0a2d..0000000 --- a/Kyle_Marienthal/bike.py +++ /dev/null @@ -1,28 +0,0 @@ -class Bike(object): - """docstring for Bike""" - def __init__(self, price, max_speed): - self.price = price - self.max_speed = max_speed - self.miles = 0 - - def displayInfo(self): - print self.price, self.max_speed, self.miles - - def ride(self): - print "driving" - self.miles += 10 - - def reverse(self): - print "reversing" - self.miles -= 5 - - -bike1 = Bike(15, 50) -bike2 = Bike(20, 200) -bike3 = Bike(25, 400) - -bike1.ride() -bike1.ride() -bike1.ride() -bike1.reverse() -bike1.displayInfo() \ No newline at end of file diff --git a/Kyle_Marienthal/like_example.mwb b/Kyle_Marienthal/like_example.mwb deleted file mode 100644 index dbcf9d0..0000000 Binary files a/Kyle_Marienthal/like_example.mwb and /dev/null differ diff --git a/Kyle_Marienthal/lists_to_dicts.py b/Kyle_Marienthal/lists_to_dicts.py deleted file mode 100644 index d31ed8a..0000000 --- a/Kyle_Marienthal/lists_to_dicts.py +++ /dev/null @@ -1,8 +0,0 @@ -arr1 = ["Anna", "Eli", "Pariece", "Brendan", "Amy", "Shane", "Oscar"] -arr2 = ["horse", "cat", "spider", "giraffe", "ticks", "dolphins", "llamas"] - -def make_dict(arr1, arr2): - new_dict = zip(arr1,arr2) - return new_dict - -print make_dict(arr1,arr2) \ No newline at end of file diff --git a/Kyle_Marienthal/make_tupels.py b/Kyle_Marienthal/make_tupels.py deleted file mode 100644 index 75907e5..0000000 --- a/Kyle_Marienthal/make_tupels.py +++ /dev/null @@ -1,9 +0,0 @@ -my_dict = { - "Speros": "(555) 555-5555", - "Michael": "(999) 999-9999", - "Jay": "(777) 777-7777" -} - -for name,num in my_dict.iteritems(): - print (name, num) - diff --git a/Kyle_Marienthal/multiplication_table.py b/Kyle_Marienthal/multiplication_table.py deleted file mode 100644 index 6d0520f..0000000 --- a/Kyle_Marienthal/multiplication_table.py +++ /dev/null @@ -1,10 +0,0 @@ - -print ' x 1 2 3 4 5 6 7 8 9 10 11 12' -for row in range(1, 12 + 1): - display_string = '' - for column in range(0, 12 + 1): - if column is 0: - display_string += ' ' + str(row) - else: - display_string += ' ' + str(column * row) - print display_string \ No newline at end of file diff --git a/Kyle_Marienthal/names.py b/Kyle_Marienthal/names.py deleted file mode 100644 index bd71105..0000000 --- a/Kyle_Marienthal/names.py +++ /dev/null @@ -1,35 +0,0 @@ -# students = [ -# {'first_name': 'Michael', 'last_name' : 'Jordan'}, -# {'first_name' : 'John', 'last_name' : 'Rosales'}, -# {'first_name' : 'Mark', 'last_name' : 'Guillen'}, -# {'first_name' : 'KB', 'last_name' : 'Tonel'} -# ] -# for student in students: -# print student['first_name'] + ' ' + student['last_name'] - -users = { - 'Students': [ - {'first_name': 'Michael', 'last_name' : 'Jordan'}, - {'first_name' : 'John', 'last_name' : 'Rosales'}, - {'first_name' : 'Mark', 'last_name' : 'Guillen'}, - {'first_name' : 'KB', 'last_name' : 'Tonel'} - ], - 'Instructors': [ - {'first_name' : 'Michael', 'last_name' : 'Choi'}, - {'first_name' : 'Martin', 'last_name' : 'Puryear'} - ] - } -for type, user in users.iteritems(): - count = 0 - print type - for person in user: - count += 1 - - first_name = person['first_name'].upper() - last_name = person['last_name'].upper() - length = len(first_name) + len(last_name) - print "{} - {} {} - {}".format(count, first_name, last_name, length) - - - - diff --git a/Kyle_Marienthal/store.py b/Kyle_Marienthal/store.py deleted file mode 100644 index ef2943f..0000000 --- a/Kyle_Marienthal/store.py +++ /dev/null @@ -1,60 +0,0 @@ -class Store(object): - def __init__(self, location, owner): - self.product = [] - self.location = location - self.owner = owner - print 'store exists' - - def add_product(self, item): - self.product.append(item) - print self.product - - def remove_product(self, item): - self.product.remove(item) - - def inventory(self): - for item in self.product: - item.print_me() - # print 'created' - -class Product(object): - def __init__(self, name, price): - self.name = name - self.price = price - print 'item has been made' - - def print_me(self): - print self.name, self.price - - -bananas = Product('chiquita', .99) -apples = Product('green', 5) -pies = Product('pumpkin', 15) -print '***************************' - -store1 = Store('Dallas', 'Campy') - -print '***************************' -store1.add_product(bananas) -store1.add_product(apples) -store1.add_product(pies) - - -print '***************************' -# store1.add_product('tilex') -# store1.add_product('chili') -# store1.add_product('cocaine') -# store1.add_product('goldfish') - -# # store1.remove_product('Donuts') -# store1.inventory() - -# store1.remove_product('cocaine') - -store1.inventory() - - -# print store1.product - -#kyle and Campy worked on this together - diff --git a/Kyle_Marienthal/twitter.sql b/Kyle_Marienthal/twitter.sql deleted file mode 100644 index 5bda126..0000000 --- a/Kyle_Marienthal/twitter.sql +++ /dev/null @@ -1,3 +0,0 @@ -select * from users -where id = 1 or id = 2 -order by birthday \ No newline at end of file diff --git a/Shivi_khanuja/Django/hello_world/.vscode/settings.json b/Shivi_khanuja/Django/hello_world/.vscode/settings.json deleted file mode 100644 index d88899c..0000000 --- a/Shivi_khanuja/Django/hello_world/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.linting.pylintEnabled": false -} \ No newline at end of file diff --git a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/admin.py b/Shivi_khanuja/Django/hello_world/apps/hello_world_app/admin.py deleted file mode 100644 index 4255847..0000000 --- a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/apps.py b/Shivi_khanuja/Django/hello_world/apps/hello_world_app/apps.py deleted file mode 100644 index ab7388d..0000000 --- a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class HelloWorldAppConfig(AppConfig): - name = 'hello_world_app' diff --git a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/models.py b/Shivi_khanuja/Django/hello_world/apps/hello_world_app/models.py deleted file mode 100644 index c827610..0000000 --- a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/templates/hello_world_app/index.html b/Shivi_khanuja/Django/hello_world/apps/hello_world_app/templates/hello_world_app/index.html deleted file mode 100644 index eef2391..0000000 --- a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/templates/hello_world_app/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Document - - -

Hello World!!!!!!!!!!!!

- - \ No newline at end of file diff --git a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/tests.py b/Shivi_khanuja/Django/hello_world/apps/hello_world_app/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/urls.py b/Shivi_khanuja/Django/hello_world/apps/hello_world_app/urls.py deleted file mode 100644 index 6e18987..0000000 --- a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/urls.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.conf.urls import url ,include -from django.contrib import admin -import views - -urlpatterns = [ - url(r'^',views.index) -] diff --git a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/views.py b/Shivi_khanuja/Django/hello_world/apps/hello_world_app/views.py deleted file mode 100644 index 10a100c..0000000 --- a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/views.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.shortcuts import render - -def index(request): - return render(request, 'hello_world_app/index.html') - diff --git a/Shivi_khanuja/Django/hello_world/db.sqlite3 b/Shivi_khanuja/Django/hello_world/db.sqlite3 deleted file mode 100644 index da0ecc6..0000000 Binary files a/Shivi_khanuja/Django/hello_world/db.sqlite3 and /dev/null differ diff --git a/Shivi_khanuja/Django/hello_world/main/settings.py b/Shivi_khanuja/Django/hello_world/main/settings.py deleted file mode 100644 index fe74736..0000000 --- a/Shivi_khanuja/Django/hello_world/main/settings.py +++ /dev/null @@ -1,121 +0,0 @@ -""" -Django settings for main project. - -Generated by 'django-admin startproject' using Django 1.11.4. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '&(pqf7nx-uj+v)y+pnxr$57)(tpnryh_s2)h$0fsqnux^m@h90' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'apps.hello_world_app', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'main.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'main.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/Shivi_khanuja/Django/hello_world/main/urls.py b/Shivi_khanuja/Django/hello_world/main/urls.py deleted file mode 100644 index b90f7d6..0000000 --- a/Shivi_khanuja/Django/hello_world/main/urls.py +++ /dev/null @@ -1,22 +0,0 @@ -"""main URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url ,include -from django.contrib import admin - -urlpatterns = [ - url(r'^admin/', admin.site.urls), - url(r'^',include('apps.hello_world_app.urls')) -] diff --git a/Shivi_khanuja/Django/hello_world/manage.py b/Shivi_khanuja/Django/hello_world/manage.py deleted file mode 100644 index 1a1848d..0000000 --- a/Shivi_khanuja/Django/hello_world/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/Shivi_khanuja/Django/regex.py b/Shivi_khanuja/Django/regex.py deleted file mode 100644 index ccef059..0000000 --- a/Shivi_khanuja/Django/regex.py +++ /dev/null @@ -1,84 +0,0 @@ -import re -def get_matching_words(regex): - results = [] - words = [ - "baby", - "baseball", - "denver", - "facetious", - "issue", - "mattress", - "obsessive", - "paranoia", - "rabble", - "union", - "volleyball", - "11234566", - ] - for word in words: - if re.search(regex, word): - results.append(word) - return results - - -my_expression = r"(\w)\1.*(\w)\2" -print get_matching_words(my_expression) - -Answers -python regex.py -['denver', 'obsessive', 'volleyball'] - -python regex.py -['denver', 'obsessive', 'volleyball'] - -$ python regex.py -['baseball', 'issue', 'mattress', 'obsessive', 'rabble', 'volleyball', '11234566'] - -r"ss" -python regex.py -['issue', 'mattress', 'obsessive'] - -r"^b" -python regex.py -['baby'] - -r"b.+b" -python regex.py -['baby', 'baseball'] - -r"a.*e.*i.*o.*u.*" -python regex.py -['facetious'] - -r"[aeiou][aeiou]$" -python regex.py -['issue', 'paranoia'] - -r"^[regular expressions]+$" -python regex.py -['issue', 'paranoia', 'union'] - -r"^[^regex]+$" -python regex.py -['baby', 'union', '11234566'] - -r"b.*b" -python regex.py -['baby', 'baseball', 'rabble'] - -r"b.?b" -python regex.py -['baby', 'rabble'] - -r"io" -python regex.py -['facetious', 'union'] - -r"e$" -python regex.py -['issue', 'obsessive', 'rabble'] - -r"(\w)\1.*(\w)\2" -python regex.py -['mattress', 'volleyball', '11234566'] - diff --git a/Shivi_khanuja/Django/session_word/app/__init__.py b/Shivi_khanuja/Django/session_word/app/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/Shivi_khanuja/Django/session_word/main/main/__init__.py b/Shivi_khanuja/Django/session_word/main/main/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/Shivi_khanuja/Django/session_word/main/main/settings.py b/Shivi_khanuja/Django/session_word/main/main/settings.py deleted file mode 100644 index 6151489..0000000 --- a/Shivi_khanuja/Django/session_word/main/main/settings.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Django settings for main project. - -Generated by 'django-admin startproject' using Django 1.11.4. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '%5#@-fdl3_y%9pott4-s@^&)&zx$cb48z2sjxo!s5z+zh&#+qz' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'main.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'main.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/Shivi_khanuja/Django/session_word/main/main/urls.py b/Shivi_khanuja/Django/session_word/main/main/urls.py deleted file mode 100644 index 88724d8..0000000 --- a/Shivi_khanuja/Django/session_word/main/main/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -"""main URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url -from django.contrib import admin - -urlpatterns = [ - url(r'^admin/', admin.site.urls), -] diff --git a/Shivi_khanuja/Django/session_word/main/main/wsgi.py b/Shivi_khanuja/Django/session_word/main/main/wsgi.py deleted file mode 100644 index 064e759..0000000 --- a/Shivi_khanuja/Django/session_word/main/main/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for main project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - -application = get_wsgi_application() diff --git a/Shivi_khanuja/Django/session_word/main/manage.py b/Shivi_khanuja/Django/session_word/main/manage.py deleted file mode 100644 index 1a1848d..0000000 --- a/Shivi_khanuja/Django/session_word/main/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/Shivi_khanuja/Flask/disappearing_ninja.zip b/Shivi_khanuja/Flask/disappearing_ninja.zip deleted file mode 100644 index 6d16e5f..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja.zip and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/server.py b/Shivi_khanuja/Flask/disappearing_ninja/server.py deleted file mode 100644 index 04ea49b..0000000 --- a/Shivi_khanuja/Flask/disappearing_ninja/server.py +++ /dev/null @@ -1,30 +0,0 @@ -from flask import Flask, render_template , request -app = Flask (__name__) - -@app.route('/') -def index(): - return render_template('index.html') - -@app.route('/ninja' , methods=['POST']) -def ninja(): - return render_template('ninja.html') - -@app.route ('/ninja/') -def showUserProfile(x): - # myRange = ['red','blue','yellow','green'] - # for x in myRange: - if x == 'yellow': - myImg = "../static/img/donatello.jpg" - - elif x == 'red': - myImg = "../static/img/raphael.jpg" - elif x == 'green': - myImg = "../static/img/michelangelo.jpg" - else : - myImg = "../static/img/leonardo.jpg" - - print myImg - - return render_template('ninja.html', myImg=myImg) - -app.run(debug=True) diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._donatello.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._donatello.jpg deleted file mode 100644 index d985617..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._donatello.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._leonardo.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._leonardo.jpg deleted file mode 100644 index d985617..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._leonardo.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._michelangelo.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._michelangelo.jpg deleted file mode 100644 index d985617..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._michelangelo.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._notapril.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._notapril.jpg deleted file mode 100644 index d985617..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._notapril.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._raphael.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._raphael.jpg deleted file mode 100644 index d985617..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._raphael.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._tmnt.png b/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._tmnt.png deleted file mode 100644 index 5dffe3a..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/__MACOSX/._tmnt.png and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/donatello.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/donatello.jpg deleted file mode 100644 index 8912292..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/donatello.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/leonardo.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/leonardo.jpg deleted file mode 100644 index c049cfd..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/leonardo.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/michelangelo.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/michelangelo.jpg deleted file mode 100644 index 4ad75d0..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/michelangelo.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/notapril.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/notapril.jpg deleted file mode 100644 index 39b2f0a..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/notapril.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/raphael.jpg b/Shivi_khanuja/Flask/disappearing_ninja/static/img/raphael.jpg deleted file mode 100644 index 57fb2a3..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/raphael.jpg and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/img/tmnt.png b/Shivi_khanuja/Flask/disappearing_ninja/static/img/tmnt.png deleted file mode 100644 index 941c82e..0000000 Binary files a/Shivi_khanuja/Flask/disappearing_ninja/static/img/tmnt.png and /dev/null differ diff --git a/Shivi_khanuja/Flask/disappearing_ninja/static/style.css b/Shivi_khanuja/Flask/disappearing_ninja/static/style.css deleted file mode 100644 index e69de29..0000000 diff --git a/Shivi_khanuja/Flask/disappearing_ninja/templates/.vscode/settings.json b/Shivi_khanuja/Flask/disappearing_ninja/templates/.vscode/settings.json deleted file mode 100644 index d88899c..0000000 --- a/Shivi_khanuja/Flask/disappearing_ninja/templates/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.linting.pylintEnabled": false -} \ No newline at end of file diff --git a/Shivi_khanuja/Flask/disappearing_ninja/templates/index.html b/Shivi_khanuja/Flask/disappearing_ninja/templates/index.html deleted file mode 100644 index bf783ea..0000000 --- a/Shivi_khanuja/Flask/disappearing_ninja/templates/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -
-

"No ninjas here"

-
- - \ No newline at end of file diff --git a/Shivi_khanuja/Flask/disappearing_ninja/templates/ninja.html b/Shivi_khanuja/Flask/disappearing_ninja/templates/ninja.html deleted file mode 100644 index 1ae6a51..0000000 --- a/Shivi_khanuja/Flask/disappearing_ninja/templates/ninja.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -
- -
- - \ No newline at end of file diff --git a/Shivi_khanuja/Flask/dojosurvey1/.vscode/settings.json b/Shivi_khanuja/Flask/dojosurvey1/.vscode/settings.json deleted file mode 100644 index d88899c..0000000 --- a/Shivi_khanuja/Flask/dojosurvey1/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.linting.pylintEnabled": false -} \ No newline at end of file diff --git a/Shivi_khanuja/Flask/dojosurvey1/server.py b/Shivi_khanuja/Flask/dojosurvey1/server.py deleted file mode 100644 index 32dab71..0000000 --- a/Shivi_khanuja/Flask/dojosurvey1/server.py +++ /dev/null @@ -1,35 +0,0 @@ -from flask import Flask, render_template, redirect, session , request, flash - -app = Flask (__name__) - -app.secret_key = "secret" - -def validate(form_data): - errors = False - - if len(form_data['name']) == 0: - flash("Name can not be blank") - errors = True - return errors - - -@app.route ('/') -def index(): - return render_template('index.html') - -@app.route('/process', methods=['POST']) -def process(): - errors = validate(request.form) - if errors: - return redirect('/') - else: - session['survey'] = request.form - return redirect('/result') - -@app.route('/result') -def result(): - data = session['survey'] - - return render_template('result.html', data=data) - -app.run(debug=True) \ No newline at end of file diff --git a/Shivi_khanuja/Flask/dojosurvey1/templates/index.html b/Shivi_khanuja/Flask/dojosurvey1/templates/index.html deleted file mode 100644 index c2c26ef..0000000 --- a/Shivi_khanuja/Flask/dojosurvey1/templates/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - Document - - - {% with messages = get_flashed_messages() %} - {% if messages %} -
    - {% for message in messages %} -
  • {{ message }}
  • - {% endfor %} -
- {% endif %} - {% endwith %} -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
- - \ No newline at end of file diff --git a/Shivi_khanuja/Flask/dojosurvey1/templates/result.html b/Shivi_khanuja/Flask/dojosurvey1/templates/result.html deleted file mode 100644 index 7b89d9c..0000000 --- a/Shivi_khanuja/Flask/dojosurvey1/templates/result.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Document - - - -

Submitted Info

-

Name:{{ data.name }}

-

Dojo Location:{{data.location}}

-

Favorite Language:{{data.language}}

-

Comment:{{data.comment if data.comment != "" else "No comment"}}

- - - - - \ No newline at end of file diff --git a/Shivi_khanuja/Flask/hello_flask/.vscode/settings.json b/Shivi_khanuja/Flask/hello_flask/.vscode/settings.json deleted file mode 100644 index d88899c..0000000 --- a/Shivi_khanuja/Flask/hello_flask/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.linting.pylintEnabled": false -} \ No newline at end of file diff --git a/Shivi_khanuja/Flask/hello_flask/hello.py b/Shivi_khanuja/Flask/hello_flask/hello.py deleted file mode 100644 index 7991eb9..0000000 --- a/Shivi_khanuja/Flask/hello_flask/hello.py +++ /dev/null @@ -1,10 +0,0 @@ -from flask import Flask -app = Flask (__name__) - -@app.route('/') - - -def hello_world(): - return "Hello World" - -app.run(debug=True) \ No newline at end of file diff --git a/Shivi_khanuja/Flask/hello_world.zip b/Shivi_khanuja/Flask/hello_world.zip deleted file mode 100644 index cee6394..0000000 Binary files a/Shivi_khanuja/Flask/hello_world.zip and /dev/null differ diff --git a/Shivi_khanuja/Flask/hello_world/.vscode/settings.json b/Shivi_khanuja/Flask/hello_world/.vscode/settings.json deleted file mode 100644 index d88899c..0000000 --- a/Shivi_khanuja/Flask/hello_world/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.linting.pylintEnabled": false -} \ No newline at end of file diff --git a/Shivi_khanuja/Flask/hello_world/server.py b/Shivi_khanuja/Flask/hello_world/server.py deleted file mode 100644 index 12ef2b6..0000000 --- a/Shivi_khanuja/Flask/hello_world/server.py +++ /dev/null @@ -1,10 +0,0 @@ -from flask import Flask, render_template - -app = Flask(__name__) - -@app.route('/') -def index(): - return render_template('index.html') - - -app.run (debug=True) diff --git a/Shivi_khanuja/Flask/hello_world/templates/index.html b/Shivi_khanuja/Flask/hello_world/templates/index.html deleted file mode 100644 index 761324f..0000000 --- a/Shivi_khanuja/Flask/hello_world/templates/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - -

Hello_World!!!!!!!!!!

-

My name is Anna

- - - \ No newline at end of file diff --git a/Shivi_khanuja/Flask/portfolio.zip b/Shivi_khanuja/Flask/portfolio.zip deleted file mode 100644 index 203027a..0000000 Binary files a/Shivi_khanuja/Flask/portfolio.zip and /dev/null differ diff --git a/Shivi_khanuja/Flask/portfolio/.vscode/settings.json b/Shivi_khanuja/Flask/portfolio/.vscode/settings.json deleted file mode 100644 index d88899c..0000000 --- a/Shivi_khanuja/Flask/portfolio/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.linting.pylintEnabled": false -} \ No newline at end of file diff --git a/Shivi_khanuja/Flask/portfolio/server.py b/Shivi_khanuja/Flask/portfolio/server.py deleted file mode 100644 index 58c01ff..0000000 --- a/Shivi_khanuja/Flask/portfolio/server.py +++ /dev/null @@ -1,19 +0,0 @@ -from flask import Flask, render_template - -app = Flask (__name__) -@app.route ('/') - -def index(): - return render_template("index.html") - -@app.route ('/projects') - -def projects(): - return render_template("projects.html") - -@app.route ('/about') - -def about(): - return render_template("about.html") - -app.run (debug=True) \ No newline at end of file diff --git a/Shivi_khanuja/Flask/portfolio/templates/about.html b/Shivi_khanuja/Flask/portfolio/templates/about.html deleted file mode 100644 index 4687b4b..0000000 --- a/Shivi_khanuja/Flask/portfolio/templates/about.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -

Lorem ipsum dolor sit amet consectetur adipisicing elit. Nobis illo minima, quisquam ab similique officiis cum saepe eius sequi nihil hic molestias modi unde odio voluptas harum animi, consectetur dolorem!

- - \ No newline at end of file diff --git a/Shivi_khanuja/Flask/portfolio/templates/index.html b/Shivi_khanuja/Flask/portfolio/templates/index.html deleted file mode 100644 index b00a2e0..0000000 --- a/Shivi_khanuja/Flask/portfolio/templates/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -

Welcome to my portfolio!My name is Anna!

- - \ No newline at end of file diff --git a/Shivi_khanuja/Flask/portfolio/templates/projects.html b/Shivi_khanuja/Flask/portfolio/templates/projects.html deleted file mode 100644 index 8574851..0000000 --- a/Shivi_khanuja/Flask/portfolio/templates/projects.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - -
    -
  • Danger Zones
  • -
  • Fat Unicorn: The Poopening
  • -
  • My Cohort
  • -
  • Certify Me
  • -
  • Woof Woof Go!
  • -
- - \ No newline at end of file diff --git a/Shivi_khanuja/Flask/whats_my_name3 (2).zip b/Shivi_khanuja/Flask/whats_my_name3 (2).zip deleted file mode 100644 index 805db10..0000000 Binary files a/Shivi_khanuja/Flask/whats_my_name3 (2).zip and /dev/null differ diff --git a/Shivi_khanuja/Flask/whats_my_name3/.vscode/settings.json b/Shivi_khanuja/Flask/whats_my_name3/.vscode/settings.json deleted file mode 100644 index d88899c..0000000 --- a/Shivi_khanuja/Flask/whats_my_name3/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.linting.pylintEnabled": false -} \ No newline at end of file diff --git a/Shivi_khanuja/Flask/whats_my_name3/server.py b/Shivi_khanuja/Flask/whats_my_name3/server.py deleted file mode 100644 index c7aa7e6..0000000 --- a/Shivi_khanuja/Flask/whats_my_name3/server.py +++ /dev/null @@ -1,14 +0,0 @@ -from flask import Flask, render_template, redirect, request -app = Flask(__name__) - -@app.route("/") -def index(): - return render_template("index.html") - -@app.route("/process", methods=['POST']) -def process_form(): - print request.form - name = request.form ['name'] - return render_template("process.html" , name=name) - -app.run(debug=True) \ No newline at end of file diff --git a/Shivi_khanuja/Flask/whats_my_name3/templates/index.html b/Shivi_khanuja/Flask/whats_my_name3/templates/index.html deleted file mode 100644 index 6e4a762..0000000 --- a/Shivi_khanuja/Flask/whats_my_name3/templates/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - What's My Name - - -
-
- - - -
-
- - \ No newline at end of file diff --git a/Shivi_khanuja/Flask/whats_my_name3/templates/process.html b/Shivi_khanuja/Flask/whats_my_name3/templates/process.html deleted file mode 100644 index e7b47ee..0000000 --- a/Shivi_khanuja/Flask/whats_my_name3/templates/process.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Document - - -
-

{{name}}

-
- - \ No newline at end of file diff --git a/Shivi_khanuja/Store.py b/Shivi_khanuja/Store.py deleted file mode 100644 index 1c50ee2..0000000 --- a/Shivi_khanuja/Store.py +++ /dev/null @@ -1,3 +0,0 @@ -class Store (object): - def __init__.py (self, owner, location): - self.product = product \ No newline at end of file diff --git a/Shivi_khanuja/bike.py b/Shivi_khanuja/bike.py deleted file mode 100644 index 87a1094..0000000 --- a/Shivi_khanuja/bike.py +++ /dev/null @@ -1,41 +0,0 @@ -class Bike(object): - def __init__(self, price, max_speed): - self.price = price - self.max_speed = max_speed - self.miles = 0 - - def displayInfo(self): - print 'Price is: $ ' + str(self.price) - print 'Max Speed is: ' + str(self.max_speed) + 'mph' - print 'Total Miles is: ' + str(self.miles) + 'miles' - return self - - def drive(self): - print 'Driving' - self.miles += 10 - return self - - def reverse(self): - print 'Reversing' - if self.miles >= 5: - miles -= 5 - return self - else: - self.miles -= 0 - print "Can't reverse anymore" - return self - - -CRX = Bike(220, 9) -Suzuki = Bike(120, 15) -Fuji = Bike(180, 12) - -print CRX.price -print Suzuki.max_speed -print Fuji.price - -CRX.reverse() -Suzuki.drive().drive().reverse() -CRX.drive().drive().reverse().displayInfo() -Fuji.ride().ride().reverse().reverse().displayInfo() -Road.reverse().reverse().reverse().displayInfo() \ No newline at end of file diff --git a/Shivi_khanuja/callcenter.py b/Shivi_khanuja/callcenter.py deleted file mode 100644 index e69de29..0000000 diff --git a/Shivi_khanuja/fundametals.py b/Shivi_khanuja/fundametals.py deleted file mode 100644 index 0eca6c4..0000000 --- a/Shivi_khanuja/fundametals.py +++ /dev/null @@ -1,19 +0,0 @@ -#def odd_even(): - #for i in range (0,2001): - #if i % 2 == 0: - #print i, "This is even number" - #else: - # print i, "This is odd number" - -#odd_even() - - -#def multiply(arr, num): - #for x in range (0, len(arr)): - # arr[x] *= num - #return arr - -#number_arr = [2,4,10,16] -#print multiply (number_arr,5) - - diff --git a/Shivi_khanuja/mySQL/Blogs.mwb b/Shivi_khanuja/mySQL/Blogs.mwb deleted file mode 100644 index 016bca7..0000000 Binary files a/Shivi_khanuja/mySQL/Blogs.mwb and /dev/null differ diff --git a/Shivi_khanuja/mySQL/Blogs.mwb.bak b/Shivi_khanuja/mySQL/Blogs.mwb.bak deleted file mode 100644 index 9d142dc..0000000 Binary files a/Shivi_khanuja/mySQL/Blogs.mwb.bak and /dev/null differ diff --git a/Shivi_khanuja/mySQL/Books.mwb b/Shivi_khanuja/mySQL/Books.mwb deleted file mode 100644 index f9af506..0000000 Binary files a/Shivi_khanuja/mySQL/Books.mwb and /dev/null differ diff --git a/Shivi_khanuja/mySQL/Books.mwb.bak b/Shivi_khanuja/mySQL/Books.mwb.bak deleted file mode 100644 index 20726e0..0000000 Binary files a/Shivi_khanuja/mySQL/Books.mwb.bak and /dev/null differ diff --git a/Shivi_khanuja/mySQL/Friendship.mwb b/Shivi_khanuja/mySQL/Friendship.mwb deleted file mode 100644 index 7ef6a96..0000000 Binary files a/Shivi_khanuja/mySQL/Friendship.mwb and /dev/null differ diff --git a/Shivi_khanuja/mySQL/RPS/mysqlconnection.py b/Shivi_khanuja/mySQL/RPS/mysqlconnection.py deleted file mode 100644 index 7e8f143..0000000 --- a/Shivi_khanuja/mySQL/RPS/mysqlconnection.py +++ /dev/null @@ -1,40 +0,0 @@ -""" import the necessary modules """ -from flask_sqlalchemy import SQLAlchemy -from sqlalchemy.sql import text -# Create a class that will give us an object that we can use to connect to a database -class MySQLConnection(object): - def __init__(self, app, db): - config = { - 'host': 'localhost', - 'database': db, # we got db as an argument - 'user': 'root', - 'password': 'root', - 'port': '3306' # change the port to match the port your SQL server is running on - } - # this will use the above values to generate the path to connect to your sql database - DATABASE_URI = "mysql://{}:{}@127.0.0.1:{}/{}".format(config['user'], config['password'], config['port'], config['database']) - app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI - app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True - # establish the connection to database - self.db = SQLAlchemy(app) - # this is the method we will use to query the database - def query_db(self, query, data=None): - result = self.db.session.execute(text(query), data) - if query[0:6].lower() == 'select': - # if the query was a select - # convert the result to a list of dictionaries - list_result = [dict(r) for r in result] - # return the results as a list of dictionaries - return list_result - elif query[0:6].lower() == 'insert': - # if the query was an insert, return the id of the - # commit changes - self.db.session.commit() - # row that was inserted - return result.lastrowid - else: - # if the query was an update or delete, return nothing and commit changes - self.db.session.commit() -# This is the module method to be called by the user in server.py. Make sure to provide the db name! -def MySQLConnector(app, db): - return MySQLConnection(app, db) diff --git a/Shivi_khanuja/mySQL/RPS/server.py b/Shivi_khanuja/mySQL/RPS/server.py deleted file mode 100644 index 9056584..0000000 --- a/Shivi_khanuja/mySQL/RPS/server.py +++ /dev/null @@ -1,120 +0,0 @@ -from flask import Flask, render_template, redirect, request, session, flash -from mysqlconnection import MySQLConnector -import random -import sys - - - -ROCK = 0 -PAPER = 1 -SCISSORS = 2 - - - -def log(obj): - print(obj, file=sys.stderr) - - -app = Flask(__name__) - -app.secret_key = "secret" - -mysql = MySQLConnector(app, 'mydb') - -@app.route("/") -def index(): - log(mysql.query_db("SELECT * FROM user")) - return render_template("index.html") - - - -@app.route("/game") -def game(): - query = "SELECT wins, losses, ties FROM user WHERE name = :name" - data = mysql.query_db(query, {'name': session['name']}) - - return render_template("game.html", name = session['name'], wins = data[0]['wins'], losses = data[0]['losses'], ties = data[0]['ties']) - - - - - - - - - -@app.route("/login", methods=["POST"]) -def login(): - if not 'name' in session: - if not 'name' in request.form: - redirect ('/') - session['name'] = request.form['name'] - - session['name'] = request.form['name'] - - - temp = mysql.query_db("SELECT COUNT(name) AS count FROM user WHERE name = :name", {"name":session['name']}) - if temp[0]['count'] == 0: - mysql.query_db("INSERT INTO user(name, wins, losses, ties) VALUES( :name, 0,0,0 )", {"name": session['name']}) - log(mysql.query_db("SELECT * FROM user")) - - return redirect("/game") - - -@app.route('/process', methods=['POST']) -def process(): - computer = random.randint(0,2) - result = "" - - if computer == ROCK: - if int(request.form['choice']) == PAPER: - flash("The Computer picked rock \n you picked paper, You Win!") - result = "win" - - elif int(request.form['choice']) == SCISSORS: - flash("The Computer picked rock \n you picked scissors, You Lose!") - result = "lose" - elif int(request.form['choice']) == ROCK: - flash("The Computer picked rock \n you picked rock, You tie!") - result = "tie" - elif computer == PAPER: - if int(request.form['choice']) == PAPER: - flash("The Computer picked paper \n you picked paper, You Tie!") - result = "tie" - elif int(request.form['choice']) == SCISSORS: - flash("The Computer picked paper \n you picked scissors, You Win!") - result = "win" - elif int(request.form['choice']) == ROCK: - flash("The Computer picked paper \n you picked rock, You Lose!") - result = "lose" - elif computer == SCISSORS: - if int(request.form['choice']) == PAPER: - flash("The Computer picked scissors \n you picked paper, You Lose!") - result = "lose" - elif int(request.form['choice']) == SCISSORS: - flash("The Computer picked scissors \n you picked scissors, You Tie!") - result = "tie" - elif int(request.form['choice']) == ROCK: - flash("The Computer picked scissors \n you picked rock, You Win!") - result = "win" - - if result == "win": - query= "UPDATE user SET wins = wins+1 WHERE name = :name" - data = {'name': session['name']} - mysql.query_db(query, data) - if result == "lose": - query= "UPDATE user SET losses = losses+1 WHERE name = :name" - data = {'name': session['name']} - mysql.query_db(query, data) - if result == "tie": - query= "UPDATE user SET ties = ties+1 WHERE name = :name" - data = {'name': session['name']} - mysql.query_db(query, data) - - - return redirect('/game') - - - - -app.run(debug=True) diff --git a/Shivi_khanuja/mySQL/RPS/templates/game.html b/Shivi_khanuja/mySQL/RPS/templates/game.html deleted file mode 100644 index cba7bc6..0000000 --- a/Shivi_khanuja/mySQL/RPS/templates/game.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Rock Paper Scissors - - - - - -

You are logged in as: {{ name }}

-
- -
-
-

Wins: {{ wins }}

-

Losses: {{ losses }}

-

ties {{ ties }}

-
-

Rock Paper Scissors

- -
- {% with messages = get_flashed_messages()%} - {% if messages %} - {% for message in messages %} -

0 %} - class="win" - {% endif %} - {% if message.find("Lose") >0 %} - class="lose" - {% endif %}> - {{ message }} -

- {% endfor %} - {% endif %} - {% endwith %} - -
- -
- - - -
- - \ No newline at end of file diff --git a/Shivi_khanuja/mySQL/RPS/templates/index.html b/Shivi_khanuja/mySQL/RPS/templates/index.html deleted file mode 100644 index 39c63a2..0000000 --- a/Shivi_khanuja/mySQL/RPS/templates/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Login - - -
-

login:

- - - -
- - - \ No newline at end of file diff --git a/Shivi_khanuja/mySQL/Sakila.txt b/Shivi_khanuja/mySQL/Sakila.txt deleted file mode 100644 index 4d490f7..0000000 --- a/Shivi_khanuja/mySQL/Sakila.txt +++ /dev/null @@ -1,100 +0,0 @@ -SELECT - -customer.customer_id, - -customer.first_name, - -customer.last_name, - -customer.email, - -address.address, - -address.city_id -FROM customer - -JOIN address ON customer_id = address.address_id - -Where address.city_id = '312' - - -SELECT -category.category_id, -category.name, -film_category.category_id, -film.film_id, -film.title, -film.release_year, -film.description, -film.rating, -film.special_features -From film -JOIN film_category ON film.film_id = film_category.film_id -JOIN category ON film_category.category_id = category.category_id -WHERE category.name = 'comedy'; - -SELECT -actor.actor_id, -actor.first_name, -actor.last_name, -film.film_id, -film.title, -film.release_year, -film.description -From film -JOIN actor ON actor_id = actor.actor_id -WHERE actor_id= 5 - - -SELECT customer.first_name, customer.last_name, customer.email, address.address -FROM customer -JOIN address ON customer.address_id = address.address_id -JOIN city ON address.city_id = city.city_id -WHERE customer.store_id = 1 - AND city.city_id IN (1,42,312,459); - -SELECT - film.title, - film.description, - film.release_year, - film.rating, - film.special_features -FROM film -JOIN film_actor ON film.film_id = film_actor.film_id -JOIN actor ON actor.actor_id = film_actor.actor_id -where film.rating = 'G' and actor.actor_id = 15 and film.special_features like '%behind the scenes%'; -SELECT - film_actor.film_id, - actor.first_name, - actor.last_name, - actor.last_update -from actor -join film_actor on actor.actor_id = film_actor.actor_id -where film_id = 369; -select - film.rental_rate, - film.title, - film.description, - film.release_year, - film.rating, - film.special_features, - category.name -from film -join film_category on film.film_id = film_category.film_id -join category on film_category.category_id = category.category_id -where film.rental_rate = 2.99 and category.name = 'drama'; -select - film.title, - film.description, - film.release_year, - film.rating, - film.special_features, - category.name, - actor.first_name, - actor.last_name -from film -join film_category on film.film_id = film_category.film_id -join category on film_category.category_id = category.category_id -join film_actor on film.film_id = film_actor.film_id -join actor on film_actor.actor_id = actor.actor_id -where category.name = 'action' and actor.first_name = 'Sandra' and actor.last_name = 'Kilmer' diff --git a/Shivi_khanuja/mySQL/User_Dashboard.mwb b/Shivi_khanuja/mySQL/User_Dashboard.mwb deleted file mode 100644 index 01091d8..0000000 Binary files a/Shivi_khanuja/mySQL/User_Dashboard.mwb and /dev/null differ diff --git a/Shivi_khanuja/mySQL/User_Dashboard.mwb.bak b/Shivi_khanuja/mySQL/User_Dashboard.mwb.bak deleted file mode 100644 index 9d3bb03..0000000 Binary files a/Shivi_khanuja/mySQL/User_Dashboard.mwb.bak and /dev/null differ diff --git a/Shivi_khanuja/mySQL/friendships.txt b/Shivi_khanuja/mySQL/friendships.txt deleted file mode 100644 index e69de29..0000000 diff --git a/Shivi_khanuja/mySQL/login.mwb b/Shivi_khanuja/mySQL/login.mwb deleted file mode 100644 index 7e053d3..0000000 Binary files a/Shivi_khanuja/mySQL/login.mwb and /dev/null differ diff --git a/Shivi_khanuja/mySQL/mySql_countries.txt b/Shivi_khanuja/mySQL/mySql_countries.txt deleted file mode 100644 index 2c94422..0000000 --- a/Shivi_khanuja/mySQL/mySql_countries.txt +++ /dev/null @@ -1,78 +0,0 @@ -actor_idSELECT - languages.id as language_id, - languages.language, - languages.percentage, - countries.id as country_id, - countries.name -FROM languages -JOIN countries ON countries.id = languages.country_id -WHERE languages.language = 'Slovene' -ORDER BY languages.percentage DESC; - -SELECT - count(countries.id) as num_cities, - countries.name, - countries.id as country_pk -FROM countries -JOIN cities ON cities.country_id = countries.id -GROUP BY country_pk; - -SELECT - cities.id as city_pk, - cities.population, - cities.name, - countries.id as country_pk, - countries.name as country_name -FROM countries -JOIN cities ON countries.id = cities.country_id -WHERE countries.name = 'Mexico' AND cities.population > 500000 -ORDER BY cities.population DESC; - -SELECT - languages.id as language_pk, - languages.language, - languages.percentage, - countries.id as country_pk, - countries.name -FROM countries -JOIN languages ON countries.id = languages.country_id -WHERE languages.percentage > 89 -ORDER BY languages.percentage DESC; - -SELECT - countries.surface_area, - countries.name, - countries.id, - countries.population -FROM countries -WHERE countries.surface_area < 501 AND countries.population > 100000; - -SELECT - countries.life_expectancy, - countries.capital, - countries.government_form, - countries.id, - countries.name -FROM countries -WHERE countries.government_form = 'Constitutional Monarchy' -AND countries.life_expectancy > 75 -AND countries.capital > 200 -ORDER BY countries.capital DESC; - -SELECT - countries.name, - countries.id as country_pk, - cities.id as city_pk, - cities.name, - cities.district, - cities.population -FROM countries -JOIN cities ON countries.id = cities.country_id -WHERE countries.name = 'Argentina' AND cities.district = 'Buenos Aires' AND cities.population > 500000; - -SELECT - countries.region, - count(countries.id) as num_countries -FROM countries -GROUP BY countries.region -order by num_countries desc; \ No newline at end of file diff --git a/Shivi_khanuja/mySQL/mysql_workbech_setup.txt b/Shivi_khanuja/mySQL/mysql_workbech_setup.txt deleted file mode 100644 index 96def06..0000000 --- a/Shivi_khanuja/mySQL/mysql_workbech_setup.txt +++ /dev/null @@ -1,5 +0,0 @@ -Open Database with Visual Studio Code(or any text editor) -Copy the code -Paste the code on WAMP -click the top arrow to Execute the Database. -That opens up the Query Page and rest functions can be performed from there. diff --git a/Shivi_khanuja/product.py b/Shivi_khanuja/product.py deleted file mode 100644 index 41ff5bc..0000000 --- a/Shivi_khanuja/product.py +++ /dev/null @@ -1,43 +0,0 @@ -class Product(object): - def __init__(self, item_name, weight, price, brand, status): - self.item_name = item_name - self.weight = weight - self.price = price - self.brand = brand - self.status = status - - - def displayInfo(self): - print 'Item name is: ' + str(self.item_name) - print 'Weight is ' + str(self.weight) - print 'Item is by ' + str(self.brand) + ' brand' - return self - - def totalprice(self): - tax = 0.0825 - self.price += tax - print self.price - - def return1(self): - if self.status == 'defective': - self.price = 0 - print 'Price is $ ' + str(self.price) - elif self.status == 'used': - print "Price is $" .format(self.price * 0.20) - else: - print "For Sale " + "Price is $" + str(self.price) - - return self - - - - -product1=Product('tidepods', 200, 4.60, 'tide', 'used' ) -product2=Product('Box', 50, 5.60, 'rubbermaid', 'new' ) -product3=Product('shorts', 100, 24.99, 'Merona', 'defective' ) -product1.displayInfo().return1().totalprice() -print " " -product3.displayInfo().return1().totalprice() -print " " -product2.displayInfo().return1().totalprice() -print " " diff --git a/Shivi_khanuja/strings_and_lists.py b/Shivi_khanuja/strings_and_lists.py deleted file mode 100644 index a16dcb7..0000000 --- a/Shivi_khanuja/strings_and_lists.py +++ /dev/null @@ -1,5 +0,0 @@ -string = "It's thanksgiving day.It's my birthday,too!" -print string -string.find('day') -string = string.replace("day", "month") -print string diff --git a/allan b/allan deleted file mode 160000 index 1602a58..0000000 --- a/allan +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1602a5872a4696d4d90ad42a74ea95b782646e2f diff --git a/alyssa_mckee/Django/belt_reviwer/apps/book_app/models.py b/alyssa_mckee/Django/belt_reviwer/apps/book_app/models.py index 067c1d7..479bbc7 100644 --- a/alyssa_mckee/Django/belt_reviwer/apps/book_app/models.py +++ b/alyssa_mckee/Django/belt_reviwer/apps/book_app/models.py @@ -13,7 +13,7 @@ def validate_author(self, data): errors.append("Author can not be empty") #if new author is not empty and is not alpha (with spaces between) - if data['new_author'] != "" and not re.match(r'^[a-zA-Z]+([a-zA-Z ]?[a-zA-Z]+)*$',data['new_author']): + if data['new_author'] != "" and not re.match(r'^[a-zA-Z]+( ?[a-zA-Z]+)*$',data['new_author']): errors.append("Author name is not valid. Letters and spaces between words only.") return errors diff --git a/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/book.html b/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/book.html index dd0db83..de528e4 100644 --- a/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/book.html +++ b/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/book.html @@ -3,7 +3,19 @@ {{book.title}} - + + +
@@ -24,21 +36,7 @@

Reviews:

{{review.rating}} {% load static %} - {% if review.rating > 0 %} - - {%endif%} - {% if review.rating > 1 %} - - {%endif%} - {% if review.rating > 2 %} - - {%endif%} - {% if review.rating > 3 %} - - {%endif%} - {% if review.rating > 4 %} - - {%endif%} +
{{review.user.alias}} says: {{review.content}} @@ -76,7 +74,6 @@

Rating: - Stars

diff --git a/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/index.html b/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/index.html index 34861bc..208d95f 100644 --- a/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/index.html +++ b/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/index.html @@ -2,7 +2,20 @@ - + Books + + +
@@ -22,21 +35,7 @@

Recent Book Reviews:

{{review.book.title}}

Rating: {{review.rating}} {% load static %} - {% if review.rating > 0 %} - - {%endif%} - {% if review.rating > 1 %} - - {%endif%} - {% if review.rating > 2 %} - - {%endif%} - {% if review.rating > 3 %} - - {%endif%} - {% if review.rating > 4 %} - - {%endif%} +
{{review.user.alias}} says: {{review.content}}

Posted on:{{review.created_at}}

diff --git a/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/new.html b/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/new.html index 2168bfd..48add1f 100644 --- a/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/new.html +++ b/alyssa_mckee/Django/belt_reviwer/apps/book_app/templates/book_app/new.html @@ -71,7 +71,7 @@

Rating: Stars


- + diff --git a/alyssa_mckee/Django/belt_reviwer/apps/book_app/views.py b/alyssa_mckee/Django/belt_reviwer/apps/book_app/views.py index 0216254..f51581e 100644 --- a/alyssa_mckee/Django/belt_reviwer/apps/book_app/views.py +++ b/alyssa_mckee/Django/belt_reviwer/apps/book_app/views.py @@ -30,14 +30,14 @@ def index(req): #dashboard def show(req, id): if not 'user_id' in req.session: return redirect(reverse('landing')) - book = Book.objects.filter(id=id) - if not book.exists(): + book = Book.objects.filter(id=id).first() + if not book: return redirect(reverse("dashboard")) context = { - "book":book[0], - "reviews": list(book[0].reviews.all()), + "book":book, + "reviews": list(book.reviews.all()), } @@ -76,7 +76,7 @@ def create(req): #create author, book, and review book = Book.objects.create_book(req.POST) - - review = Review.objects.create_review(req.POST, book) + user_id = req.session['user_id'] + review = Review.objects.create_review(req.POST, book, user_id) return redirect(reverse("dashboard")) \ No newline at end of file diff --git a/alyssa_mckee/Django/belt_reviwer/apps/review_app/models.py b/alyssa_mckee/Django/belt_reviwer/apps/review_app/models.py index 1b1b31b..631367b 100644 --- a/alyssa_mckee/Django/belt_reviwer/apps/review_app/models.py +++ b/alyssa_mckee/Django/belt_reviwer/apps/review_app/models.py @@ -7,15 +7,18 @@ def validate_review(self, data): errors = [] if len(data['content']) == 0: errors.append("review can not be empty") + + if data['rating'] not in [1,2,3,4,5]: + errors.append("not a valid rating, nice try") return errors - def create_review(self, data, book): + def create_review(self, data, book, user_id): print(data) return Review.objects.create( content=data['content'], rating=int(data['rating']), book=book, - user=User.objects.get(id=data['user_id']) + user=User.objects.get(id=user_id) ) diff --git a/alyssa_mckee/Django/belt_reviwer/apps/review_app/views.py b/alyssa_mckee/Django/belt_reviwer/apps/review_app/views.py index b4e71f2..edb12b6 100644 --- a/alyssa_mckee/Django/belt_reviwer/apps/review_app/views.py +++ b/alyssa_mckee/Django/belt_reviwer/apps/review_app/views.py @@ -9,7 +9,9 @@ def flash_errors(req, errors, tag=""): def create(req): if req.method != "POST": return redirect(reverse("dashboard")) - + + user_id = req.session['user_id'] + errors = Review.objects.validate_review(req.POST) print(errors) if errors: @@ -17,7 +19,7 @@ def create(req): print("error") return redirect(reverse("show_book", kwargs={"id":req.POST['book_id']})) book = Book.objects.get(id=req.POST['book_id']) - review = Review.objects.create_review(req.POST, book) + review = Review.objects.create_review(req.POST, book, user_id) return redirect(reverse("show_book", kwargs={"id":req.POST['book_id']})) diff --git a/alyssa_mckee/Django/belt_reviwer/db.sqlite3 b/alyssa_mckee/Django/belt_reviwer/db.sqlite3 index 518e006..d6b91a2 100644 Binary files a/alyssa_mckee/Django/belt_reviwer/db.sqlite3 and b/alyssa_mckee/Django/belt_reviwer/db.sqlite3 differ diff --git a/Shivi_khanuja/Django/hello_world/apps/__init__.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/__init__.py similarity index 100% rename from Shivi_khanuja/Django/hello_world/apps/__init__.py rename to alyssa_mckee/Django/class_based_views_practice/djangostore/apps/__init__.py diff --git a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/__init__.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/__init__.py similarity index 100% rename from Shivi_khanuja/Django/hello_world/apps/hello_world_app/__init__.py rename to alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/__init__.py diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/admin.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/apps.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/apps.py new file mode 100644 index 0000000..864c43e --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ProductsConfig(AppConfig): + name = 'products' diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0001_initial.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0001_initial.py new file mode 100644 index 0000000..ddbc1ef --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0001_initial.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-09-27 22:55 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('manufacturer', models.CharField(max_length=255)), + ('name', models.CharField(max_length=255)), + ('price', models.DecimalField(decimal_places=2, max_digits=10)), + ('description', models.TextField()), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + ), + migrations.CreateModel( + name='Store', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ('products', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='store', to='products.Product')), + ], + ), + ] diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0002_auto_20170927_1835.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0002_auto_20170927_1835.py new file mode 100644 index 0000000..edb4c25 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0002_auto_20170927_1835.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-09-27 23:35 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='StoreManager', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + ), + migrations.RenameField( + model_name='product', + old_name='manufacturer', + new_name='type', + ), + ] diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0003_auto_20170927_1904.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0003_auto_20170927_1904.py new file mode 100644 index 0000000..c5d9002 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0003_auto_20170927_1904.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-09-28 00:04 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0002_auto_20170927_1835'), + ] + + operations = [ + migrations.AlterField( + model_name='product', + name='price', + field=models.DecimalField(decimal_places=2, max_digits=5), + ), + ] diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0004_auto_20170927_1909.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0004_auto_20170927_1909.py new file mode 100644 index 0000000..1dc55a0 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0004_auto_20170927_1909.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-09-28 00:09 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0003_auto_20170927_1904'), + ] + + operations = [ + migrations.AlterField( + model_name='product', + name='description', + field=models.CharField(max_length=50), + ), + ] diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0005_auto_20170927_1937.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0005_auto_20170927_1937.py new file mode 100644 index 0000000..5891f50 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0005_auto_20170927_1937.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-09-28 00:37 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0004_auto_20170927_1909'), + ] + + operations = [ + migrations.RemoveField( + model_name='store', + name='products', + ), + migrations.DeleteModel( + name='Store', + ), + ] diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0006_delete_storemanager.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0006_delete_storemanager.py new file mode 100644 index 0000000..ead2930 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0006_delete_storemanager.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-09-28 15:15 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0005_auto_20170927_1937'), + ] + + operations = [ + migrations.DeleteModel( + name='StoreManager', + ), + ] diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0007_auto_20170928_1135.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0007_auto_20170928_1135.py new file mode 100644 index 0000000..95c5c63 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0007_auto_20170928_1135.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-09-28 16:35 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0006_delete_storemanager'), + ] + + operations = [ + migrations.RenameField( + model_name='product', + old_name='type', + new_name='department', + ), + ] diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0008_auto_20170928_1150.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0008_auto_20170928_1150.py new file mode 100644 index 0000000..54633c8 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/0008_auto_20170928_1150.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-09-28 16:50 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0007_auto_20170928_1135'), + ] + + operations = [ + migrations.AlterField( + model_name='product', + name='created_at', + field=models.DateField(auto_now_add=True), + ), + migrations.AlterField( + model_name='product', + name='price', + field=models.DecimalField(decimal_places=2, max_digits=6), + ), + migrations.AlterField( + model_name='product', + name='updated_at', + field=models.DateField(auto_now=True), + ), + ] diff --git a/Shivi_khanuja/Django/hello_world/apps/hello_world_app/migrations/__init__.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/__init__.py similarity index 100% rename from Shivi_khanuja/Django/hello_world/apps/hello_world_app/migrations/__init__.py rename to alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/migrations/__init__.py diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/models.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/models.py new file mode 100644 index 0000000..80e48e1 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/models.py @@ -0,0 +1,88 @@ +from django.db import models +from decimal import * +import re + +# Create your models here. + + + +class ProductManager(models.Manager): + def validate(self, data): + errors = [] + + #brand + if len(data['department']) == 0: + errors.append("Product type can not be empty") + + #name + if len(data['name']) < 8: + errors.append("Name must be at least 8 characters") + + #price + if len(data['price']) == 0: + errors.append("Please specify a price") + + + elif not re.match(r'^[0-9]+(.[0-9][0-9])?$',data['price']): + errors.append("Price not valid. do not include the dollar sign, and if price is less that 1 enter a leading 0 ") + + + elif Decimal(data['price']) < Decimal(0.01): + errors.append("Price must be greater than 0") + elif Decimal(data['price']) > Decimal(999.99): + errors.append("We appologize, but we do not handle products priced greater than $999.99") + + #description + if len(data['description']) == 0: + errors.append("description can not be empty") + if len(data['description']) > 50: + errors.append("description can not be more than 50 characters") + + return errors + + def create_product(self, data): + return self.create( + department = data['department'], + name = data['name'], + price = float(data['price']), + description = data['description'], + ) + + def update_product(self, data, id): + product = self.filter(id=id).first() + + product.department = data['department'] + product.name = data['name'] + product.price = data['price'] + product.description = data['description'] + + product.save() + + def delete_product(self, id): + Product.objects.filter(id=id).first().delete() + + +class Product(models.Model): + department = models.CharField(max_length=255) + name = models.CharField(max_length=255) + price = models.DecimalField(max_digits=6 ,decimal_places = 2) + description = models.CharField(max_length=50) + + objects = ProductManager() + + created_at = models.DateField(auto_now_add=True) + updated_at = models.DateField(auto_now=True) + + + +# class StoreManager(models.Model): + # def add_product(data): + + + # pass + +# class Store(models.Model): + # products = models.ForeignKey(Product, related_name="store") + + # created_at = models.DateTimeField(auto_now_add=True) + # updated_at = models.DateTimeField(auto_now=True) \ No newline at end of file diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/static/products/styles.css b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/static/products/styles.css new file mode 100644 index 0000000..cfb2848 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/static/products/styles.css @@ -0,0 +1,43 @@ +*{ font-family: sans-serif; } + +table{ border: 2px solid black; } + +body table thead th{ background: #bbb } + +tr:nth-child(2n){ background: white; } + +tr:nth-child(2n-1){ background: #efefef; } + +td, th{ + text-align: left; + padding: 3px 5px; + border-right: 2px solid black; +} +label{ + margin-top: 20px; + display: inline-block; + vertical-align: top; + width: 100px; + text-align: right; +} +input, select, textarea{ + margin-top: 20px; + width: 200px; +} +button{ + margin-left: 250px; + width: 60px; +} +.error{color: red;} + +.nav{ + width: 90%; + text-align: right; +} +.nav li{ + list-style: none; + display: inline; +} +.bold{ + font-weight: bold; +} \ No newline at end of file diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/templates/products/product.html b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/templates/products/product.html new file mode 100644 index 0000000..21ca3f5 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/templates/products/product.html @@ -0,0 +1,55 @@ + + + + + + {{product.name}} + {% load static %} + + + + +

{{product.name}}

+ {% if messages %} +
    + {% for message in messages %} +
  • {{message}}
  • + {%endfor%} +
+ {%endif%} +
+ {% csrf_token %} +
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+ +
+
{% csrf_token %} + +
+ + + \ No newline at end of file diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/templates/products/storefront.html b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/templates/products/storefront.html new file mode 100644 index 0000000..9ba17ba --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/templates/products/storefront.html @@ -0,0 +1,78 @@ + + + + + Stuff for Sale + {% load static %} + + + +

Traders Store

+

Product Listing:

+ + {% if products %} + + + + + + + + + + + + {% for product in products %} + + + + + + + + {%endfor%} + +
DepartmentProduct NamePriceDate AddedAction
{{product.department}}{{product.name}}{{product.price}}{{product.created_at}}Edit | Delete
+ + {% else %} +

we appologize, there are no products for sale at this time T-T

+ {%endif%} +

Add a Product:

+ {% if messages %} +
    + {% for message in messages %} +
  • {{message}}
  • + {%endfor%} +
+ {%endif%} +
+ {% csrf_token %} +
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+ +
+ + \ No newline at end of file diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/tests.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/urls.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/urls.py new file mode 100644 index 0000000..e181cf0 --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/urls.py @@ -0,0 +1,9 @@ +from django.conf.urls import url +from . import views +from .views import Stores, Products +urlpatterns=[ + url(r'^$', Stores.as_view(), name="store"), #show store, add to store +# url(), #? + url(r'^(?P[0-9]+)$', Products.as_view(),name="products"), #edit, remove products + url(r'^(?P[0-9]+)/delete$', views.delete ,name="delete"), #edit, remove products +] diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/views.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/views.py new file mode 100644 index 0000000..48c7bdc --- /dev/null +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/apps/products/views.py @@ -0,0 +1,58 @@ +from django.shortcuts import render, redirect, reverse +from django.views.generic import View +from .models import Product +from django.contrib import messages + +def flasherrors(req, errors): + for error in errors: + messages.error(req, error) + +# Create your views here. +class Stores(View): + def get(self, req): #show storefront all items + context = { + "products": Product.objects.all() + } + + return render(req, "products/storefront.html", context) + + def post(self, req): #add to store + errors = Product.objects.validate(req.POST) + if not errors: + Product.objects.create_product(req.POST) + else: + flasherrors(req,errors) + return redirect(reverse("store")) + +class Products(View): + def get(self, req, id): #show the item page + print("get request") + product = Product.objects.filter(id=id).first() + if product: + context = { + "product": product, + } + return render(req, "products/product.html", context) + return redirect(reverse("store")) + + def post(self, req, id): #process item edit/update + print("patch request") + product = Product.objects.filter(id=id).first() + if product: + errors = Product.objects.validate(req.POST) + if errors: + flasherrors(req,errors) + return redirect(reverse("products", kwargs={"id": id})) + + Product.objects.update_product(req.POST, id) + + return redirect(reverse("store")) + +def delete(req, id): #process item delete + print("delete request") + product = Product.objects.filter(id=id).first() + if product: + Product.objects.delete_product(id) + return redirect(reverse("store")) + + diff --git a/alyssa_mckee/Django/class_based_views_practice/djangostore/db.sqlite3 b/alyssa_mckee/Django/class_based_views_practice/djangostore/db.sqlite3 new file mode 100644 index 0000000..d03da75 Binary files /dev/null and b/alyssa_mckee/Django/class_based_views_practice/djangostore/db.sqlite3 differ diff --git a/Shivi_khanuja/Django/hello_world/main/__init__.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/main/__init__.py similarity index 100% rename from Shivi_khanuja/Django/hello_world/main/__init__.py rename to alyssa_mckee/Django/class_based_views_practice/djangostore/main/__init__.py diff --git a/KatherineK/datetime/main/settings.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/main/settings.py similarity index 93% rename from KatherineK/datetime/main/settings.py rename to alyssa_mckee/Django/class_based_views_practice/djangostore/main/settings.py index e328c06..60bb69f 100644 --- a/KatherineK/datetime/main/settings.py +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/main/settings.py @@ -1,121 +1,121 @@ -""" -Django settings for main project. - -Generated by 'django-admin startproject' using Django 1.11.5. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '!7g9&*o97a-oazwg2b)lba3exn@6%sy30**(y(8^htn&8(54a(' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'apps.datetimeapp', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'main.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'main.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.11/howto/static-files/ - -STATIC_URL = '/static/' +""" +Django settings for main project. + +Generated by 'django-admin startproject' using Django 1.11.5. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.11/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + +SESSION_SAVE_EVERY_REQUEST = True +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '-u_&uel47+t@d4mf0*iz^xcdt1i&2_@*l$c&ilsh3i8h$q$z+0' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'apps.products', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'main.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'main.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.11/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.11/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.11/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/kevin_camp/django/time_display/main/urls.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/main/urls.py similarity index 85% rename from kevin_camp/django/time_display/main/urls.py rename to alyssa_mckee/Django/class_based_views_practice/djangostore/main/urls.py index df73bb4..ecfafdb 100644 --- a/kevin_camp/django/time_display/main/urls.py +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/main/urls.py @@ -1,20 +1,22 @@ -"""main URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url, include - -urlpatterns = [ - url(r'^', include('apps.time_display.urls')), -] +"""main URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.11/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url, include +from django.contrib import admin + +urlpatterns = [ + url(r'^products/', include("apps.products.urls")), + url(r'^admin/', admin.site.urls), +] diff --git a/Shivi_khanuja/Django/hello_world/main/wsgi.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/main/wsgi.py similarity index 96% rename from Shivi_khanuja/Django/hello_world/main/wsgi.py rename to alyssa_mckee/Django/class_based_views_practice/djangostore/main/wsgi.py index 064e759..424f219 100644 --- a/Shivi_khanuja/Django/hello_world/main/wsgi.py +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/main/wsgi.py @@ -1,16 +1,16 @@ -""" -WSGI config for main project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - -application = get_wsgi_application() +""" +WSGI config for main project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") + +application = get_wsgi_application() diff --git a/KatherineK/datetime/manage.py b/alyssa_mckee/Django/class_based_views_practice/djangostore/manage.py similarity index 97% rename from KatherineK/datetime/manage.py rename to alyssa_mckee/Django/class_based_views_practice/djangostore/manage.py index 1a1848d..ad5d3e7 100644 --- a/KatherineK/datetime/manage.py +++ b/alyssa_mckee/Django/class_based_views_practice/djangostore/manage.py @@ -1,22 +1,22 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv) diff --git a/alyssa_mckee/Django/words/apps/words_app/views.py b/alyssa_mckee/Django/words/apps/words_app/views.py index 45f48d5..40e1ee6 100644 --- a/alyssa_mckee/Django/words/apps/words_app/views.py +++ b/alyssa_mckee/Django/words/apps/words_app/views.py @@ -27,7 +27,6 @@ def clear(request): request.session.pop('words') return redirect("/session_words") - pass def num_extention(num): num = int(num) diff --git a/daniel_guerrero/flask_fundamentals/RPS/mydb.mwb b/daniel_guerrero/flask_fundamentals/RPS/mydb.mwb deleted file mode 100644 index 6dbf7ed..0000000 Binary files a/daniel_guerrero/flask_fundamentals/RPS/mydb.mwb and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/RPS/mysqlconnection.py b/daniel_guerrero/flask_fundamentals/RPS/mysqlconnection.py deleted file mode 100644 index 603fa9d..0000000 --- a/daniel_guerrero/flask_fundamentals/RPS/mysqlconnection.py +++ /dev/null @@ -1,40 +0,0 @@ -""" import the necessary modules """ -from flask_sqlalchemy import SQLAlchemy -from sqlalchemy.sql import text -# Create a class that will give us an object that we can use to connect to a database -class MySQLConnection(object): - def __init__(self, app, db): - config = { - 'host': 'localhost', - 'database': db, # we got db as an argument - 'user': 'root', - 'password': 'root', - 'port': '3306' # change the port to match the port your SQL server is running on - } - # this will use the above values to generate the path to connect to your sql database - DATABASE_URI = "mysql://{}:{}@127.0.0.1:{}/{}".format(config['user'], config['password'], config['port'], config['database']) - app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI - app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True - # establish the connection to database - self.db = SQLAlchemy(app) - # this is the method we will use to query the database - def query_db(self, query, data=None): - result = self.db.session.execute(text(query), data) - if query[0:6].lower() == 'select': - # if the query was a select - # convert the result to a list of dictionaries - list_result = [dict(r) for r in result] - # return the results as a list of dictionaries - return list_result - elif query[0:6].lower() == 'insert': - # if the query was an insert, return the id of the - # commit changes - self.db.session.commit() - # row that was inserted - return result.lastrowid - else: - # if the query was an update or delete, return nothing and commit changes - self.db.session.commit() -# This is the module method to be called by the user in server.py. Make sure to provide the db name! -def MySQLConnector(app, db): - return MySQLConnection(app, db) diff --git a/daniel_guerrero/flask_fundamentals/RPS/server.py b/daniel_guerrero/flask_fundamentals/RPS/server.py deleted file mode 100644 index bd6f64c..0000000 --- a/daniel_guerrero/flask_fundamentals/RPS/server.py +++ /dev/null @@ -1,116 +0,0 @@ -from flask import Flask, render_template, redirect, request, session, flash -from mysqlconnection import MySQLConnector -import random -import sys - - - -ROCK = 0 -PAPER = 1 -SCISSORS = 2 - - - -def log(obj): - print(obj, file=sys.stderr) - - -app = Flask(__name__) - -app.secret_key = "secret" - -mysql = MySQLConnector(app, 'mydb') - - - -@app.route("/") -def index(): - log(mysql.query_db("SELECT * FROM user")) - return render_template("index.html") - - - -@app.route("/game") -def game(): - query = "SELECT wins, losses, ties FROM user WHERE name = :name" - data = mysql.query_db(query, {'name': session['name']}) - - return render_template("game.html", name = session['name'], wins = data[0]['wins'], losses = data[0]['losses'], ties = data[0]['ties']) - - - -@app.route("/login", methods=["POST"]) -def login(): - if not 'name' in session: - if not 'name' in request.form: - redirect ('/') - session['name'] = request.form['name'] - - session['name'] = request.form['name'] - - - temp = mysql.query_db("SELECT COUNT(name) AS count FROM user WHERE name = :name", {"name":session['name']}) - if temp[0]['count'] == 0: - mysql.query_db("INSERT INTO user(name, wins, losses, ties) VALUES( :name, 0,0,0 )", {"name": session['name']}) - log(mysql.query_db("SELECT * FROM user")) - - return redirect("/game") - - -@app.route('/process', methods=['POST']) -def process(): - computer = random.randint(0,2) - result = "" - - if computer == ROCK: - if int(request.form['choice']) == PAPER: - flash("The Computer picked rock \n you picked paper, You Win!") - result = "win" - - elif int(request.form['choice']) == SCISSORS: - flash("The Computer picked rock \n you picked scissors, You Lose!") - result = "lose" - elif int(request.form['choice']) == ROCK: - flash("The Computer picked rock \n you picked rock, You tie!") - result = "tie" - elif computer == PAPER: - if int(request.form['choice']) == PAPER: - flash("The Computer picked paper \n you picked paper, You Tie!") - result = "tie" - elif int(request.form['choice']) == SCISSORS: - flash("The Computer picked paper \n you picked scissors, You Win!") - result = "win" - elif int(request.form['choice']) == ROCK: - flash("The Computer picked paper \n you picked rock, You Lose!") - result = "lose" - elif computer == SCISSORS: - if int(request.form['choice']) == PAPER: - flash("The Computer picked scissors \n you picked paper, You Lose!") - result = "lose" - elif int(request.form['choice']) == SCISSORS: - flash("The Computer picked scissors \n you picked scissors, You Tie!") - result = "tie" - elif int(request.form['choice']) == ROCK: - flash("The Computer picked scissors \n you picked rock, You Win!") - result = "win" - - if result == "win": - query= "UPDATE user SET wins = wins+1 WHERE name = :name" - data = {'name': session['name']} - mysql.query_db(query, data) - if result == "lose": - query= "UPDATE user SET losses = losses+1 WHERE name = :name" - data = {'name': session['name']} - mysql.query_db(query, data) - if result == "tie": - query= "UPDATE user SET ties = ties+1 WHERE name = :name" - data = {'name': session['name']} - mysql.query_db(query, data) - - - return redirect('/game') - - - - -app.run(debug=True) diff --git a/daniel_guerrero/flask_fundamentals/RPS/static/Thumbs.db b/daniel_guerrero/flask_fundamentals/RPS/static/Thumbs.db deleted file mode 100644 index 9e16881..0000000 Binary files a/daniel_guerrero/flask_fundamentals/RPS/static/Thumbs.db and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/RPS/static/paper.jpg b/daniel_guerrero/flask_fundamentals/RPS/static/paper.jpg deleted file mode 100644 index 6d481d0..0000000 Binary files a/daniel_guerrero/flask_fundamentals/RPS/static/paper.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/RPS/static/rock.jpg b/daniel_guerrero/flask_fundamentals/RPS/static/rock.jpg deleted file mode 100644 index 519b618..0000000 Binary files a/daniel_guerrero/flask_fundamentals/RPS/static/rock.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/RPS/static/scissors.jpg b/daniel_guerrero/flask_fundamentals/RPS/static/scissors.jpg deleted file mode 100644 index cc408da..0000000 Binary files a/daniel_guerrero/flask_fundamentals/RPS/static/scissors.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/RPS/static/styles.css b/daniel_guerrero/flask_fundamentals/RPS/static/styles.css deleted file mode 100644 index 40017c1..0000000 --- a/daniel_guerrero/flask_fundamentals/RPS/static/styles.css +++ /dev/null @@ -1,18 +0,0 @@ - .win{ - color: green; - } - .lose{ - color: red; - } - img{ - width: 200px; - height: 150px; - } - #message{ - border: 1px solid black; - width: 400px; - height: 50px; - text-align: center; - vertical-align: middle; - margin-bottom: 20px; - } \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/RPS/templates/game.html b/daniel_guerrero/flask_fundamentals/RPS/templates/game.html deleted file mode 100644 index 7839df1..0000000 --- a/daniel_guerrero/flask_fundamentals/RPS/templates/game.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Rock Paper Scissors - - - -
-

You are logged in as: {{ name }}

-
-
-

Wins: {{ wins }}

-

Losses: {{ losses }}

-

Ties: {{ ties }}

-
-

Rock Paper Scissors

- -
- {% with messages = get_flashed_messages()%} - {% if messages %} - {% for message in messages %} -

0 %} - class="win" - {% endif %} - {% if message.find("Lose") >0 %} - class="lose" - {% endif %}> - {{ message }} -

- {% endfor %} - {% endif %} - {% endwith %} - -
- -
-

Choose Your Weapon:

- - - -
- - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/RPS/templates/index.html b/daniel_guerrero/flask_fundamentals/RPS/templates/index.html deleted file mode 100644 index d5ef9b0..0000000 --- a/daniel_guerrero/flask_fundamentals/RPS/templates/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Login - - -
-

login:

- - - -
- - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/counter/server.py b/daniel_guerrero/flask_fundamentals/counter/server.py deleted file mode 100644 index baf3515..0000000 --- a/daniel_guerrero/flask_fundamentals/counter/server.py +++ /dev/null @@ -1,24 +0,0 @@ -from flask import Flask, render_template, request, redirect, session -app = Flask(__name__) - -app.secret_key = "My_secret_key" - -@app.route('/') -def index(): - # initiate the count - if 'count' not in session: - session['count'] = 0 - session['count'] +=1 - return render_template('index.html', count=session['count']) - -@app.route('/index', methods=['POST']) -def increment(): - action = request.form['action'] - if action == "2": - session['count'] += 1 - elif action == "clear": - session.pop('count') - return redirect('/') - - -app.run(debug=True) diff --git a/daniel_guerrero/flask_fundamentals/counter/static/index.css b/daniel_guerrero/flask_fundamentals/counter/static/index.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/counter/static/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/counter/templates/index.html b/daniel_guerrero/flask_fundamentals/counter/templates/index.html deleted file mode 100644 index 94fa31a..0000000 --- a/daniel_guerrero/flask_fundamentals/counter/templates/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - Template Test - - - -

Your count is:

-

{{ count }}

-
- - -
- - diff --git a/daniel_guerrero/flask_fundamentals/counter/templates/user.html b/daniel_guerrero/flask_fundamentals/counter/templates/user.html deleted file mode 100644 index 784db75..0000000 --- a/daniel_guerrero/flask_fundamentals/counter/templates/user.html +++ /dev/null @@ -1,11 +0,0 @@ - - - Counter - - -

{{session['name']}}

-

{{session['email']}}

-

You have been in here: {{ counter }}

- - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/dojosurvey.py b/daniel_guerrero/flask_fundamentals/dojo_survey/dojosurvey.py deleted file mode 100644 index 76c74fb..0000000 --- a/daniel_guerrero/flask_fundamentals/dojo_survey/dojosurvey.py +++ /dev/null @@ -1,22 +0,0 @@ -from flask import Flask, request, render_template, redirect, session -app = Flask(__name__) - -app.secret_key = "my_super_secret_key" - -@app.route('/') -def index(): - return render_template('index.html') - -@app.route('/process', methods=["POST"]) -def process(): - session['survey'] = request.form - return redirect('/result') - -@app.route('/result') -def result(): - data = session['survey'] - - return render_template('result.html', data=data) - - -app.run(debug=True) diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/static/Capture.PNG b/daniel_guerrero/flask_fundamentals/dojo_survey/static/Capture.PNG deleted file mode 100644 index 7ad37d1..0000000 Binary files a/daniel_guerrero/flask_fundamentals/dojo_survey/static/Capture.PNG and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/static/Capture1.PNG b/daniel_guerrero/flask_fundamentals/dojo_survey/static/Capture1.PNG deleted file mode 100644 index 31a5100..0000000 Binary files a/daniel_guerrero/flask_fundamentals/dojo_survey/static/Capture1.PNG and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/static/Capture3.PNG b/daniel_guerrero/flask_fundamentals/dojo_survey/static/Capture3.PNG deleted file mode 100644 index 1ddcfb7..0000000 Binary files a/daniel_guerrero/flask_fundamentals/dojo_survey/static/Capture3.PNG and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/static/arrow.png b/daniel_guerrero/flask_fundamentals/dojo_survey/static/arrow.png deleted file mode 100644 index 0b4fb99..0000000 Binary files a/daniel_guerrero/flask_fundamentals/dojo_survey/static/arrow.png and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/static/arrows.png b/daniel_guerrero/flask_fundamentals/dojo_survey/static/arrows.png deleted file mode 100644 index 7447973..0000000 Binary files a/daniel_guerrero/flask_fundamentals/dojo_survey/static/arrows.png and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/static/ex.jpg b/daniel_guerrero/flask_fundamentals/dojo_survey/static/ex.jpg deleted file mode 100644 index 9541711..0000000 Binary files a/daniel_guerrero/flask_fundamentals/dojo_survey/static/ex.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/static/home.jpg b/daniel_guerrero/flask_fundamentals/dojo_survey/static/home.jpg deleted file mode 100644 index 2778e3c..0000000 Binary files a/daniel_guerrero/flask_fundamentals/dojo_survey/static/home.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/static/index.css b/daniel_guerrero/flask_fundamentals/dojo_survey/static/index.css deleted file mode 100644 index 42d846b..0000000 --- a/daniel_guerrero/flask_fundamentals/dojo_survey/static/index.css +++ /dev/null @@ -1,69 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background-color:#C1C1C1; -} -.top{ - background-color:#C1C1C1; - height: 79px; - text-align:center; - font-family:monospace; - font-weight:100; -} -.top img{ - height: 29px; - width: 29px; - margin-left: 45px; - border:2px solid; -} -#capture{ - height: 29px; - width: 114px; - border:none; -} -#capture1{ - height: 37px; - width: 29px; - border:none; -} -#capture3{ - height: 33px; - width: 229px; - border:none; -} - -.search { - width: 240px; - margin-left: 40px; -} - - -/*-------------------------------------*/ - -.midcontainer{ -background-color: white; -border: 2px solid black; -text-align:center; - height:500px; - font-family:monospace; -} -label{ - font-size: 24px; -} -.midcontainer button{ - position:relative; - margin-right:5px; -} -.midcontent{ -height:400px; -width:400px; -margin-left: 175px; -margin-top: 58px; -text-align: left; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/static/result.css b/daniel_guerrero/flask_fundamentals/dojo_survey/static/result.css deleted file mode 100644 index 904d213..0000000 --- a/daniel_guerrero/flask_fundamentals/dojo_survey/static/result.css +++ /dev/null @@ -1,65 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:710px; - width:610px; - border:2px solid black; - background-color:#C1C1C1; -} -.top{ - background-color:#C1C1C1; - height: 79px; - text-align:center; - font-family:monospace; - font-weight:100; -} -.top img{ - height: 29px; - width: 29px; - margin-left: 45px; - border:2px solid; -} -#capture{ - height: 29px; - width: 114px; - border:none; -} -#capture1{ - height: 37px; - width: 29px; - border:none; -} -#capture3{ - height: 33px; - width: 229px; - border:none; -} - -.search { - width: 240px; - margin-left: 40px; -} - - -/*-------------------------------------*/ - -.midcontainer{ -background-color: white; -border: 2px solid black; -text-align:center; -height:600px; - font-family:monospace; -} -.midcontainer p{ -width: 685px; -height: 21px; -margin-left: 26px; - -} -.midcontainer button{ - position:relative; - margin-right:5px; -} diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/templates/index.html b/daniel_guerrero/flask_fundamentals/dojo_survey/templates/index.html deleted file mode 100644 index 2c862d2..0000000 --- a/daniel_guerrero/flask_fundamentals/dojo_survey/templates/index.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - Coding Dojo Survey! - - - -
-
-

Dojo Survey Index

- - - - - - -
-
-
-
- - - - - - - - - - - - -
- - -
- -
- -
-
- - -
- - - - - - diff --git a/daniel_guerrero/flask_fundamentals/dojo_survey/templates/result.html b/daniel_guerrero/flask_fundamentals/dojo_survey/templates/result.html deleted file mode 100644 index b630692..0000000 --- a/daniel_guerrero/flask_fundamentals/dojo_survey/templates/result.html +++ /dev/null @@ -1,38 +0,0 @@ - - - Result Page - - - -
-
-

Dojo Survey Index

- - - - - - -
-
-
- -

Submitted Info

-

Name: {{ data.name }}

-

Location: {{ data.location }}

-

Language: {{ data.language }}

-

comment: {{ data.comment if data.comment != "" else "No comment" }}

- Back to Survey -
-
- - -
- - - - - - - - diff --git a/daniel_guerrero/flask_fundamentals/great_number_game/server.py b/daniel_guerrero/flask_fundamentals/great_number_game/server.py deleted file mode 100644 index baf3515..0000000 --- a/daniel_guerrero/flask_fundamentals/great_number_game/server.py +++ /dev/null @@ -1,24 +0,0 @@ -from flask import Flask, render_template, request, redirect, session -app = Flask(__name__) - -app.secret_key = "My_secret_key" - -@app.route('/') -def index(): - # initiate the count - if 'count' not in session: - session['count'] = 0 - session['count'] +=1 - return render_template('index.html', count=session['count']) - -@app.route('/index', methods=['POST']) -def increment(): - action = request.form['action'] - if action == "2": - session['count'] += 1 - elif action == "clear": - session.pop('count') - return redirect('/') - - -app.run(debug=True) diff --git a/daniel_guerrero/flask_fundamentals/great_number_game/static/algo_test.js b/daniel_guerrero/flask_fundamentals/great_number_game/static/algo_test.js deleted file mode 100644 index 0a60950..0000000 --- a/daniel_guerrero/flask_fundamentals/great_number_game/static/algo_test.js +++ /dev/null @@ -1,14 +0,0 @@ -var Queue = function(){ - this.head = null; - - this.enqueue = function(value){ - console.log(value); - } -} - -var q = new Queue(); - - -q.enqueue(6); - - diff --git a/daniel_guerrero/flask_fundamentals/great_number_game/static/class.js b/daniel_guerrero/flask_fundamentals/great_number_game/static/class.js deleted file mode 100644 index b9dbcad..0000000 --- a/daniel_guerrero/flask_fundamentals/great_number_game/static/class.js +++ /dev/null @@ -1,33 +0,0 @@ -var Node = require('./node').Node; - -function LinkedList(){ - this._length = 0; - this.head = null; - this.tail = null; -} -// look up prototype -LinkedList.prototype = { - add: function (value) { - var node = new Node(value); - - if (!this.head){ - this.head = node; - this.tail = node; - this._length++; - - return node; - } - - this.tail.next = node; - - node.previous = tail; - - this.tail = node; - - this._length++; - - - - - -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/great_number_game/static/index.css b/daniel_guerrero/flask_fundamentals/great_number_game/static/index.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/great_number_game/static/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/great_number_game/templates/index.html b/daniel_guerrero/flask_fundamentals/great_number_game/templates/index.html deleted file mode 100644 index 94fa31a..0000000 --- a/daniel_guerrero/flask_fundamentals/great_number_game/templates/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - Template Test - - - -

Your count is:

-

{{ count }}

-
- - -
- - diff --git a/daniel_guerrero/flask_fundamentals/great_number_game/templates/user.html b/daniel_guerrero/flask_fundamentals/great_number_game/templates/user.html deleted file mode 100644 index c00da87..0000000 --- a/daniel_guerrero/flask_fundamentals/great_number_game/templates/user.html +++ /dev/null @@ -1,11 +0,0 @@ - - - Counter - - -

{{session['name']}}

- -

You have been in here: {{ counter }}

- - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/hello_flask/hello.py b/daniel_guerrero/flask_fundamentals/hello_flask/hello.py deleted file mode 100644 index 5f50967..0000000 --- a/daniel_guerrero/flask_fundamentals/hello_flask/hello.py +++ /dev/null @@ -1,21 +0,0 @@ -from flask import Flask, render_template # Import Flask to allow us to create our app, and import - # render_template to allow us to render index.html. -app = Flask(__name__) # Global variable __name__ tells Flask whether or not we - # are running the file directly or importing it as a module. -@app.route('/') # The "@" symbol designates a "decorator" which attaches the - # following function to the '/' route. This means that - # whenever we send a request to localhost:5000/ we will run - # the following "hello_world" function. -def hello_world(): - return render_template('index.html') # Render the template and return it! - -@app.route('/projects') -def projects(): - return render_template('projects.html') # Render the template and return it! - -@app.route('/about') -def about(): - return render_template('about.html') # Render the template and return it! - - -app.run(debug=True) # Run the app in debug mode. diff --git a/daniel_guerrero/flask_fundamentals/hello_flask/templates/about.html b/daniel_guerrero/flask_fundamentals/hello_flask/templates/about.html deleted file mode 100644 index a58e3ce..0000000 --- a/daniel_guerrero/flask_fundamentals/hello_flask/templates/about.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - -

- I am a Python web developer and love going to the hackathons in my spare tiem. I love making things - and meeting new people! People might be surprised to learn that I own a horse and used to be a horse - trainer! -

- - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/hello_flask/templates/index.html b/daniel_guerrero/flask_fundamentals/hello_flask/templates/index.html deleted file mode 100644 index 61e0881..0000000 --- a/daniel_guerrero/flask_fundamentals/hello_flask/templates/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - -

Hello World

-

Whatever

- - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/hello_flask/templates/projects.html b/daniel_guerrero/flask_fundamentals/hello_flask/templates/projects.html deleted file mode 100644 index bcabc07..0000000 --- a/daniel_guerrero/flask_fundamentals/hello_flask/templates/projects.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - -

- My Projects: -

-
    -
  • -Danger Zones
  • -
  • -fat Unicorn: The Poopening
  • -
  • -My Cohort
  • -
  • -Certify Me
  • -
  • -Woof Woof Go!
  • -
- - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/jvcd/server.py b/daniel_guerrero/flask_fundamentals/jvcd/server.py deleted file mode 100644 index 2426e19..0000000 --- a/daniel_guerrero/flask_fundamentals/jvcd/server.py +++ /dev/null @@ -1,37 +0,0 @@ -from flask import Flask, render_template - -app = Flask(__name__) - -@app.route('/') - -def jean_claude(): - return render_template('jean_claude.html') - -@app.route('/kickboxing') -def kickboxing(): - return render_template('kickboxing.html') - -@app.route('/bloodsport') -def bloodsport(): - return render_template('bloodsport.html') - -@app.route('/goldfish') -def goldfish(): - return render_template('goldfish.html') - -@app.route('/splits') -def splits(): - return render_template('splits.html') - -@app.route('/drunkdisco') -def drunkdisco(): - return render_template('drunkdisco.html') - -@app.route('/kicktrees') -def kicktrees(): - return render_template('kicktrees.html') - - -app.run(debug=True) - - diff --git a/daniel_guerrero/flask_fundamentals/jvcd/templates/bloodsport.html b/daniel_guerrero/flask_fundamentals/jvcd/templates/bloodsport.html deleted file mode 100644 index 75f5407..0000000 --- a/daniel_guerrero/flask_fundamentals/jvcd/templates/bloodsport.html +++ /dev/null @@ -1,18 +0,0 @@ - - - Jean Claude Van Damme - - - -

Choose Your Training

- -
- Gold Fish Snatch - Meditation Splits - - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/jvcd/templates/drunkdisco.html b/daniel_guerrero/flask_fundamentals/jvcd/templates/drunkdisco.html deleted file mode 100644 index d790719..0000000 --- a/daniel_guerrero/flask_fundamentals/jvcd/templates/drunkdisco.html +++ /dev/null @@ -1,19 +0,0 @@ - - - Jean Claude Van Damme - - - -

Drunk Disco Training

- - - - - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/jvcd/templates/goldfish.html b/daniel_guerrero/flask_fundamentals/jvcd/templates/goldfish.html deleted file mode 100644 index c749ed3..0000000 --- a/daniel_guerrero/flask_fundamentals/jvcd/templates/goldfish.html +++ /dev/null @@ -1,17 +0,0 @@ - - - Jean Claude Van Damme - - - -

Gold Fish Training!

- - - - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/jvcd/templates/jean_claude.html b/daniel_guerrero/flask_fundamentals/jvcd/templates/jean_claude.html deleted file mode 100644 index e90c60f..0000000 --- a/daniel_guerrero/flask_fundamentals/jvcd/templates/jean_claude.html +++ /dev/null @@ -1,18 +0,0 @@ - - - Jean Claude Van Damme - - - -

Choose Your Tournament

- - -
- BLOODSPORT - KICKBOXER - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/jvcd/templates/kickboxing.html b/daniel_guerrero/flask_fundamentals/jvcd/templates/kickboxing.html deleted file mode 100644 index 47eae10..0000000 --- a/daniel_guerrero/flask_fundamentals/jvcd/templates/kickboxing.html +++ /dev/null @@ -1,17 +0,0 @@ - - - Jean Claude Van Damme - - - -

Kicking Trees Training

- -
- Kick Trees - Drunk Disco - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/jvcd/templates/kicktrees.html b/daniel_guerrero/flask_fundamentals/jvcd/templates/kicktrees.html deleted file mode 100644 index 1cd069d..0000000 --- a/daniel_guerrero/flask_fundamentals/jvcd/templates/kicktrees.html +++ /dev/null @@ -1,15 +0,0 @@ - - - Jean Claude Van Damme - - - -

Choose Your Training

- - - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/jvcd/templates/splits.html b/daniel_guerrero/flask_fundamentals/jvcd/templates/splits.html deleted file mode 100644 index acef652..0000000 --- a/daniel_guerrero/flask_fundamentals/jvcd/templates/splits.html +++ /dev/null @@ -1,15 +0,0 @@ - - - Jean Claude Van Damme - - - -

Splits Training

- - - - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/landing_page/landing_page.py b/daniel_guerrero/flask_fundamentals/landing_page/landing_page.py deleted file mode 100644 index 30a0dd4..0000000 --- a/daniel_guerrero/flask_fundamentals/landing_page/landing_page.py +++ /dev/null @@ -1,18 +0,0 @@ -from flask import Flask, render_template -app = Flask(__name__) - -@app.route('/') - -def index(): - return render_template('index.html') - -@app.route('/ninjas') -def ninjas(): - return render_template('ninjas.html') - -@app.route('/dojos/new') -def dojos(): - return render_template('dojos.html') - - -app.run(debug=True) \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/landing_page/static/dojos.css b/daniel_guerrero/flask_fundamentals/landing_page/static/dojos.css deleted file mode 100644 index b50ec2c..0000000 --- a/daniel_guerrero/flask_fundamentals/landing_page/static/dojos.css +++ /dev/null @@ -1,13 +0,0 @@ - -body { - background-color: powderblue; - text-align: center; -} - -h1 { - color: blue; -} - -p { - color: red; -} diff --git a/daniel_guerrero/flask_fundamentals/landing_page/static/index.css b/daniel_guerrero/flask_fundamentals/landing_page/static/index.css deleted file mode 100644 index 668f0d9..0000000 --- a/daniel_guerrero/flask_fundamentals/landing_page/static/index.css +++ /dev/null @@ -1,13 +0,0 @@ - -body { - background-color: powderblue; - text-align: center; -} - -h1 { - color: blue; -} - -p { - color: red; -} diff --git a/daniel_guerrero/flask_fundamentals/landing_page/static/ninjas.css b/daniel_guerrero/flask_fundamentals/landing_page/static/ninjas.css deleted file mode 100644 index b50ec2c..0000000 --- a/daniel_guerrero/flask_fundamentals/landing_page/static/ninjas.css +++ /dev/null @@ -1,13 +0,0 @@ - -body { - background-color: powderblue; - text-align: center; -} - -h1 { - color: blue; -} - -p { - color: red; -} diff --git a/daniel_guerrero/flask_fundamentals/landing_page/templates/dojos.html b/daniel_guerrero/flask_fundamentals/landing_page/templates/dojos.html deleted file mode 100644 index d19c719..0000000 --- a/daniel_guerrero/flask_fundamentals/landing_page/templates/dojos.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -

-

- - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/landing_page/templates/index.html b/daniel_guerrero/flask_fundamentals/landing_page/templates/index.html deleted file mode 100644 index 6b6a1ba..0000000 --- a/daniel_guerrero/flask_fundamentals/landing_page/templates/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -

Coding Dojo is the best!

-

Did you read the top ???

- - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/landing_page/templates/ninjas.html b/daniel_guerrero/flask_fundamentals/landing_page/templates/ninjas.html deleted file mode 100644 index bc70f86..0000000 --- a/daniel_guerrero/flask_fundamentals/landing_page/templates/ninjas.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -

-

- - \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/ninja/ninja.py b/daniel_guerrero/flask_fundamentals/ninja/ninja.py deleted file mode 100644 index e7500a2..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/ninja.py +++ /dev/null @@ -1,34 +0,0 @@ -from flask import Flask, render_template, request, redirect -app = Flask(__name__) - - -@app.route('/') -def index(): - return render_template('index.html') - -@app.route('/ninja') -def ninja(): - return render_template('ninja.html') - -@app.route('/ninja/blue') -def blue(): - return render_template('blue.html') - -@app.route('/ninja/orange') -def orange(): - return render_template('orange.html') - -@app.route('/ninja/red') -def red(): - return render_template('red.html') - -@app.route('/ninja/purple') -def purple(): - return render_template('purple.html') - -@app.route('/ninja/hack') -def hack(): - return render_template('hack.html') - - -app.run(debug=True) diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/april.css b/daniel_guerrero/flask_fundamentals/ninja/static/april.css deleted file mode 100644 index 904d213..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/static/april.css +++ /dev/null @@ -1,65 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:710px; - width:610px; - border:2px solid black; - background-color:#C1C1C1; -} -.top{ - background-color:#C1C1C1; - height: 79px; - text-align:center; - font-family:monospace; - font-weight:100; -} -.top img{ - height: 29px; - width: 29px; - margin-left: 45px; - border:2px solid; -} -#capture{ - height: 29px; - width: 114px; - border:none; -} -#capture1{ - height: 37px; - width: 29px; - border:none; -} -#capture3{ - height: 33px; - width: 229px; - border:none; -} - -.search { - width: 240px; - margin-left: 40px; -} - - -/*-------------------------------------*/ - -.midcontainer{ -background-color: white; -border: 2px solid black; -text-align:center; -height:600px; - font-family:monospace; -} -.midcontainer p{ -width: 685px; -height: 21px; -margin-left: 26px; - -} -.midcontainer button{ - position:relative; - margin-right:5px; -} diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/blue.css b/daniel_guerrero/flask_fundamentals/ninja/static/blue.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/static/blue.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/blue.jpg b/daniel_guerrero/flask_fundamentals/ninja/static/blue.jpg deleted file mode 100644 index c049cfd..0000000 Binary files a/daniel_guerrero/flask_fundamentals/ninja/static/blue.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/index.css b/daniel_guerrero/flask_fundamentals/ninja/static/index.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/static/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/ninja.css b/daniel_guerrero/flask_fundamentals/ninja/static/ninja.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/static/ninja.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/notapril.css b/daniel_guerrero/flask_fundamentals/ninja/static/notapril.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/static/notapril.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/notapril.jpg b/daniel_guerrero/flask_fundamentals/ninja/static/notapril.jpg deleted file mode 100644 index 39b2f0a..0000000 Binary files a/daniel_guerrero/flask_fundamentals/ninja/static/notapril.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/orange.css b/daniel_guerrero/flask_fundamentals/ninja/static/orange.css deleted file mode 100644 index 5ecf6bd..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/static/orange.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#FA9128, white,#FA9128); - background-color:#FA9128; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/orange.jpg b/daniel_guerrero/flask_fundamentals/ninja/static/orange.jpg deleted file mode 100644 index 4ad75d0..0000000 Binary files a/daniel_guerrero/flask_fundamentals/ninja/static/orange.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/purple.css b/daniel_guerrero/flask_fundamentals/ninja/static/purple.css deleted file mode 100644 index 4ee45bd..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/static/purple.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#AC74AD, white, #AC74AD); - background-color:#AC74AD; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/purple.jpg b/daniel_guerrero/flask_fundamentals/ninja/static/purple.jpg deleted file mode 100644 index 8912292..0000000 Binary files a/daniel_guerrero/flask_fundamentals/ninja/static/purple.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/red.css b/daniel_guerrero/flask_fundamentals/ninja/static/red.css deleted file mode 100644 index d7f2ce4..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/static/red.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#F73030, white, #F73030); - background-color:#F73030; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/red.jpg b/daniel_guerrero/flask_fundamentals/ninja/static/red.jpg deleted file mode 100644 index 57fb2a3..0000000 Binary files a/daniel_guerrero/flask_fundamentals/ninja/static/red.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/ninja/static/tmnt.png b/daniel_guerrero/flask_fundamentals/ninja/static/tmnt.png deleted file mode 100644 index 941c82e..0000000 Binary files a/daniel_guerrero/flask_fundamentals/ninja/static/tmnt.png and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/ninja/templates/april.html b/daniel_guerrero/flask_fundamentals/ninja/templates/april.html deleted file mode 100644 index b630692..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/templates/april.html +++ /dev/null @@ -1,38 +0,0 @@ - - - Result Page - - - -
-
-

Dojo Survey Index

- - - - - - -
-
-
- -

Submitted Info

-

Name: {{ data.name }}

-

Location: {{ data.location }}

-

Language: {{ data.language }}

-

comment: {{ data.comment if data.comment != "" else "No comment" }}

- Back to Survey -
-
- - -
- - - - - - - - diff --git a/daniel_guerrero/flask_fundamentals/ninja/templates/blue.html b/daniel_guerrero/flask_fundamentals/ninja/templates/blue.html deleted file mode 100644 index b0a01be..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/templates/blue.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Ninjas - - - -
-

Leonardo

- -
- - - - - - diff --git a/daniel_guerrero/flask_fundamentals/ninja/templates/index.html b/daniel_guerrero/flask_fundamentals/ninja/templates/index.html deleted file mode 100644 index f55c0a8..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/templates/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Ninjas - - - -
-

NO NINJAS HERE

- -
- - - - - - diff --git a/daniel_guerrero/flask_fundamentals/ninja/templates/ninja.html b/daniel_guerrero/flask_fundamentals/ninja/templates/ninja.html deleted file mode 100644 index c1cb516..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/templates/ninja.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Ninjas - - - -
-

T M N T

- -
- - - - - - diff --git a/daniel_guerrero/flask_fundamentals/ninja/templates/notapril.html b/daniel_guerrero/flask_fundamentals/ninja/templates/notapril.html deleted file mode 100644 index 7c855a8..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/templates/notapril.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Ninjas - - - -
-

NO NINJAS HERE

- -
- - - - - - diff --git a/daniel_guerrero/flask_fundamentals/ninja/templates/orange.html b/daniel_guerrero/flask_fundamentals/ninja/templates/orange.html deleted file mode 100644 index 5c00530..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/templates/orange.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - Michelangelo - - - -
-

Michelangelo

- -
- - - - - - - - - diff --git a/daniel_guerrero/flask_fundamentals/ninja/templates/purple.html b/daniel_guerrero/flask_fundamentals/ninja/templates/purple.html deleted file mode 100644 index 6fddd7c..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/templates/purple.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - Donatello - - - -
-

Donatello

- -
- - - - - - - - diff --git a/daniel_guerrero/flask_fundamentals/ninja/templates/red.html b/daniel_guerrero/flask_fundamentals/ninja/templates/red.html deleted file mode 100644 index be3b1f0..0000000 --- a/daniel_guerrero/flask_fundamentals/ninja/templates/red.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - Raphael - - - -
-

Raphael

- -
- - - - - - - - diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/april.css b/daniel_guerrero/flask_fundamentals/tmnt/static/april.css deleted file mode 100644 index 904d213..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/static/april.css +++ /dev/null @@ -1,65 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:710px; - width:610px; - border:2px solid black; - background-color:#C1C1C1; -} -.top{ - background-color:#C1C1C1; - height: 79px; - text-align:center; - font-family:monospace; - font-weight:100; -} -.top img{ - height: 29px; - width: 29px; - margin-left: 45px; - border:2px solid; -} -#capture{ - height: 29px; - width: 114px; - border:none; -} -#capture1{ - height: 37px; - width: 29px; - border:none; -} -#capture3{ - height: 33px; - width: 229px; - border:none; -} - -.search { - width: 240px; - margin-left: 40px; -} - - -/*-------------------------------------*/ - -.midcontainer{ -background-color: white; -border: 2px solid black; -text-align:center; -height:600px; - font-family:monospace; -} -.midcontainer p{ -width: 685px; -height: 21px; -margin-left: 26px; - -} -.midcontainer button{ - position:relative; - margin-right:5px; -} diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/blue.css b/daniel_guerrero/flask_fundamentals/tmnt/static/blue.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/static/blue.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/blue.jpg b/daniel_guerrero/flask_fundamentals/tmnt/static/blue.jpg deleted file mode 100644 index c049cfd..0000000 Binary files a/daniel_guerrero/flask_fundamentals/tmnt/static/blue.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/index.css b/daniel_guerrero/flask_fundamentals/tmnt/static/index.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/static/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/ninja.css b/daniel_guerrero/flask_fundamentals/tmnt/static/ninja.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/static/ninja.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/notapril.css b/daniel_guerrero/flask_fundamentals/tmnt/static/notapril.css deleted file mode 100644 index f9891c5..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/static/notapril.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#898989, white, #898989); - background-color:#C1C1C1; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/notapril.jpg b/daniel_guerrero/flask_fundamentals/tmnt/static/notapril.jpg deleted file mode 100644 index 39b2f0a..0000000 Binary files a/daniel_guerrero/flask_fundamentals/tmnt/static/notapril.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/orange.css b/daniel_guerrero/flask_fundamentals/tmnt/static/orange.css deleted file mode 100644 index 5ecf6bd..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/static/orange.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#FA9128, white,#FA9128); - background-color:#FA9128; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/orange.jpg b/daniel_guerrero/flask_fundamentals/tmnt/static/orange.jpg deleted file mode 100644 index 4ad75d0..0000000 Binary files a/daniel_guerrero/flask_fundamentals/tmnt/static/orange.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/purple.css b/daniel_guerrero/flask_fundamentals/tmnt/static/purple.css deleted file mode 100644 index 4ee45bd..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/static/purple.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#AC74AD, white, #AC74AD); - background-color:#AC74AD; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/purple.jpg b/daniel_guerrero/flask_fundamentals/tmnt/static/purple.jpg deleted file mode 100644 index 8912292..0000000 Binary files a/daniel_guerrero/flask_fundamentals/tmnt/static/purple.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/red.css b/daniel_guerrero/flask_fundamentals/tmnt/static/red.css deleted file mode 100644 index d7f2ce4..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/static/red.css +++ /dev/null @@ -1,13 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background: linear-gradient(#F73030, white, #F73030); - background-color:#F73030; - text-align: center; -} \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/red.jpg b/daniel_guerrero/flask_fundamentals/tmnt/static/red.jpg deleted file mode 100644 index 57fb2a3..0000000 Binary files a/daniel_guerrero/flask_fundamentals/tmnt/static/red.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/tmnt/static/tmnt.png b/daniel_guerrero/flask_fundamentals/tmnt/static/tmnt.png deleted file mode 100644 index 941c82e..0000000 Binary files a/daniel_guerrero/flask_fundamentals/tmnt/static/tmnt.png and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/tmnt/templates/index.html b/daniel_guerrero/flask_fundamentals/tmnt/templates/index.html deleted file mode 100644 index 0a7ea2b..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/templates/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Disappearing Ninja - - -
-

No Ninjas Here!

-
- - - diff --git a/daniel_guerrero/flask_fundamentals/tmnt/templates/ninjas.html b/daniel_guerrero/flask_fundamentals/tmnt/templates/ninjas.html deleted file mode 100644 index e2463e9..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/templates/ninjas.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - Ninjas Found! - - -
- {% if session['myKey']=='hello' %} -
- - - - -
- {% elif color == "blue" %} - - {% elif color == "red" %} - - {% elif color == "orange" %} - - {% elif color == "purple" %} - - {% else %} - - {% endif %} -
- - - - diff --git a/daniel_guerrero/flask_fundamentals/tmnt/tmnt.py b/daniel_guerrero/flask_fundamentals/tmnt/tmnt.py deleted file mode 100644 index ec073de..0000000 --- a/daniel_guerrero/flask_fundamentals/tmnt/tmnt.py +++ /dev/null @@ -1,21 +0,0 @@ -from flask import Flask, render_template, request, redirect, session, flash, url_for -app = Flask(__name__) -app.secret_key = 'abcde12345fghij' - -@app.route('/') -def index(): - return render_template('index.html') - -@app.route('/ninja') -def ninja(): - if ('myKey' not in session) or ('myKey' in session): - session['myKey'] = 'hello' - return render_template('ninjas.html') - -@app.route('/ninja/') -def show_ninja(color): - if 'myKey' in session: - session.pop('myKey') - return render_template("ninjas.html", color=color) - -app.run(debug=True) \ No newline at end of file diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/static/Capture.PNG b/daniel_guerrero/flask_fundamentals/whatsmyname/static/Capture.PNG deleted file mode 100644 index 7ad37d1..0000000 Binary files a/daniel_guerrero/flask_fundamentals/whatsmyname/static/Capture.PNG and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/static/Capture1.PNG b/daniel_guerrero/flask_fundamentals/whatsmyname/static/Capture1.PNG deleted file mode 100644 index 31a5100..0000000 Binary files a/daniel_guerrero/flask_fundamentals/whatsmyname/static/Capture1.PNG and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/static/Capture3.PNG b/daniel_guerrero/flask_fundamentals/whatsmyname/static/Capture3.PNG deleted file mode 100644 index 1ddcfb7..0000000 Binary files a/daniel_guerrero/flask_fundamentals/whatsmyname/static/Capture3.PNG and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/static/arrow.png b/daniel_guerrero/flask_fundamentals/whatsmyname/static/arrow.png deleted file mode 100644 index 0b4fb99..0000000 Binary files a/daniel_guerrero/flask_fundamentals/whatsmyname/static/arrow.png and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/static/arrows.png b/daniel_guerrero/flask_fundamentals/whatsmyname/static/arrows.png deleted file mode 100644 index 7447973..0000000 Binary files a/daniel_guerrero/flask_fundamentals/whatsmyname/static/arrows.png and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/static/ex.jpg b/daniel_guerrero/flask_fundamentals/whatsmyname/static/ex.jpg deleted file mode 100644 index 9541711..0000000 Binary files a/daniel_guerrero/flask_fundamentals/whatsmyname/static/ex.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/static/home.jpg b/daniel_guerrero/flask_fundamentals/whatsmyname/static/home.jpg deleted file mode 100644 index 2778e3c..0000000 Binary files a/daniel_guerrero/flask_fundamentals/whatsmyname/static/home.jpg and /dev/null differ diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/static/index.css b/daniel_guerrero/flask_fundamentals/whatsmyname/static/index.css deleted file mode 100644 index 4f94003..0000000 --- a/daniel_guerrero/flask_fundamentals/whatsmyname/static/index.css +++ /dev/null @@ -1,66 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:630px; - width:800px; - border:2px solid black; - background-color:#C1C1C1; -} -.top{ - background-color:#C1C1C1; - height: 79px; - text-align:center; - font-family:monospace; - font-weight:100; -} -.top img{ - height: 29px; - width: 29px; - margin-left: 45px; - border:2px solid; -} -#capture{ - height: 29px; - width: 114px; - border:none; -} -#capture1{ - height: 37px; - width: 29px; - border:none; -} -#capture3{ - height: 33px; - width: 229px; - border:none; -} - -.search { - width: 240px; - margin-left: 40px; -} - - -/*-------------------------------------*/ - -.midcontainer{ -background-color: white; -border: 2px solid black; -text-align:center; - height:500px; - font-family:monospace; -} -.midcontainer p{ -font-size: 20px; -width: 685px; -height: 21px; -margin-left: 26px; -margin-top: 200px; -} -.midcontainer button{ - position:relative; - margin-right:5px; -} diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/static/users.css b/daniel_guerrero/flask_fundamentals/whatsmyname/static/users.css deleted file mode 100644 index e057f1c..0000000 --- a/daniel_guerrero/flask_fundamentals/whatsmyname/static/users.css +++ /dev/null @@ -1,67 +0,0 @@ -body -{ - height:600px; - width:800px; -} -.wrapper{ - height:1768px; - width:800px; - border:2px solid black; - background-color:#C1C1C1; -} -.top{ - background-color:#C1C1C1; - height: 79px; - text-align:center; - font-family:monospace; - font-weight:100; -} -.top img{ - height: 29px; - width: 29px; - margin-left: 45px; - border:2px solid; -} -#capture{ - height: 29px; - width: 114px; - border:none; -} -#capture1{ - height: 37px; - width: 29px; - border:none; -} -#capture3{ - height: 33px; - width: 229px; - border:none; -} - -.search { - width: 240px; - margin-left: 40px; -} - - -/*-------------------------------------*/ - -.midcontainer{ -background-color: white; -border: 2px solid black; -text-align:center; - height:1641px; - font-family:monospace; -} -.midcontainer p{ - border-bottom:2px solid black; -width: 685px; -height: 21px; -margin-left: 26px; - -} -.midcontainer button{ - position:relative; - - margin-right:5px; -} diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/templates/index.html b/daniel_guerrero/flask_fundamentals/whatsmyname/templates/index.html deleted file mode 100644 index 95331e9..0000000 --- a/daniel_guerrero/flask_fundamentals/whatsmyname/templates/index.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - -
-
- -

What's Your Name ?

- - - - - - - - - -
-
- - -

- Your Name : - - -

- -
- - -
- - diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/templates/users.html b/daniel_guerrero/flask_fundamentals/whatsmyname/templates/users.html deleted file mode 100644 index f2a91ed..0000000 --- a/daniel_guerrero/flask_fundamentals/whatsmyname/templates/users.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -

-

- - diff --git a/daniel_guerrero/flask_fundamentals/whatsmyname/whatsmyname.py b/daniel_guerrero/flask_fundamentals/whatsmyname/whatsmyname.py deleted file mode 100644 index 027d168..0000000 --- a/daniel_guerrero/flask_fundamentals/whatsmyname/whatsmyname.py +++ /dev/null @@ -1,15 +0,0 @@ -from flask import Flask, render_template -app = Flask(__name__) - -@app.route('/') - -def index(): - return render_template('index.html') - -@app.route('/ninjas') -def ninjas(): - return render_template('users.html') - - - -app.run(debug=True) diff --git a/daniel_guerrero/mysql/flask_mysql/mydb.mwb b/daniel_guerrero/mysql/flask_mysql/mydb.mwb deleted file mode 100644 index b743e1c..0000000 Binary files a/daniel_guerrero/mysql/flask_mysql/mydb.mwb and /dev/null differ diff --git a/daniel_guerrero/mysql/flask_mysql/mydb.mwb.bak b/daniel_guerrero/mysql/flask_mysql/mydb.mwb.bak deleted file mode 100644 index 4cf7c31..0000000 Binary files a/daniel_guerrero/mysql/flask_mysql/mydb.mwb.bak and /dev/null differ diff --git a/daniel_guerrero/mysql/flask_mysql/mysqlconnection.py b/daniel_guerrero/mysql/flask_mysql/mysqlconnection.py deleted file mode 100644 index 3adc284..0000000 --- a/daniel_guerrero/mysql/flask_mysql/mysqlconnection.py +++ /dev/null @@ -1,58 +0,0 @@ -""" import the necessary modules """ -from flask_sqlalchemy import SQLAlchemy -from sqlalchemy.sql import text - - - -# Create a class that will give us an object that we can use to connect to a database -class MySQLConnection(object): - def __init__(self, app, db): - config = { - 'host': 'localhost', - - 'database': db, # we got db as an argument - 'user': 'root', - 'password': 'root', - - 'port': '3306' # change the port to match the port your SQL server is running on - } - - - - - # this will use the above values to generate the path to connect to your sql database - DATABASE_URI = "mysql://{}:{}@127.0.0.1:{}/{}".format(config['user'], config['password'], config['port'], config['database']) - app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI - app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True - - - # establish the connection to database - self.db = SQLAlchemy(app) - - # this is the method we will use to query the database - def query_db(self, query, data=None): - result = self.db.session.execute(text(query), data) - if query[0:6].lower() == 'select': - - # if the query was a select - # convert the result to a list of dictionaries - list_result = [dict(r) for r in result] - - # return the results as a list of dictionaries - return list_result - elif query[0:6].lower() == 'insert': - - # if the query was an insert, return the id of the - # commit changes - self.db.session.commit() - - # row that was inserted - return result.lastrowid - else: - - # if the query was an update or delete, return nothing and commit changes - self.db.session.commit() - -# This is the module method to be called by the user in server.py. Make sure to provide the db name! -def MySQLConnector(app, db): - return MySQLConnection(app, db) diff --git a/daniel_guerrero/mysql/flask_mysql/server.py b/daniel_guerrero/mysql/flask_mysql/server.py deleted file mode 100644 index 734c929..0000000 --- a/daniel_guerrero/mysql/flask_mysql/server.py +++ /dev/null @@ -1,22 +0,0 @@ -from flask import Flask, render_template - - -# import the Connector function -from mysqlconnection import MySQLConnector -app = Flask(__name__) - - -# connect and store the connection in "mysql" note that you pass the database name to the function -mysql = MySQLConnector(app, 'mydb') - - -# an example of running a query -@app.route('/') -def index(): - print mysql.query_db("SELECT * FROM users") - return render_template('index.html') - - -app.run(debug=True) - - diff --git a/daniel_guerrero/mysql/flask_mysql/static/index.css b/daniel_guerrero/mysql/flask_mysql/static/index.css deleted file mode 100644 index 0e36810..0000000 --- a/daniel_guerrero/mysql/flask_mysql/static/index.css +++ /dev/null @@ -1,3 +0,0 @@ -body -{ -} \ No newline at end of file diff --git a/daniel_guerrero/mysql/flask_mysql/templates/index.html b/daniel_guerrero/mysql/flask_mysql/templates/index.html deleted file mode 100644 index b979573..0000000 --- a/daniel_guerrero/mysql/flask_mysql/templates/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - Friends - - -

These are all my friends!

-

First Name: Jay

-

Last Name: Patel

-

Occupation: Instructor

-
-

First Name: Jimmy

-

Last Name: Jun

-

Occupation: Instructor

-
-

Add a Friend

-
- - - - - - - - - -
- - diff --git a/joy_stoffer/bike.py b/joy_stoffer/bike.py deleted file mode 100644 index 7cc5e98..0000000 --- a/joy_stoffer/bike.py +++ /dev/null @@ -1,49 +0,0 @@ -class Bike(object): - def __init__(self, price, max_speed, miles = 0): - self.price = price - self.max_speed = max_speed - self.miles = miles - - def displayInfo(self): - print 'Price is :$'+ str(self.price) - print 'Maximum Speed:' + str(self.max_speed) +'mph' - print 'Total Miles:' + str(self.miles) + ' miles' - return self - - def ride(self): - self.miles += 10 - print 'riding on and rode ' + str(self.miles) - return self - #if you reverse less - def reverse(self): - if self.miles > 5: - self.miles -= 5 - print 'Had to go back... now total miles is ' + str(self.miles) - return self - else: - self.miles -= 0 - print 'Flat tire, day over' - return self - -print 'Bike One' -bike1 = Bike('2000','15') -bike1.ride() -bike1.ride() -bike1.ride() -bike1.reverse() -bike1.displayInfo() - -print 'Bike Two' -bike2 = Bike('1500', '13') -bike2.ride() -bike2.ride() -bike2.reverse() -bike2.reverse() -bike2.displayInfo() - -print 'Bike Three' -bike3 = Bike('1000', '10') -bike3.reverse() -bike3.reverse() -bike3.reverse() -bike3.displayInfo() diff --git a/kevin_camp/django/multiple_apps/apps/__init__.py b/kevin_camp/django/multiple_apps/apps/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/multiple_apps/apps/blogs/__init__.py b/kevin_camp/django/multiple_apps/apps/blogs/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/multiple_apps/apps/blogs/admin.py b/kevin_camp/django/multiple_apps/apps/blogs/admin.py deleted file mode 100644 index 4255847..0000000 --- a/kevin_camp/django/multiple_apps/apps/blogs/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/kevin_camp/django/multiple_apps/apps/blogs/apps.py b/kevin_camp/django/multiple_apps/apps/blogs/apps.py deleted file mode 100644 index 97c80a2..0000000 --- a/kevin_camp/django/multiple_apps/apps/blogs/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class BlogsConfig(AppConfig): - name = 'blogs' diff --git a/kevin_camp/django/multiple_apps/apps/blogs/migrations/__init__.py b/kevin_camp/django/multiple_apps/apps/blogs/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/multiple_apps/apps/blogs/models.py b/kevin_camp/django/multiple_apps/apps/blogs/models.py deleted file mode 100644 index c827610..0000000 --- a/kevin_camp/django/multiple_apps/apps/blogs/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/kevin_camp/django/multiple_apps/apps/blogs/tests.py b/kevin_camp/django/multiple_apps/apps/blogs/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/kevin_camp/django/multiple_apps/apps/blogs/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/kevin_camp/django/multiple_apps/apps/blogs/urls.py b/kevin_camp/django/multiple_apps/apps/blogs/urls.py deleted file mode 100644 index f019a0c..0000000 --- a/kevin_camp/django/multiple_apps/apps/blogs/urls.py +++ /dev/null @@ -1,11 +0,0 @@ -from django.conf.urls import url -from . import views - -urlpatterns = [ - url(r'^$', views.index), - url(r'^new$', views.new), - url(r'^create$', views.create), - url(r'^(?P\d+)$', views.show), - url(r'^(?P\d+)/edit$', views.edit), - url(r'^(?P\d+)/delete$', views.delete), -] diff --git a/kevin_camp/django/multiple_apps/apps/blogs/views.py b/kevin_camp/django/multiple_apps/apps/blogs/views.py deleted file mode 100644 index 8433f70..0000000 --- a/kevin_camp/django/multiple_apps/apps/blogs/views.py +++ /dev/null @@ -1,24 +0,0 @@ -from django.shortcuts import render, HttpResponse, redirect - -def index(request): - comment = "placeholder to later display all the list of blogs" - return HttpResponse(comment) - -def new(request): - comment = "placeholder to display a new form to create a new blog" - return HttpResponse(comment) - -def create(request): - return redirect('/blogs') - -def show(request, blog_id): - comment = "placeholder to display blog {}".format(blog_id) - return HttpResponse(comment) - -def edit(request, blog_id): - comment = "placeholder to edit blog {}".format(blog_id) - return HttpResponse(comment) - -def delete(request, blog_id): - comment = "placeholder to delete blog {}".format(blog_id) - return HttpResponse(comment) diff --git a/kevin_camp/django/multiple_apps/apps/surveys/__init__.py b/kevin_camp/django/multiple_apps/apps/surveys/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/multiple_apps/apps/surveys/admin.py b/kevin_camp/django/multiple_apps/apps/surveys/admin.py deleted file mode 100644 index 4255847..0000000 --- a/kevin_camp/django/multiple_apps/apps/surveys/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/kevin_camp/django/multiple_apps/apps/surveys/apps.py b/kevin_camp/django/multiple_apps/apps/surveys/apps.py deleted file mode 100644 index 2888b70..0000000 --- a/kevin_camp/django/multiple_apps/apps/surveys/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class SurveysConfig(AppConfig): - name = 'surveys' diff --git a/kevin_camp/django/multiple_apps/apps/surveys/migrations/__init__.py b/kevin_camp/django/multiple_apps/apps/surveys/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/multiple_apps/apps/surveys/models.py b/kevin_camp/django/multiple_apps/apps/surveys/models.py deleted file mode 100644 index c827610..0000000 --- a/kevin_camp/django/multiple_apps/apps/surveys/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/kevin_camp/django/multiple_apps/apps/surveys/tests.py b/kevin_camp/django/multiple_apps/apps/surveys/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/kevin_camp/django/multiple_apps/apps/surveys/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/kevin_camp/django/multiple_apps/apps/surveys/urls.py b/kevin_camp/django/multiple_apps/apps/surveys/urls.py deleted file mode 100644 index f1bf6c4..0000000 --- a/kevin_camp/django/multiple_apps/apps/surveys/urls.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.conf.urls import url -from . import views - -urlpatterns = [ - url(r'^$', views.index), - url(r'^new$', views.new), -] diff --git a/kevin_camp/django/multiple_apps/apps/surveys/views.py b/kevin_camp/django/multiple_apps/apps/surveys/views.py deleted file mode 100644 index 193d9a7..0000000 --- a/kevin_camp/django/multiple_apps/apps/surveys/views.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.shortcuts import render, HttpResponse, redirect - -def index(request): - comment = "placeholder to display all the surveys created" - return HttpResponse(comment) - -def new(request): - comment = "placeholder for users to add a new survey" - return HttpResponse(comment) diff --git a/kevin_camp/django/multiple_apps/apps/users/__init__.py b/kevin_camp/django/multiple_apps/apps/users/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/multiple_apps/apps/users/admin.py b/kevin_camp/django/multiple_apps/apps/users/admin.py deleted file mode 100644 index 4255847..0000000 --- a/kevin_camp/django/multiple_apps/apps/users/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/kevin_camp/django/multiple_apps/apps/users/apps.py b/kevin_camp/django/multiple_apps/apps/users/apps.py deleted file mode 100644 index 0f0c090..0000000 --- a/kevin_camp/django/multiple_apps/apps/users/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class UsersConfig(AppConfig): - name = 'users' diff --git a/kevin_camp/django/multiple_apps/apps/users/migrations/__init__.py b/kevin_camp/django/multiple_apps/apps/users/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/multiple_apps/apps/users/models.py b/kevin_camp/django/multiple_apps/apps/users/models.py deleted file mode 100644 index c827610..0000000 --- a/kevin_camp/django/multiple_apps/apps/users/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/kevin_camp/django/multiple_apps/apps/users/tests.py b/kevin_camp/django/multiple_apps/apps/users/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/kevin_camp/django/multiple_apps/apps/users/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/kevin_camp/django/multiple_apps/apps/users/urls.py b/kevin_camp/django/multiple_apps/apps/users/urls.py deleted file mode 100644 index 9b43d64..0000000 --- a/kevin_camp/django/multiple_apps/apps/users/urls.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.conf.urls import url -from . import views - -urlpatterns = [ - url(r'^$', views.index), - url(r'^new$', views.new), - url(r'^register$', views.register), - url(r'^login$', views.login), -] diff --git a/kevin_camp/django/multiple_apps/apps/users/views.py b/kevin_camp/django/multiple_apps/apps/users/views.py deleted file mode 100644 index bb3c70b..0000000 --- a/kevin_camp/django/multiple_apps/apps/users/views.py +++ /dev/null @@ -1,16 +0,0 @@ -from django.shortcuts import render, HttpResponse, redirect - -def index(request): - content = 'placeholder to later display all the list of users' - return HttpResponse(content) - -def register(request): - content = 'placeholder for users to create a new user record' - return HttpResponse(content) - -def login(request): - content = 'placeholder for users to login' - return HttpResponse(content) - -def new(request): - return redirect('/register') diff --git a/kevin_camp/django/multiple_apps/db.sqlite3 b/kevin_camp/django/multiple_apps/db.sqlite3 deleted file mode 100644 index 7cd6385..0000000 Binary files a/kevin_camp/django/multiple_apps/db.sqlite3 and /dev/null differ diff --git a/kevin_camp/django/multiple_apps/main/__init__.py b/kevin_camp/django/multiple_apps/main/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/multiple_apps/main/settings.py b/kevin_camp/django/multiple_apps/main/settings.py deleted file mode 100644 index 9e8c167..0000000 --- a/kevin_camp/django/multiple_apps/main/settings.py +++ /dev/null @@ -1,123 +0,0 @@ -""" -Django settings for main project. - -Generated by 'django-admin startproject' using Django 1.11.5. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '@g=reoyit11l5yfumw$qwrrlpwst*h^*+hbk1x9n-$d2gv9l5v' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'apps.blogs', - 'apps.surveys', - 'apps.users', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'main.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'main.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/kevin_camp/django/multiple_apps/main/urls.py b/kevin_camp/django/multiple_apps/main/urls.py deleted file mode 100644 index eebf55d..0000000 --- a/kevin_camp/django/multiple_apps/main/urls.py +++ /dev/null @@ -1,26 +0,0 @@ -"""main URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url, include - -urlpatterns = [ - url(r'^', include('apps.blogs.urls')), - url(r'^blogs/', include('apps.blogs.urls')), - url(r'^surveys/', include('apps.surveys.urls')), - url(r'^users/', include('apps.users.urls')), - url(r'^register/', include('apps.users.urls')), - url(r'^login/', include('apps.users.urls')), - -] diff --git a/kevin_camp/django/multiple_apps/main/wsgi.py b/kevin_camp/django/multiple_apps/main/wsgi.py deleted file mode 100644 index 064e759..0000000 --- a/kevin_camp/django/multiple_apps/main/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for main project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - -application = get_wsgi_application() diff --git a/kevin_camp/django/multiple_apps/manage.py b/kevin_camp/django/multiple_apps/manage.py deleted file mode 100644 index 1a1848d..0000000 --- a/kevin_camp/django/multiple_apps/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/kevin_camp/django/time_display/apps/__init__.py b/kevin_camp/django/time_display/apps/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/time_display/apps/time_display/__init__.py b/kevin_camp/django/time_display/apps/time_display/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/time_display/apps/time_display/admin.py b/kevin_camp/django/time_display/apps/time_display/admin.py deleted file mode 100644 index 4255847..0000000 --- a/kevin_camp/django/time_display/apps/time_display/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/kevin_camp/django/time_display/apps/time_display/apps.py b/kevin_camp/django/time_display/apps/time_display/apps.py deleted file mode 100644 index 80ef106..0000000 --- a/kevin_camp/django/time_display/apps/time_display/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class TimeDisplayConfig(AppConfig): - name = 'time_display' diff --git a/kevin_camp/django/time_display/apps/time_display/migrations/__init__.py b/kevin_camp/django/time_display/apps/time_display/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/time_display/apps/time_display/models.py b/kevin_camp/django/time_display/apps/time_display/models.py deleted file mode 100644 index c827610..0000000 --- a/kevin_camp/django/time_display/apps/time_display/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/kevin_camp/django/time_display/apps/time_display/static/css/style.css b/kevin_camp/django/time_display/apps/time_display/static/css/style.css deleted file mode 100644 index b6747b8..0000000 --- a/kevin_camp/django/time_display/apps/time_display/static/css/style.css +++ /dev/null @@ -1,8 +0,0 @@ -html{ - text-align: center; -} -tr{ - border: 2pt solid black; - border-radius: 10px; - display: inline-block; -} diff --git a/kevin_camp/django/time_display/apps/time_display/templates/time_display/index.html b/kevin_camp/django/time_display/apps/time_display/templates/time_display/index.html deleted file mode 100644 index ca03f2a..0000000 --- a/kevin_camp/django/time_display/apps/time_display/templates/time_display/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - {% load static %} - - - Time Display - - - - - - - - - - - - - -
Time Display
{{ time_date }}
- - diff --git a/kevin_camp/django/time_display/apps/time_display/tests.py b/kevin_camp/django/time_display/apps/time_display/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/kevin_camp/django/time_display/apps/time_display/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/kevin_camp/django/time_display/apps/time_display/urls.py b/kevin_camp/django/time_display/apps/time_display/urls.py deleted file mode 100644 index fb68ed6..0000000 --- a/kevin_camp/django/time_display/apps/time_display/urls.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.conf.urls import url -from . import views - -urlpatterns = [ - url(r'^$', views.index), -] diff --git a/kevin_camp/django/time_display/apps/time_display/views.py b/kevin_camp/django/time_display/apps/time_display/views.py deleted file mode 100644 index 523dcb0..0000000 --- a/kevin_camp/django/time_display/apps/time_display/views.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.shortcuts import render, redirect -from datetime import datetime -from time import gmtime, strftime - -def index(request): - context = { - "time_date": datetime.now().strftime("%I:%M %p %m-%d-%Y") - } - return render(request, 'time_display/index.html', context) diff --git a/kevin_camp/django/time_display/db.sqlite3 b/kevin_camp/django/time_display/db.sqlite3 deleted file mode 100644 index 2d306f1..0000000 Binary files a/kevin_camp/django/time_display/db.sqlite3 and /dev/null differ diff --git a/kevin_camp/django/time_display/main/__init__.py b/kevin_camp/django/time_display/main/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/kevin_camp/django/time_display/main/settings.py b/kevin_camp/django/time_display/main/settings.py deleted file mode 100644 index 7be337f..0000000 --- a/kevin_camp/django/time_display/main/settings.py +++ /dev/null @@ -1,121 +0,0 @@ -""" -Django settings for main project. - -Generated by 'django-admin startproject' using Django 1.11.5. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '@-*vrol@zs2!(krc3z#gktbk@bzkl(gz90tn5yy3mekvr94bm6' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'apps.time_display', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'main.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'main.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'America/Chicago' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/kevin_camp/django/time_display/main/wsgi.py b/kevin_camp/django/time_display/main/wsgi.py deleted file mode 100644 index 064e759..0000000 --- a/kevin_camp/django/time_display/main/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for main project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - -application = get_wsgi_application() diff --git a/kevin_camp/django/time_display/manage.py b/kevin_camp/django/time_display/manage.py deleted file mode 100644 index 1a1848d..0000000 --- a/kevin_camp/django/time_display/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/kevin_camp/erd/books.mwb b/kevin_camp/erd/books.mwb deleted file mode 100644 index be6c6df..0000000 Binary files a/kevin_camp/erd/books.mwb and /dev/null differ diff --git a/kevin_camp/flask/full_friends/friends.sql b/kevin_camp/flask/full_friends/friends.sql deleted file mode 100644 index 5e7d15b..0000000 --- a/kevin_camp/flask/full_friends/friends.sql +++ /dev/null @@ -1,54 +0,0 @@ --- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) --- --- Host: 127.0.0.1 Database: full_friends --- ------------------------------------------------------ --- Server version 5.7.19 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `friends` --- - -DROP TABLE IF EXISTS `friends`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `friends` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) DEFAULT NULL, - `age` int(11) DEFAULT NULL, - `started_at` datetime DEFAULT NULL, - `updated_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `friends` --- - -LOCK TABLES `friends` WRITE; -/*!40000 ALTER TABLE `friends` DISABLE KEYS */; -INSERT INTO `friends` VALUES (1,'Tom Selleck',74,'2017-09-14 14:14:10','2017-09-14 14:14:10'); -/*!40000 ALTER TABLE `friends` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2017-09-14 14:25:39 diff --git a/kevin_camp/flask/full_friends/mysqlconnection.py b/kevin_camp/flask/full_friends/mysqlconnection.py deleted file mode 100644 index d162bb7..0000000 --- a/kevin_camp/flask/full_friends/mysqlconnection.py +++ /dev/null @@ -1,40 +0,0 @@ -""" import the necessary modules """ -from flask_sqlalchemy import SQLAlchemy -from sqlalchemy.sql import text -# Create a class that will give us an object that we can use to connect to a database -class MySQLConnection(object): - def __init__(self, app, db): - config = { - 'host': 'localhost', - 'database': db, # we got db as an argument - 'user': 'root', - 'password': 'root', - 'port': '3306' # change the port to match the port your SQL server is running on - } - # this will use the above values to generate the path to connect to your sql database - DATABASE_URI = "mysql://{}:{}@127.0.0.1:{}/{}".format(config['user'], config['password'], config['port'], config['database']) - app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI - app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True - # establish the connection to database - self.db = SQLAlchemy(app) - # this is the method we will use to query the database - def query_db(self, query, data=None): - result = self.db.session.execute(text(query), data) - if query[0:6].lower() == 'select': - # if the query was a select - # convert the result to a list of dictionaries - list_result = [dict(r) for r in result] - # return the results as a list of dictionaries - return list_result - elif query[0:6].lower() == 'insert': - # if the query was an insert, return the id of the - # commit changes - self.db.session.commit() - # row that was inserted - return result.lastrowid - else: - # if the query was an update or delete, return nothing and commit changes - self.db.session.commit() -# This is the module method to be called by the user in server.py. Make sure to provide the db name! -def MySQLConnector(app, db): - return MySQLConnection(app, db) diff --git a/kevin_camp/flask/full_friends/server.py b/kevin_camp/flask/full_friends/server.py deleted file mode 100644 index 707f50a..0000000 --- a/kevin_camp/flask/full_friends/server.py +++ /dev/null @@ -1,22 +0,0 @@ -from flask import Flask, render_template, redirect, request, session, flash -from mysqlconnection import MySQLConnector -app = Flask(__name__) -mysql = MySQLConnector(app,'full_friends') - -@app.route('/') -def index(): - query = "SELECT * FROM friends" - friends = mysql.query_db(query) - return render_template('index.html', all_friends = friends) - -@app.route('/friends', methods=['POST']) -def create(): - query = "INSERT INTO friends (name, age, created_at, updated_at) VALUES (:name, :age, now(), now())" - data = { - 'name': request.form['name'], - 'age': request.form['age'], - } - mysql.query_db(query,data) - return redirect('/') - -app.run(debug=True) diff --git a/kevin_camp/flask/full_friends/static/style.css b/kevin_camp/flask/full_friends/static/style.css deleted file mode 100644 index fbac327..0000000 --- a/kevin_camp/flask/full_friends/static/style.css +++ /dev/null @@ -1,9 +0,0 @@ -.container{ - width:95%; - margin: auto; -} -table, th, tr, td{ - margin: 5px; - padding: 5px; - border: 1pt solid black; -} diff --git a/kevin_camp/flask/full_friends/templates/index.html b/kevin_camp/flask/full_friends/templates/index.html deleted file mode 100644 index d40c7be..0000000 --- a/kevin_camp/flask/full_friends/templates/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - Friends - - -
-

Friends:

-
- - - - - - - - - {% for friend in all_friends %} - - - - - {% endfor %} -
NameAgeFriend Since
{{ friend['name'] }}{{ friend['age'] }}{{ friend['created_at'] }}
-
-

Add a Friend:

-
-
- - - - - - - - - -
- -
-
-
- - - diff --git a/kevin_camp/flask/hello_flask/hello.py b/kevin_camp/flask/hello_flask/hello.py deleted file mode 100644 index cc8667e..0000000 --- a/kevin_camp/flask/hello_flask/hello.py +++ /dev/null @@ -1,9 +0,0 @@ -from flask import Flask -app = Flask(__name__) - -@app.route('/') - -def hello_world(): - return "Hello World!" - -app.run(debug=True) diff --git a/kevin_camp/flask/portfolio/portfolio.py b/kevin_camp/flask/portfolio/portfolio.py deleted file mode 100644 index 8863c00..0000000 --- a/kevin_camp/flask/portfolio/portfolio.py +++ /dev/null @@ -1,18 +0,0 @@ -from flask import Flask, render_template, redirect - -app = Flask(__name__) - -@app.route('/') -def portfolio(): - return render_template('index.html') - -@app.route('/projects') -def projects(): - projects = ['Columbia', 'Hertz', 'Prana', 'Office Depot'] - return render_template('projects.html', projects=projects) - -@app.route('/about') -def about(): - return render_template('about.html') - -app.run(debug=True) diff --git a/kevin_camp/flask/portfolio/templates/about.html b/kevin_camp/flask/portfolio/templates/about.html deleted file mode 100644 index 3e4ff1f..0000000 --- a/kevin_camp/flask/portfolio/templates/about.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - About Me - - -

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

- - diff --git a/kevin_camp/flask/portfolio/templates/index.html b/kevin_camp/flask/portfolio/templates/index.html deleted file mode 100644 index 84e7332..0000000 --- a/kevin_camp/flask/portfolio/templates/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - My Portfolio - - -

Welcome to my portfolio! My name is Kevin Camp!

- - diff --git a/kevin_camp/flask/portfolio/templates/projects.html b/kevin_camp/flask/portfolio/templates/projects.html deleted file mode 100644 index d08ad74..0000000 --- a/kevin_camp/flask/portfolio/templates/projects.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - A Web Page - - -

My Projects

-
    - {% for project in projects %} -
  • {{ project }}
  • - {% endfor %} -
- - diff --git a/kevin_camp/hewy.txt b/kevin_camp/hewy.txt deleted file mode 100644 index 5130a42..0000000 --- a/kevin_camp/hewy.txt +++ /dev/null @@ -1 +0,0 @@ -dewy & louie diff --git a/kevin_camp/python_fun/MySQL_WB_Setup.txt b/kevin_camp/python_fun/MySQL_WB_Setup.txt deleted file mode 100644 index 4460d29..0000000 --- a/kevin_camp/python_fun/MySQL_WB_Setup.txt +++ /dev/null @@ -1,5 +0,0 @@ -SELECT tweets.tweet -FROM users -LEFT JOIN tweets -ON users.id = tweets.user_id -WHERE users.id = 1; diff --git a/kevin_camp/python_fun/dojo_math.py b/kevin_camp/python_fun/dojo_math.py deleted file mode 100644 index 209f1c8..0000000 --- a/kevin_camp/python_fun/dojo_math.py +++ /dev/null @@ -1,28 +0,0 @@ -class MathDojo(object): - - def __init__(self): - self.result = 0 - - def add(self, *args): - for i in args: - if type(i) == list or type(i) == tuple: - for k in i: - self.result += k - else: - self.result += i - return self - - def subtract(self, *args): - for i in args: - if type(i) == list or type(i) == tuple: - for k in i: - self.result -= k - else: - self.result -= i - return self - -part1 = MathDojo() -print part1.add(2).add(2,5).subtract(3,2).result - -part2 = MathDojo() -print part2.add([1], 3,4).add([3,5,7,8], [2,4.3,1.25]).subtract(2, [2,3], [1.1,2.3]).result diff --git a/kevin_camp/python_fun/myrtle.py b/kevin_camp/python_fun/myrtle.py deleted file mode 100644 index b146233..0000000 --- a/kevin_camp/python_fun/myrtle.py +++ /dev/null @@ -1,12 +0,0 @@ -import turtle -import Tkinter - -for i in (0, 1000000000): - turtle.forward(10) - turtle.right(90) - for i in (0, 1000000000): - turtle.forward(10) - turtle.right(45) - - -Tkinter.mainloop() diff --git a/kevin_camp/python_fun/store.py b/kevin_camp/python_fun/store.py deleted file mode 100644 index 2b84a44..0000000 --- a/kevin_camp/python_fun/store.py +++ /dev/null @@ -1,35 +0,0 @@ -class Store(object): - def __init__(self, location, owner): - self.product = [] - self.location = location - self.owner = owner - - def add_product(self, item): - self.product.append(item) - - def remove_product(self, item): - self.product.remove(item) - - def inventory(self): - print self.product - - print 'created' - -store1 = Store('Dallas', 'Campy') - -store1.add_product('apples') -store1.add_product('pies') -store1.add_product('tylex') -store1.add_product('chili') -store1.add_product('cocaine') -store1.add_product('goldfish') - -# store1.remove_product('Donuts') -store1.inventory() - -store1.remove_product('cocaine') - -store1.inventory() - - -# print store1.product diff --git a/multi/apps/__init__.pyc b/multi/apps/__init__.pyc deleted file mode 100644 index 928669b..0000000 Binary files a/multi/apps/__init__.pyc and /dev/null differ diff --git a/multi/apps/blogs_app/__init__.pyc b/multi/apps/blogs_app/__init__.pyc deleted file mode 100644 index 1f06eae..0000000 Binary files a/multi/apps/blogs_app/__init__.pyc and /dev/null differ diff --git a/multi/apps/blogs_app/admin.py b/multi/apps/blogs_app/admin.py deleted file mode 100644 index 4255847..0000000 --- a/multi/apps/blogs_app/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/multi/apps/blogs_app/admin.pyc b/multi/apps/blogs_app/admin.pyc deleted file mode 100644 index 7cc75c4..0000000 Binary files a/multi/apps/blogs_app/admin.pyc and /dev/null differ diff --git a/multi/apps/blogs_app/apps.py b/multi/apps/blogs_app/apps.py deleted file mode 100644 index 6b464d7..0000000 --- a/multi/apps/blogs_app/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class MultiConfig(AppConfig): - name = 'multi' diff --git a/multi/apps/blogs_app/migrations/__init__.pyc b/multi/apps/blogs_app/migrations/__init__.pyc deleted file mode 100644 index e44ea36..0000000 Binary files a/multi/apps/blogs_app/migrations/__init__.pyc and /dev/null differ diff --git a/multi/apps/blogs_app/models.py b/multi/apps/blogs_app/models.py deleted file mode 100644 index c827610..0000000 --- a/multi/apps/blogs_app/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/multi/apps/blogs_app/models.pyc b/multi/apps/blogs_app/models.pyc deleted file mode 100644 index 44095fa..0000000 Binary files a/multi/apps/blogs_app/models.pyc and /dev/null differ diff --git a/multi/apps/blogs_app/static/blogs/css/main.css b/multi/apps/blogs_app/static/blogs/css/main.css deleted file mode 100644 index 69a2e27..0000000 --- a/multi/apps/blogs_app/static/blogs/css/main.css +++ /dev/null @@ -1,15 +0,0 @@ -body { - background-color: rgb(179, 239, 196); - text-align: center; -} - -h2, .datetime { - border-color: black; - border-style: dotted; - border-width: 2px; - width: 400px; -} - -.datetime { - font-size: 24px; -} diff --git a/multi/apps/blogs_app/templates/blogs/destroy.html b/multi/apps/blogs_app/templates/blogs/destroy.html deleted file mode 100644 index bf8536d..0000000 --- a/multi/apps/blogs_app/templates/blogs/destroy.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/multi/apps/blogs_app/templates/blogs/display.html b/multi/apps/blogs_app/templates/blogs/display.html deleted file mode 100644 index 0c9c19c..0000000 --- a/multi/apps/blogs_app/templates/blogs/display.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/multi/apps/blogs_app/templates/blogs/edit.html b/multi/apps/blogs_app/templates/blogs/edit.html deleted file mode 100644 index 0c9c19c..0000000 --- a/multi/apps/blogs_app/templates/blogs/edit.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/multi/apps/blogs_app/templates/blogs/index.html b/multi/apps/blogs_app/templates/blogs/index.html deleted file mode 100644 index 48d78bc..0000000 --- a/multi/apps/blogs_app/templates/blogs/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Blogs - {% load static %} - - - - -

This is where blogs will go.

- -
-

The current date and time:

-

{{ date }}

-

{{ time }}

-
- - - - diff --git a/multi/apps/blogs_app/templates/blogs/new.html b/multi/apps/blogs_app/templates/blogs/new.html deleted file mode 100644 index 0c9c19c..0000000 --- a/multi/apps/blogs_app/templates/blogs/new.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/multi/apps/blogs_app/tests.py b/multi/apps/blogs_app/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/multi/apps/blogs_app/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/multi/apps/blogs_app/urls.py b/multi/apps/blogs_app/urls.py deleted file mode 100644 index 8edfed8..0000000 --- a/multi/apps/blogs_app/urls.py +++ /dev/null @@ -1,10 +0,0 @@ -from django.conf.urls import url -from . import views -urlpatterns = [ - url(r'^$', views.index), - url(r'^new$', views.new), - url(r'^create$', views.create), - url(r'^(?P\d+)$', views.display), - url(r'^(?P\d+)/edit$', views.edit), - url(r'^(?P\d+)/delete$', views.destroy) -] diff --git a/multi/apps/blogs_app/urls.pyc b/multi/apps/blogs_app/urls.pyc deleted file mode 100644 index 162913d..0000000 Binary files a/multi/apps/blogs_app/urls.pyc and /dev/null differ diff --git a/multi/apps/blogs_app/views.py b/multi/apps/blogs_app/views.py deleted file mode 100644 index b52bab7..0000000 --- a/multi/apps/blogs_app/views.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals -from django.shortcuts import render, redirect -from django.http import HttpResponse -from django.contrib import messages -from time import gmtime, strftime -from django.utils.crypto import get_random_string -from models import * - -def index(request): - date = strftime("%Y-%m-%d", gmtime()) - time = strftime("%H:%M:%S", gmtime()) - print get_random_string(length=14) - context = { - "date": date, - "time": time - } - return render(request, "blogs/index.html", context) - # to add later as third argument: {"blogs: Blog.objects.all()"} - -def new(request): - return render(request, "blogs/new.html") - -def create(request): - return redirect("/new") - -def display(request, number): - return HttpResponse("placeholder to display blog {}" .format(number)) - # return render(request, "blogs/display.html", {"blog": Blog.objects.get(number=number)}) - -def edit(request, number): - return HttpResponse("placeholder to edit blog {}" .format(number)) - # return render(request, "blogs/edit.html", {"blog": Blog.objects.get(number=number)}) - -def destroy(request, number): - return redirect ('/') - # return render(request, "blogs/destroy.html", {"blog": Blog.objects.get(number=number)}) diff --git a/multi/apps/blogs_app/views.pyc b/multi/apps/blogs_app/views.pyc deleted file mode 100644 index d4c2c8a..0000000 Binary files a/multi/apps/blogs_app/views.pyc and /dev/null differ diff --git a/multi/apps/surveys_app/__init__.pyc b/multi/apps/surveys_app/__init__.pyc deleted file mode 100644 index fbeee76..0000000 Binary files a/multi/apps/surveys_app/__init__.pyc and /dev/null differ diff --git a/multi/apps/surveys_app/admin.py b/multi/apps/surveys_app/admin.py deleted file mode 100644 index 4255847..0000000 --- a/multi/apps/surveys_app/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/multi/apps/surveys_app/admin.pyc b/multi/apps/surveys_app/admin.pyc deleted file mode 100644 index f41c5c8..0000000 Binary files a/multi/apps/surveys_app/admin.pyc and /dev/null differ diff --git a/multi/apps/surveys_app/apps.py b/multi/apps/surveys_app/apps.py deleted file mode 100644 index 11a79ab..0000000 --- a/multi/apps/surveys_app/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class SurveysAppConfig(AppConfig): - name = 'surveys_app' diff --git a/multi/apps/surveys_app/migrations/__init__.pyc b/multi/apps/surveys_app/migrations/__init__.pyc deleted file mode 100644 index 8c55aaf..0000000 Binary files a/multi/apps/surveys_app/migrations/__init__.pyc and /dev/null differ diff --git a/multi/apps/surveys_app/models.py b/multi/apps/surveys_app/models.py deleted file mode 100644 index c827610..0000000 --- a/multi/apps/surveys_app/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/multi/apps/surveys_app/models.pyc b/multi/apps/surveys_app/models.pyc deleted file mode 100644 index 0a62726..0000000 Binary files a/multi/apps/surveys_app/models.pyc and /dev/null differ diff --git a/multi/apps/surveys_app/templates/surveys/index.html b/multi/apps/surveys_app/templates/surveys/index.html deleted file mode 100644 index 0cdd361..0000000 --- a/multi/apps/surveys_app/templates/surveys/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Surveys - {% load static %} - - - -

This is where surveys will go.

- - diff --git a/multi/apps/surveys_app/templates/surveys/new.html b/multi/apps/surveys_app/templates/surveys/new.html deleted file mode 100644 index a1b31a9..0000000 --- a/multi/apps/surveys_app/templates/surveys/new.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/multi/apps/surveys_app/tests.py b/multi/apps/surveys_app/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/multi/apps/surveys_app/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/multi/apps/surveys_app/urls.py b/multi/apps/surveys_app/urls.py deleted file mode 100644 index e3ea740..0000000 --- a/multi/apps/surveys_app/urls.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.conf.urls import url -from . import views -urlpatterns = [ - url(r'^$', views.index), - url(r'^new$', views.new), -] diff --git a/multi/apps/surveys_app/urls.pyc b/multi/apps/surveys_app/urls.pyc deleted file mode 100644 index d0ff9d8..0000000 Binary files a/multi/apps/surveys_app/urls.pyc and /dev/null differ diff --git a/multi/apps/surveys_app/views.py b/multi/apps/surveys_app/views.py deleted file mode 100644 index 1f97f85..0000000 --- a/multi/apps/surveys_app/views.py +++ /dev/null @@ -1,11 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.shortcuts import render, redirect -from django.http import HttpResponse - -def index(request): - return HttpResponse("placeholder for later to display all surveys created") - -def new(request): - return HttpResponse("placeholder for users to add a new survey")# Create your views here. diff --git a/multi/apps/surveys_app/views.pyc b/multi/apps/surveys_app/views.pyc deleted file mode 100644 index 37de849..0000000 Binary files a/multi/apps/surveys_app/views.pyc and /dev/null differ diff --git a/multi/apps/users_app/__init__.pyc b/multi/apps/users_app/__init__.pyc deleted file mode 100644 index bbd4493..0000000 Binary files a/multi/apps/users_app/__init__.pyc and /dev/null differ diff --git a/multi/apps/users_app/admin.py b/multi/apps/users_app/admin.py deleted file mode 100644 index 4255847..0000000 --- a/multi/apps/users_app/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.contrib import admin - -# Register your models here. diff --git a/multi/apps/users_app/admin.pyc b/multi/apps/users_app/admin.pyc deleted file mode 100644 index 23282c5..0000000 Binary files a/multi/apps/users_app/admin.pyc and /dev/null differ diff --git a/multi/apps/users_app/apps.py b/multi/apps/users_app/apps.py deleted file mode 100644 index cf63370..0000000 --- a/multi/apps/users_app/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class UsersAppConfig(AppConfig): - name = 'users_app' diff --git a/multi/apps/users_app/migrations/__init__.pyc b/multi/apps/users_app/migrations/__init__.pyc deleted file mode 100644 index b1b2a47..0000000 Binary files a/multi/apps/users_app/migrations/__init__.pyc and /dev/null differ diff --git a/multi/apps/users_app/models.py b/multi/apps/users_app/models.py deleted file mode 100644 index c827610..0000000 --- a/multi/apps/users_app/models.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. diff --git a/multi/apps/users_app/models.pyc b/multi/apps/users_app/models.pyc deleted file mode 100644 index ad180b3..0000000 Binary files a/multi/apps/users_app/models.pyc and /dev/null differ diff --git a/multi/apps/users_app/templates/users/index.html b/multi/apps/users_app/templates/users/index.html deleted file mode 100644 index d86d058..0000000 --- a/multi/apps/users_app/templates/users/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Users - {% load static %} - - - - This is where users will go. - - diff --git a/multi/apps/users_app/templates/users/login.html b/multi/apps/users_app/templates/users/login.html deleted file mode 100644 index 8d44f59..0000000 --- a/multi/apps/users_app/templates/users/login.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/multi/apps/users_app/templates/users/register.html b/multi/apps/users_app/templates/users/register.html deleted file mode 100644 index 8d44f59..0000000 --- a/multi/apps/users_app/templates/users/register.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - {% load static %} - - - - - - diff --git a/multi/apps/users_app/tests.py b/multi/apps/users_app/tests.py deleted file mode 100644 index 52f77f9..0000000 --- a/multi/apps/users_app/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.test import TestCase - -# Create your tests here. diff --git a/multi/apps/users_app/urls.py b/multi/apps/users_app/urls.py deleted file mode 100644 index 506f942..0000000 --- a/multi/apps/users_app/urls.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.conf.urls import url -from . import views -urlpatterns = [ - url(r'^$', views.index), - url(r'^new', views.register), - url(r'^register$', views.register), - url(r'^login$', views.login), -] diff --git a/multi/apps/users_app/urls.pyc b/multi/apps/users_app/urls.pyc deleted file mode 100644 index 9be2475..0000000 Binary files a/multi/apps/users_app/urls.pyc and /dev/null differ diff --git a/multi/apps/users_app/views.py b/multi/apps/users_app/views.py deleted file mode 100644 index aa64a79..0000000 --- a/multi/apps/users_app/views.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.shortcuts import render, redirect -from django.http import HttpResponse - -def index(request): - return HttpResponse("placeholder to display all the list of users") - -def register(request): - return HttpResponse("placeholder for users to create a new user record") - -def login(request): - return HttpResponse("placeholder for users to login") diff --git a/multi/apps/users_app/views.pyc b/multi/apps/users_app/views.pyc deleted file mode 100644 index b29f92b..0000000 Binary files a/multi/apps/users_app/views.pyc and /dev/null differ diff --git a/multi/db.sqlite3 b/multi/db.sqlite3 deleted file mode 100644 index da0ecc6..0000000 Binary files a/multi/db.sqlite3 and /dev/null differ diff --git a/multi/main/__init__.pyc b/multi/main/__init__.pyc deleted file mode 100644 index e741297..0000000 Binary files a/multi/main/__init__.pyc and /dev/null differ diff --git a/multi/main/settings.py b/multi/main/settings.py deleted file mode 100644 index 9a2c162..0000000 --- a/multi/main/settings.py +++ /dev/null @@ -1,123 +0,0 @@ -""" -Django settings for main project. - -Generated by 'django-admin startproject' using Django 1.11.5. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'zjve51c)864m$x4-fy3uw&o8px57w*+klpet79ww5_je@2%ip2' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'apps.blogs_app', - 'apps.surveys_app', - 'apps.users_app', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'main.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'main.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.11/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/1.11/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.11/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/multi/main/settings.pyc b/multi/main/settings.pyc deleted file mode 100644 index 180c546..0000000 Binary files a/multi/main/settings.pyc and /dev/null differ diff --git a/multi/main/urls.py b/multi/main/urls.py deleted file mode 100644 index 7c85c0e..0000000 --- a/multi/main/urls.py +++ /dev/null @@ -1,24 +0,0 @@ -"""main URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" -from django.conf.urls import url, include -from django.contrib import admin - -urlpatterns = [ - url(r'^', include('apps.blogs_app.urls')), - url(r'^blogs/', include('apps.blogs_app.urls')), - url(r'^surveys/', include('apps.surveys_app.urls')), - url(r'^users/', include('apps.users_app.urls')), -] diff --git a/multi/main/urls.pyc b/multi/main/urls.pyc deleted file mode 100644 index 608343a..0000000 Binary files a/multi/main/urls.pyc and /dev/null differ diff --git a/multi/main/wsgi.py b/multi/main/wsgi.py deleted file mode 100644 index 064e759..0000000 --- a/multi/main/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for main project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - -application = get_wsgi_application() diff --git a/multi/main/wsgi.pyc b/multi/main/wsgi.pyc deleted file mode 100644 index bc6d3d0..0000000 Binary files a/multi/main/wsgi.pyc and /dev/null differ diff --git a/multi/manage.py b/multi/manage.py deleted file mode 100644 index 1a1848d..0000000 --- a/multi/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") - try: - from django.core.management import execute_from_command_line - except ImportError: - # The above import may fail for some other reason. Ensure that the - # issue is really that Django is missing to avoid masking other - # exceptions on Python 2. - try: - import django - except ImportError: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) - raise - execute_from_command_line(sys.argv) diff --git a/multi/multi.zip b/multi/multi.zip deleted file mode 100644 index bc3d1ef..0000000 Binary files a/multi/multi.zip and /dev/null differ