diff --git a/gettingstarted/settings.py b/gettingstarted/settings.py index 9ea552a0c..91fdd5c16 100644 --- a/gettingstarted/settings.py +++ b/gettingstarted/settings.py @@ -40,6 +40,7 @@ "django.contrib.messages", "django.contrib.staticfiles", "hello", + "terminology", ] MIDDLEWARE = [ diff --git a/gettingstarted/urls.py b/gettingstarted/urls.py index 13b759582..ddd56d859 100644 --- a/gettingstarted/urls.py +++ b/gettingstarted/urls.py @@ -5,6 +5,7 @@ admin.autodiscover() import hello.views +import terminology.urls # To add a new path, first import the app: # import blog @@ -15,7 +16,7 @@ # Learn more here: https://docs.djangoproject.com/en/2.1/topics/http/urls/ urlpatterns = [ - path("", hello.views.index, name="index"), - path("db/", hello.views.db, name="db"), + # path("", hello.views.index, name="index"), + path("terms/", include(terminology.urls)), path("admin/", admin.site.urls), ] diff --git a/hello/static/IMG_0532.jpeg b/hello/static/IMG_0532.jpeg new file mode 100644 index 000000000..0cfc216b8 Binary files /dev/null and b/hello/static/IMG_0532.jpeg differ diff --git a/hello/templates/base.html b/hello/templates/base.html index 97ec07386..4e0a2b07a 100644 --- a/hello/templates/base.html +++ b/hello/templates/base.html @@ -1,80 +1,86 @@ +{% load staticfiles %} -Python Getting Started on Heroku - - - - + .jumbotron .btn-primary:hover { + background: #7646c1 + } + + .jumbotron p { + color: #d9ccee; + max-width: 75%; + margin: 1em auto 2em + } + + .navbar + .jumbotron { + margin-top: -20px + } + + .jumbotron .lang-logo { + display: block; + background: #b01302; + border-radius: 50%; + overflow: hidden; + width: 100px; + height: 100px; + margin: auto; + border: 2px solid white + } + + .jumbotron .lang-logo img { + max-width: 100% + } + + + + {% block content %}{% endblock %} diff --git a/hello/templates/index.html b/hello/templates/index.html index 8af29028b..2b30379d7 100644 --- a/hello/templates/index.html +++ b/hello/templates/index.html @@ -6,7 +6,7 @@

Getting Started with Python on Heroku

This is a sample Python application deployed to Heroku. It's a reasonably simple app - but a good foundation for understanding how to get the most out of the Heroku platform.

diff --git a/terminology/__init__.py b/terminology/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/terminology/admin.py b/terminology/admin.py new file mode 100644 index 000000000..b8cfa3d56 --- /dev/null +++ b/terminology/admin.py @@ -0,0 +1,4 @@ +from django.contrib import admin +from .models import Term + +admin.site.register(Term) diff --git a/terminology/apps.py b/terminology/apps.py new file mode 100644 index 000000000..9fd350759 --- /dev/null +++ b/terminology/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class TerminologyConfig(AppConfig): + name = 'terminology' diff --git a/terminology/migrations/__init__.py b/terminology/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/terminology/models.py b/terminology/models.py new file mode 100644 index 000000000..cf65e11f0 --- /dev/null +++ b/terminology/models.py @@ -0,0 +1,11 @@ +from django.db import models + + +class Term(models.Model): + title = models.CharField(max_length=50) + definition = models.CharField(max_length=50) + example = models.TextField() + url = models.URLField(max_length=250) + + def __str__(self): + return self.title diff --git a/terminology/static/customstyle.css b/terminology/static/customstyle.css new file mode 100644 index 000000000..7f610bad1 --- /dev/null +++ b/terminology/static/customstyle.css @@ -0,0 +1,8 @@ +.my-row { + border: 1px solid orange; +} + +.my-col { + border: 1px solid orange; + /*width:fit-content;*/ +} \ No newline at end of file diff --git a/terminology/templates/termlist.html b/terminology/templates/termlist.html new file mode 100644 index 000000000..70daf37b3 --- /dev/null +++ b/terminology/templates/termlist.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block content %} +
+ + + + + + + + + {% for object in object_list %} + + + + + + + {% endfor %} + +
Titledefinitionexampleurl
{{ object.title }}{{ object.definition }}{{ object.example }} {{ object.url }} +
+
+{% endblock %} \ No newline at end of file diff --git a/terminology/tests.py b/terminology/tests.py new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ b/terminology/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/terminology/urls.py b/terminology/urls.py new file mode 100644 index 000000000..67ca82cd0 --- /dev/null +++ b/terminology/urls.py @@ -0,0 +1,19 @@ +from django.urls import path, include + +from django.contrib import admin +import terminology.views + +admin.autodiscover() + +# To add a new path, first import the app: +# import blog +# +# Then add the new path: +# path('blog/', blog.urls, name="blog") +# +# Learn more here: https://docs.djangoproject.com/en/2.1/topics/http/urls/ + +urlpatterns = [ + path("", terminology.views.TermListView.as_view(), name="termsListView"), + +] diff --git a/terminology/views.py b/terminology/views.py new file mode 100644 index 000000000..a12dfc52f --- /dev/null +++ b/terminology/views.py @@ -0,0 +1,10 @@ +from django.shortcuts import render +from django.views.generic import ListView + +from .models import Term + + +class TermListView(ListView): + model = Term + template_name = "termlist.html" +