Commit 98ffa2f0 authored by Nicolas Noé's avatar Nicolas Noé
Browse files

Basic Specimen model + use of GeoDjango

parent 9bedb30d
from django.contrib import admin
from specimens.models import Specimen
class SpecimenAdmin(admin.ModelAdmin):
pass
admin.site.register(Specimen, SpecimenAdmin)
from django.apps import AppConfig
class SpecimensConfig(AppConfig):
name = 'specimens'
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-08 12:26
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Specimen',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('location', django.contrib.gis.db.models.fields.PointField(srid=4326)),
],
),
]
from django.contrib.gis.db import models
class Specimen(models.Model):
location = models.PointField()
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
......@@ -34,6 +34,8 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.gis',
'specimens',
]
MIDDLEWARE = [
......@@ -66,18 +68,6 @@ TEMPLATES = [
WSGI_APPLICATION = 'website.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
......
......@@ -4,7 +4,7 @@ SECRET_KEY = 'XXXX'
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
# Use PostgreSQL for this project
# Use PostGIS for this project
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment