add models to django
This commit is contained in:
parent
e4395ccc4f
commit
17296c870b
Binary file not shown.
Binary file not shown.
@ -37,6 +37,7 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'imguploader.apps.ImguploaderConfig',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@ -103,9 +104,9 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/3.0/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
LANGUAGE_CODE = 'pl'
|
||||
|
||||
TIME_ZONE = 'UTC'
|
||||
TIME_ZONE = 'CET'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
|
@ -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 include, path
|
||||
|
||||
urlpatterns = [
|
||||
path('', include('imguploader.urls')),
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
|
Binary file not shown.
0
bibrecognition/imguploader/__init__.py
Normal file
0
bibrecognition/imguploader/__init__.py
Normal file
BIN
bibrecognition/imguploader/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
bibrecognition/imguploader/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
BIN
bibrecognition/imguploader/__pycache__/admin.cpython-37.pyc
Normal file
BIN
bibrecognition/imguploader/__pycache__/admin.cpython-37.pyc
Normal file
Binary file not shown.
BIN
bibrecognition/imguploader/__pycache__/apps.cpython-37.pyc
Normal file
BIN
bibrecognition/imguploader/__pycache__/apps.cpython-37.pyc
Normal file
Binary file not shown.
BIN
bibrecognition/imguploader/__pycache__/models.cpython-37.pyc
Normal file
BIN
bibrecognition/imguploader/__pycache__/models.cpython-37.pyc
Normal file
Binary file not shown.
BIN
bibrecognition/imguploader/__pycache__/urls.cpython-37.pyc
Normal file
BIN
bibrecognition/imguploader/__pycache__/urls.cpython-37.pyc
Normal file
Binary file not shown.
BIN
bibrecognition/imguploader/__pycache__/views.cpython-37.pyc
Normal file
BIN
bibrecognition/imguploader/__pycache__/views.cpython-37.pyc
Normal file
Binary file not shown.
3
bibrecognition/imguploader/admin.py
Normal file
3
bibrecognition/imguploader/admin.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
5
bibrecognition/imguploader/apps.py
Normal file
5
bibrecognition/imguploader/apps.py
Normal file
@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ImguploaderConfig(AppConfig):
|
||||
name = 'imguploader'
|
40
bibrecognition/imguploader/migrations/0001_initial.py
Normal file
40
bibrecognition/imguploader/migrations/0001_initial.py
Normal file
@ -0,0 +1,40 @@
|
||||
# Generated by Django 3.0.2 on 2020-02-02 02:41
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Competitions',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('comp_slug', models.CharField(max_length=100)),
|
||||
('comp_name', models.CharField(max_length=100)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Photo',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('url', models.CharField(max_length=50)),
|
||||
('comp_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='imguploader.Competitions')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PhotoMeta',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('meta_key', models.CharField(max_length=50)),
|
||||
('meta_value', models.CharField(max_length=50)),
|
||||
('photo_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='imguploader.Photo')),
|
||||
],
|
||||
),
|
||||
]
|
0
bibrecognition/imguploader/migrations/__init__.py
Normal file
0
bibrecognition/imguploader/migrations/__init__.py
Normal file
Binary file not shown.
Binary file not shown.
15
bibrecognition/imguploader/models.py
Normal file
15
bibrecognition/imguploader/models.py
Normal file
@ -0,0 +1,15 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
class Competitions(models.Model):
|
||||
comp_slug = models.CharField(max_length=100)
|
||||
comp_name = models.CharField(max_length=100)
|
||||
|
||||
class Photo(models.Model):
|
||||
comp_id = models.ForeignKey(Competitions, on_delete=models.CASCADE)
|
||||
url = models.CharField(max_length=50)
|
||||
|
||||
class PhotoMeta(models.Model):
|
||||
photo_id = models.ForeignKey(Photo, on_delete=models.CASCADE)
|
||||
meta_key = models.CharField(max_length=50)
|
||||
meta_value = models.CharField(max_length=50)
|
3
bibrecognition/imguploader/tests.py
Normal file
3
bibrecognition/imguploader/tests.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
7
bibrecognition/imguploader/urls.py
Normal file
7
bibrecognition/imguploader/urls.py
Normal file
@ -0,0 +1,7 @@
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name="index"),
|
||||
]
|
7
bibrecognition/imguploader/views.py
Normal file
7
bibrecognition/imguploader/views.py
Normal file
@ -0,0 +1,7 @@
|
||||
from django.shortcuts import render
|
||||
from django.http import HttpResponse
|
||||
|
||||
|
||||
# Create your views here.
|
||||
def index(request):
|
||||
return HttpResponse("Hello, world. This is imageUploader")
|
Loading…
Reference in New Issue
Block a user