Commit dfb3cb58 by Belákovics Ádám

Add basic instance

Added basic instance app and a basic model
parent ccda90c9
from django.contrib import admin
from instance.models import Instance
admin.site.register(Instance)
from django.apps import AppConfig
class InstanceConfig(AppConfig):
name = 'instance'
# Generated by Django 2.2 on 2019-04-17 14:01
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Instance',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(blank=True, help_text='Human readable name of instance.', max_length=100, verbose_name='name')),
('description', models.TextField(blank=True, help_text='The description of the instance.', verbose_name='description')),
],
),
]
from django.db import models
class Instance(models.Model):
name = models.CharField(blank=True, max_length=100, verbose_name="name",
help_text="Human readable name of instance.")
description = models.TextField(blank=True, verbose_name="description",
help_text="The description of the instance.")
from django.test import TestCase
# Create your tests here.
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]
\ No newline at end of file
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the instance index.")
...@@ -34,6 +34,7 @@ ALLOWED_HOSTS = [ ...@@ -34,6 +34,7 @@ ALLOWED_HOSTS = [
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
'instance.apps.InstanceConfig',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
......
...@@ -17,6 +17,7 @@ from django.contrib import admin ...@@ -17,6 +17,7 @@ from django.contrib import admin
from django.urls import path, re_path, include from django.urls import path, re_path, include
urlpatterns = [ urlpatterns = [
path('instance/', include('instance.urls')),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
re_path(r'^auth/', include('djoser.urls')), re_path(r'^auth/', include('djoser.urls')),
re_path(r'^auth/', include('djoser.urls.authtoken')) re_path(r'^auth/', include('djoser.urls.authtoken'))
......
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 sign in to comment