Skip to content

Commit

Permalink
Updated defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBrolly committed Oct 15, 2018
1 parent f56b904 commit a9dee3d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
16 changes: 8 additions & 8 deletions gettingstarted/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.gis',
'hello'
]

Expand Down Expand Up @@ -76,13 +77,12 @@
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

import dj_database_url
DATABASES = {'default': dj_database_url.config(
engine='django.contrib.gis.db.backends.postgis',
conn_max_age=500,
require_ssl=True
)}

# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
Expand Down Expand Up @@ -122,4 +122,4 @@

STATIC_URL = '/static/'

django_heroku.settings(locals())
django_heroku.settings(locals())
8 changes: 7 additions & 1 deletion hello/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
from django.db import models
from django.contrib.gis.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()
2 changes: 1 addition & 1 deletion hello/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.shortcuts import render
from django.http import HttpResponse

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

# Create your views here.
def index(request):
Expand Down

0 comments on commit a9dee3d

Please sign in to comment.