dodanie widoku i bd
This commit is contained in:
parent
9fab809f98
commit
af00024fa4
Binary file not shown.
Binary file not shown.
BIN
SocialHelper/SocialHelper/__pycache__/urls.cpython-37.pyc
Normal file
BIN
SocialHelper/SocialHelper/__pycache__/urls.cpython-37.pyc
Normal file
Binary file not shown.
BIN
SocialHelper/SocialHelper/__pycache__/wsgi.cpython-37.pyc
Normal file
BIN
SocialHelper/SocialHelper/__pycache__/wsgi.cpython-37.pyc
Normal file
Binary file not shown.
@ -31,6 +31,7 @@ ALLOWED_HOSTS = []
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'homepage.apps.HomepageConfig',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
@ -75,12 +76,16 @@ WSGI_APPLICATION = 'SocialHelper.wsgi.application'
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'socialhelperdb',
|
||||
'USER': 'postgres',
|
||||
'PASSWORD': 'admin',
|
||||
'HOST': 'localhost'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
|
||||
|
||||
|
BIN
SocialHelper/homepage/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
SocialHelper/homepage/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
BIN
SocialHelper/homepage/__pycache__/admin.cpython-37.pyc
Normal file
BIN
SocialHelper/homepage/__pycache__/admin.cpython-37.pyc
Normal file
Binary file not shown.
BIN
SocialHelper/homepage/__pycache__/apps.cpython-37.pyc
Normal file
BIN
SocialHelper/homepage/__pycache__/apps.cpython-37.pyc
Normal file
Binary file not shown.
BIN
SocialHelper/homepage/__pycache__/models.cpython-37.pyc
Normal file
BIN
SocialHelper/homepage/__pycache__/models.cpython-37.pyc
Normal file
Binary file not shown.
@ -1,3 +1,4 @@
|
||||
from django.contrib import admin
|
||||
from .models import Product
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(Product)
|
||||
|
28
SocialHelper/homepage/migrations/0001_initial.py
Normal file
28
SocialHelper/homepage/migrations/0001_initial.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Generated by Django 2.1.5 on 2020-12-03 18:24
|
||||
|
||||
import datetime
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Product',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('create_date', models.DateField(default=datetime.date.today, verbose_name='Date')),
|
||||
('user_owner', models.TextField(default='', max_length=40)),
|
||||
('type', models.IntegerField(choices=[(1, 'Potrzebuje'), (2, 'Oddam')], default='')),
|
||||
('title', models.TextField(default='', max_length=40)),
|
||||
('description', models.TextField(default='', max_length=6000)),
|
||||
('place', models.TextField(default='', max_length=40)),
|
||||
('keywords', models.TextField(default='', max_length=6000)),
|
||||
],
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
@ -1,3 +1,16 @@
|
||||
from django.db import models
|
||||
import datetime
|
||||
|
||||
# Create your models here.
|
||||
TYPE_T = (
|
||||
(1,'Potrzebuje'),
|
||||
(2,'Oddam'),
|
||||
)
|
||||
|
||||
class Product(models.Model):
|
||||
create_date = models.DateField(("Date"), default=datetime.date.today)
|
||||
user_owner = models.TextField(max_length=40, blank=False, default="")
|
||||
type = models.IntegerField(choices = TYPE_T, blank=False, default="")
|
||||
title = models.TextField(max_length=40, blank=False, default="")
|
||||
description = models.TextField(max_length=6000, blank=False, default="")
|
||||
place = models.TextField(max_length=40, blank=False, default="")
|
||||
keywords = models.TextField(max_length=6000, blank=False, default="")
|
||||
|
6
SocialHelper/homepage/urls.py
Normal file
6
SocialHelper/homepage/urls.py
Normal file
@ -0,0 +1,6 @@
|
||||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name='index'),
|
||||
]
|
@ -1,3 +1,6 @@
|
||||
from django.shortcuts import render
|
||||
from django.http import HttpResponse
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def index(request):
|
||||
return HttpResponse("Hello, world. You're at the polls index.")
|
||||
|
Loading…
Reference in New Issue
Block a user