diff --git a/currencyproj/currencyproj/__pycache__/__init__.cpython-36.pyc b/currencyproj/currencyproj/__pycache__/__init__.cpython-36.pyc index 330a35f8..1675128a 100644 Binary files a/currencyproj/currencyproj/__pycache__/__init__.cpython-36.pyc and b/currencyproj/currencyproj/__pycache__/__init__.cpython-36.pyc differ diff --git a/currencyproj/currencyproj/__pycache__/settings.cpython-36.pyc b/currencyproj/currencyproj/__pycache__/settings.cpython-36.pyc index 610df9fe..9418a96c 100644 Binary files a/currencyproj/currencyproj/__pycache__/settings.cpython-36.pyc and b/currencyproj/currencyproj/__pycache__/settings.cpython-36.pyc differ diff --git a/currencyproj/currencyproj/settings.py b/currencyproj/currencyproj/settings.py index a54205a6..9b6ca056 100644 --- a/currencyproj/currencyproj/settings.py +++ b/currencyproj/currencyproj/settings.py @@ -37,6 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'home', ] MIDDLEWARE = [ diff --git a/currencyproj/currencyproj/urls.py b/currencyproj/currencyproj/urls.py index ba234304..30e1417f 100644 --- a/currencyproj/currencyproj/urls.py +++ b/currencyproj/currencyproj/urls.py @@ -15,7 +15,13 @@ Including another URLconf """ from django.contrib import admin from django.urls import path +from home.models import upload_video,upload_image +from home.views import upload_content, imageUpload, videoUpload urlpatterns = [ path('admin/', admin.site.urls), + path('upload/',upload_content, name="upload"), + path('upload_video/',videoUpload,name='upload_video'), + path('upload_image/',imageUpload,name='upload_image'), + ] diff --git a/currencyproj/db.sqlite3 b/currencyproj/db.sqlite3 new file mode 100644 index 00000000..07ab0ea0 Binary files /dev/null and b/currencyproj/db.sqlite3 differ diff --git a/currencyproj/home/admin.py b/currencyproj/home/admin.py index 8c38f3f3..cc1da641 100644 --- a/currencyproj/home/admin.py +++ b/currencyproj/home/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin +from .models import upload_image, upload_video -# Register your models here. +admin.site.register(upload_image) +admin.site.register(upload_video) diff --git a/currencyproj/home/migrations/0001_initial.py b/currencyproj/home/migrations/0001_initial.py new file mode 100644 index 00000000..70f80d6e --- /dev/null +++ b/currencyproj/home/migrations/0001_initial.py @@ -0,0 +1,22 @@ +# Generated by Django 3.1.6 on 2021-02-05 00:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='upload', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('image', models.FileField(upload_to='images/')), + ('video', models.FileField(upload_to='videos/')), + ], + ), + ] diff --git a/currencyproj/home/migrations/0002_auto_20210205_0037.py b/currencyproj/home/migrations/0002_auto_20210205_0037.py new file mode 100644 index 00000000..08f2c0b4 --- /dev/null +++ b/currencyproj/home/migrations/0002_auto_20210205_0037.py @@ -0,0 +1,30 @@ +# Generated by Django 3.1.6 on 2021-02-05 00:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='upload_image', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('image', models.FileField(upload_to='images/')), + ], + ), + migrations.CreateModel( + name='upload_video', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('video', models.FileField(upload_to='videos/')), + ], + ), + migrations.DeleteModel( + name='upload', + ), + ] diff --git a/currencyproj/home/models.py b/currencyproj/home/models.py index 4c0f90cf..e1ac3f69 100644 --- a/currencyproj/home/models.py +++ b/currencyproj/home/models.py @@ -1,6 +1,8 @@ from django.db import models -class Ticker(models.Model): - f = open("../currency.txt","r") - a = f.readline() - print(a) +class upload_image(models.Model): + # check for file extensions + image = models.FileField(upload_to="images/") + +class upload_video(models.Model): + video = models.FileField(upload_to="videos/") diff --git a/currencyproj/home/templates/index.html b/currencyproj/home/templates/index.html new file mode 100644 index 00000000..f5e1312e --- /dev/null +++ b/currencyproj/home/templates/index.html @@ -0,0 +1,20 @@ + + +
+ +