Skip to content

Commit

Permalink
blacken hello
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyFaist committed Oct 18, 2018
1 parent f70b997 commit 26a9055
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
6 changes: 4 additions & 2 deletions gettingstarted/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.gis",
"hello",
]

Expand Down Expand Up @@ -80,7 +79,10 @@
import dj_database_url

DATABASES = {
"default": dj_database_url.config(engine="django.contrib.gis.db.backends.postgis")
"default": {
"ENGINE" : "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3")
}
}

# Password validation
Expand Down
10 changes: 2 additions & 8 deletions hello/models.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
from django.contrib.gis.db import models
from django.db import models

# Create your models here.
class Greeting(models.Model):
when = models.DateTimeField('date created', auto_now_add=True)


class TestGeo(models.Model):
geometry = models.GeometryField()
point = models.PointField()
mpoly = models.MultiPolygonField()
when = models.DateTimeField("date created", auto_now_add=True)
5 changes: 3 additions & 2 deletions hello/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@

from .views import index


class SimpleTest(TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.factory = RequestFactory()

def test_details(self):
# Create an instance of a GET request.
request = self.factory.get('/')
request = self.factory.get("/")
request.user = AnonymousUser()

# Test my_view() as if it were deployed at /customer/details
response = index(request)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.status_code, 200)
7 changes: 3 additions & 4 deletions hello/views.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from django.shortcuts import render
from django.http import HttpResponse

from .models import Greeting, TestGeo
from .models import Greeting

# Create your views here.
def index(request):
# return HttpResponse('Hello from Python!')
return render(request, 'index.html')
return render(request, "index.html")


def db(request):
Expand All @@ -16,5 +16,4 @@ def db(request):

greetings = Greeting.objects.all()

return render(request, 'db.html', {'greetings': greetings})

return render(request, "db.html", {"greetings": greetings})

0 comments on commit 26a9055

Please sign in to comment.