Skip to content

Commit

Permalink
Merge pull request #334 from PdxCodeGuild/michael-django-lab01
Browse files Browse the repository at this point in the history
Michael django lab01 completed
  • Loading branch information
perennialAutodidact authored Mar 7, 2022
2 parents f484971 + 59c0a9b commit ff78bdd
Show file tree
Hide file tree
Showing 48 changed files with 1,457 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Code/Michael/Python/5-palindrome_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ def check_palindrome(list_of_strings)->list:
case unknown_command:
print (f"\nUnknown command '{unknown_command}' Please enter Palindrome or Anagram or Quit.")
valid_command = False


print("\nGoodbye. Thank you for using this program.")
26 changes: 26 additions & 0 deletions Code/Michael/Python/email_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from smtplib import SMTP
from email.message import EmailMessage


def email_alert(to, subject="Alert", body="Alert!"):
msg = EmailMessage()
msg.set_content(body)
msg["Subject"] = subject
msg["To"] = to

user = "[email protected]"
msg["From"] = user
password = "nixqgstknzqcfqig"
port = int(587)

with SMTP("smtp.gmail.com", port) as server:
server.starttls()
server.login(user, password)

server.send_message(msg)


if __name__ == "__main__":

print("test")
email_alert("[email protected]", "hey", "hello world")
152 changes: 152 additions & 0 deletions Code/Michael/django/lab01/lab01project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
8 changes: 8 additions & 0 deletions Code/Michael/django/lab01/lab01project/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Personal Assistant

## Install

- pip3 install -r requirements.txt
- python3 manage.py migrate
- Optional: python3 manage.py createsuperuser
- python3 manage.py runserver
Empty file.
7 changes: 7 additions & 0 deletions Code/Michael/django/lab01/lab01project/assistant/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.contrib import admin

# Register your models here.
from .models import *

admin.site.register(Priority)
admin.site.register(TodoItem)
6 changes: 6 additions & 0 deletions Code/Michael/django/lab01/lab01project/assistant/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class AssistantConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "assistant"
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Generated by Django 3.2.10 on 2022-03-06 17:32

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = []

operations = [
migrations.CreateModel(
name="Priority",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"name",
models.CharField(
choices=[
("High", "High"),
("Medium", "Medium"),
("Low", "Low"),
],
default="Medium",
max_length=6,
),
),
],
options={
"ordering": ["-name"],
},
),
migrations.CreateModel(
name="TodoItem",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=250)),
("description", models.TextField()),
("completed", models.DateTimeField(blank=True, null=True)),
],
options={
"ordering": ["-priority"],
},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 3.2.10 on 2022-03-06 17:32

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
("assistant", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.AddField(
model_name="todoitem",
name="owner",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
),
),
migrations.AddField(
model_name="todoitem",
name="priority",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="assistant.priority"
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.2.10 on 2022-03-06 17:47

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("assistant", "0002_initial"),
]

operations = [
migrations.AlterField(
model_name="priority",
name="name",
field=models.CharField(
choices=[(1, "High"), (2, "Medium"), (3, "Low")],
default=2,
max_length=6,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.2.10 on 2022-03-06 17:48

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("assistant", "0003_alter_priority_name"),
]

operations = [
migrations.AlterField(
model_name="priority",
name="name",
field=models.CharField(
choices=[("High", 1), ("Medium", 2), ("Low", 3)],
default="Medium",
max_length=6,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.2.10 on 2022-03-06 17:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("assistant", "0004_alter_priority_name"),
]

operations = [
migrations.AlterField(
model_name="priority",
name="name",
field=models.CharField(
choices=[(1, "High"), ("Medium", 2), ("Low", 3)],
default="Medium",
max_length=6,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.10 on 2022-03-06 17:51

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("assistant", "0005_alter_priority_name"),
]

operations = [
migrations.AlterField(
model_name="priority",
name="name",
field=models.CharField(
choices=[(1, 1), (2, 2), (3, 3)], default="Medium", max_length=6
),
),
]
Loading

0 comments on commit ff78bdd

Please sign in to comment.