first steps

This commit is contained in:
Benni Bärmann 2020-09-22 12:21:05 +02:00
parent 477425501d
commit 8cebb0fcd3
7 changed files with 47 additions and 2 deletions

View File

@ -31,6 +31,7 @@ ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'input.apps.InputConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',

View File

@ -14,8 +14,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include
urlpatterns = [
path('', include("input.urls")),
path('admin/', admin.site.urls),
]

View File

@ -1,3 +1,6 @@
from django.contrib import admin
# Register your models here.
from .models import Project
admin.site.register(Project)

View File

@ -0,0 +1,22 @@
# Generated by Django 3.1.1 on 2020-09-22 09:13
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Project',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('project_name', models.CharField(max_length=200)),
('project_start', models.DateTimeField(verbose_name='start date')),
],
),
]

View File

@ -1,3 +1,9 @@
from django.db import models
# Create your models here.
class Project(models.Model):
project_name = models.CharField(max_length=200)
project_start = models.DateTimeField('start date')
def __str__(self):
return self.project_name

7
input/urls.py Normal file
View File

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View File

@ -1,3 +1,8 @@
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the input form")