Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
84a42a9
add josh django lab 01 progress to code
josh-on-github Dec 21, 2022
d2feb88
added superuser and registered model
josh-on-github Dec 21, 2022
86f1fc5
completed registering model
josh-on-github Dec 21, 2022
0acf835
add josh django lab 01 progress to code
josh-on-github Dec 22, 2022
fb73bc8
add josh django lab 1 progress to code
josh-on-github Dec 22, 2022
0f79694
add josh django lab 1 progress to code
josh-on-github Dec 22, 2022
bc27353
add josh django lab 1 progress to code
josh-on-github Dec 23, 2022
ba3abc7
started conditional for complete/incomplete button in html
josh-on-github Dec 26, 2022
1519346
finished conditional for complete/incomplete button in html
josh-on-github Dec 27, 2022
8dc5a66
added delete item capability
josh-on-github Dec 27, 2022
529effd
created lab 2 project and url shortener app
josh-on-github Dec 27, 2022
f1c3d9e
made migrations
josh-on-github Dec 27, 2022
84621c9
created views in progress
josh-on-github Dec 27, 2022
6e1bb1c
started html and finished index view
josh-on-github Dec 27, 2022
e08e451
completed url shortener redirect
josh-on-github Dec 28, 2022
ba52953
add josh django lab 02 final to code
josh-on-github Dec 28, 2022
b6e6e58
created project and apps for josh django lab 03
josh-on-github Dec 28, 2022
62e4247
registered models
josh-on-github Dec 28, 2022
0b22947
renamed file from post.url to post.urls
josh-on-github Dec 28, 2022
3f33757
created login/logout/signup functionality to project
josh-on-github Dec 28, 2022
d020cf9
removed users app templates directory
josh-on-github Dec 29, 2022
4f6ebfb
added project-level static folder and some styling
josh-on-github Dec 29, 2022
774746f
updated background image
josh-on-github Dec 29, 2022
a74382b
updated posts views
josh-on-github Dec 29, 2022
b85e7ee
added form tags to posts index page and updated posts views
josh-on-github Dec 29, 2022
71de193
reversed order of posts in index.html
josh-on-github Dec 29, 2022
520905c
added some nav links
josh-on-github Dec 29, 2022
8ebeed5
added styling to nav and container in CSS
josh-on-github Dec 29, 2022
1a7cf5f
added signup link to login page
josh-on-github Dec 30, 2022
f2b0f76
removed margin in article tag of index.html
josh-on-github Dec 30, 2022
71e80f9
updated Posts model with user and ForeignKey
josh-on-github Dec 30, 2022
752ffd7
add josh django lab 03 progress to code
josh-on-github Dec 30, 2022
542d17a
updated width of posts, borders, and post message format, including time
josh-on-github Dec 30, 2022
dcf9abf
add josh final django lab 03 to code
josh-on-github Dec 30, 2022
2dff49d
add josh lab 01a final to code
josh-on-github Jan 3, 2023
22bdac9
created josh_js_lab02 and began to convert python to js
josh-on-github Jan 4, 2023
90fe656
converted modulo, floor division, conditionals, and variable from pyt…
josh-on-github Jan 4, 2023
fc7d3ff
updated template literals with , add final to code
josh-on-github Jan 4, 2023
71c55e5
started josh js lab 03
josh-on-github Jan 4, 2023
0b348c3
updated variables, loops, and template literals with JS syntax
josh-on-github Jan 4, 2023
8dfba19
updated conditional with function to sum all entries
josh-on-github Jan 4, 2023
446e171
created new Vue lab
josh-on-github Jan 9, 2023
7762636
moved directories
josh-on-github Jan 9, 2023
afcf01f
started building Vue app and html
josh-on-github Jan 9, 2023
8323808
added function to addend array
josh-on-github Jan 9, 2023
831e6c5
working on clearing input field and delete functionality
josh-on-github Jan 9, 2023
836d627
added input field clearing after adding item
josh-on-github Jan 10, 2023
bd8eab1
added empty complete/delete methods
josh-on-github Jan 10, 2023
b659aff
added completed list item functionality
josh-on-github Jan 10, 2023
74e4411
associated completed item line-through with checkbox
josh-on-github Jan 11, 2023
59ba88f
added delete button image
josh-on-github Jan 11, 2023
5056239
added delete functionality
josh-on-github Jan 11, 2023
a2fdb72
adding some styling elements
josh-on-github Jan 11, 2023
d926456
added more CSS styling
josh-on-github Jan 11, 2023
5cb4e25
fixed delete to delete correct item from list instead of first item
josh-on-github Jan 11, 2023
09681dd
add josh_js_lab05 final to code
josh-on-github Jan 11, 2023
9dd2712
created new quotes app directories and files
josh-on-github Jan 11, 2023
85a8b33
added untracked files
josh-on-github Jan 11, 2023
13935ec
added input and button html tags
josh-on-github Jan 11, 2023
4387876
added body, header, and app styling
josh-on-github Jan 12, 2023
13fe177
working on axios requests
josh-on-github Jan 12, 2023
57ff3a3
working with parameters
josh-on-github Jan 12, 2023
1e2e556
added search capability by keyword
josh-on-github Jan 12, 2023
5d3c936
added search by selector type functionality
josh-on-github Jan 12, 2023
9592eec
removed some comments
josh-on-github Jan 12, 2023
01bb838
adding method for quote of the day
josh-on-github Jan 12, 2023
7228a80
mounted quote of the day
josh-on-github Jan 13, 2023
0e09f19
started a new vue component
josh-on-github Jan 18, 2023
26824b9
added methods to work on for vue component
josh-on-github Jan 18, 2023
cbb82ef
continuing to work on component methods
josh-on-github Jan 18, 2023
5ac9417
fixed return of savedQuotes for data function
josh-on-github Jan 18, 2023
2e86612
updated prop and v-bind in html
josh-on-github Jan 18, 2023
b73ec7b
updated variable names
josh-on-github Jan 18, 2023
5793076
working on button to show savedQuotes array
josh-on-github Jan 18, 2023
fd3fdb1
changed v-bind of property to be quote and author
josh-on-github Jan 18, 2023
0c0ab1a
still working on displaying saved quotes
josh-on-github Jan 19, 2023
7e2c800
removed comments
josh-on-github Jan 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
4 changes: 4 additions & 0 deletions code/josh/Django/josh_lab01/grocery_list/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.contrib import admin
from . models import GroceryItem

admin.site.register(GroceryItem)
6 changes: 6 additions & 0 deletions code/josh/Django/josh_lab01/grocery_list/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class GroceryListConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'grocery_list'
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.1.4 on 2022-12-21 18:40

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='GroceryItem',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text_description', models.CharField(max_length=200)),
('created_date', models.DateTimeField(verbose_name='created date')),
('completed_date', models.DateTimeField(verbose_name='completed date')),
('completed', models.BooleanField()),
],
),
]
Empty file.
11 changes: 11 additions & 0 deletions code/josh/Django/josh_lab01/grocery_list/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.db import models


class GroceryItem(models.Model):
text_description = models.CharField(max_length=50)
created_date = models.DateTimeField('created date', auto_now_add=True)
completed_date = models.DateTimeField('completed date')
completed = models.BooleanField()

def __str__(self):
return self.text_description
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grocery List</title>
</head>
<body style="background-color: lightgreen;">
<h1>Grocery List</h1>
<table>
<tr>
<th>Item</th>
<th>Completed</th>
<th>Delete</th>
</tr>
{% for item in grocery_list %}
<tr>
<td>{{ item.text_description }}</td>
{% if item.completed == False %}
<td><a href="{% url 'grocery_list:complete' id=item.id %}"><input type="button" value="incomplete"></input></a></td>
{% else %}
<td><a href="{% url 'grocery_list:complete' id=item.id %}"><input type="button" value="complete"></a></td>
{% endif %}
<td><a href="{% url 'grocery_list:delete' id=item.id %}">delete</a></td>
</tr>
{% endfor %}
</table>
<form action="{% url 'grocery_list:index' %}" method="post">
{% csrf_token %}
<label for="grocery_item">Add Item</label>
<input type="text" id="grocery_item" name="text_description"><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
3 changes: 3 additions & 0 deletions code/josh/Django/josh_lab01/grocery_list/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
10 changes: 10 additions & 0 deletions code/josh/Django/josh_lab01/grocery_list/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.urls import path

from . import views

app_name = 'grocery_list'
urlpatterns = [
path('', views.index, name='index'),
path('complete/<int:id>', views.complete, name='complete'),
path('delete/<int:id>', views.delete, name='delete'),
]
37 changes: 37 additions & 0 deletions code/josh/Django/josh_lab01/grocery_list/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.template import loader
from django.urls import reverse
from datetime import datetime
from . models import GroceryItem


def index(request):
if request.method == 'POST':
form_data = request.POST
grocery_object = GroceryItem.objects.create(
text_description=form_data['text_description'],
created_date=datetime.now(),
completed_date=datetime.now(),
completed=False
)
return HttpResponseRedirect(reverse('grocery_list:index'))

else:
grocery_list = GroceryItem.objects.all()
context = {'grocery_list': grocery_list}
return render(request, 'grocery_list/index.html', context)

def complete(request, id):
grocery_item = GroceryItem.objects.get(id=id)
if grocery_item.completed == False:
grocery_item.completed = True
else:
grocery_item.completed = False
grocery_item.save()
return HttpResponseRedirect(reverse('grocery_list:index'))

def delete(request, id):
grocery_item = GroceryItem.objects.get(id=id)
grocery_item.delete()
return HttpResponseRedirect(reverse('grocery_list:index'))
Empty file.
16 changes: 16 additions & 0 deletions code/josh/Django/josh_lab01/josh_lab01/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for josh_lab01 project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'josh_lab01.settings')

application = get_asgi_application()
124 changes: 124 additions & 0 deletions code/josh/Django/josh_lab01/josh_lab01/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
"""
Django settings for josh_lab01 project.

Generated by 'django-admin startproject' using Django 4.1.4.

For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure--pt9g52qef4rs3k(zf0=0^qy^fi3@ro&otxem9%09yssx0$&mp'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'grocery_list.apps.GroceryListConfig',
'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 = 'josh_lab01.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 = 'josh_lab01.wsgi.application'


# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}


# Password validation
# https://docs.djangoproject.com/en/4.1/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/4.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'America/Los_Angeles'

USE_I18N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/

STATIC_URL = 'static/'

# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
22 changes: 22 additions & 0 deletions code/josh/Django/josh_lab01/josh_lab01/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""josh_lab01 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import include, path

urlpatterns = [
path('grocery_list/', include('grocery_list.urls')),
path('admin/', admin.site.urls),
]
16 changes: 16 additions & 0 deletions code/josh/Django/josh_lab01/josh_lab01/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for josh_lab01 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/4.1/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'josh_lab01.settings')

application = get_wsgi_application()
22 changes: 22 additions & 0 deletions code/josh/Django/josh_lab01/manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'josh_lab01.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
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?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
Empty file.
16 changes: 16 additions & 0 deletions code/josh/Django/josh_lab02/josh_lab02/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for josh_lab02 project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'josh_lab02.settings')

application = get_asgi_application()
Loading