diff --git a/BestNotesProject/__pycache__/__init__.cpython-38.pyc b/BestNotesProject/__pycache__/__init__.cpython-38.pyc index 818c2da..eef0037 100644 Binary files a/BestNotesProject/__pycache__/__init__.cpython-38.pyc and b/BestNotesProject/__pycache__/__init__.cpython-38.pyc differ diff --git a/BestNotesProject/__pycache__/settings.cpython-38.pyc b/BestNotesProject/__pycache__/settings.cpython-38.pyc index ea54232..3d5303c 100644 Binary files a/BestNotesProject/__pycache__/settings.cpython-38.pyc and b/BestNotesProject/__pycache__/settings.cpython-38.pyc differ diff --git a/BestNotesProject/__pycache__/urls.cpython-38.pyc b/BestNotesProject/__pycache__/urls.cpython-38.pyc index 24bb478..03fff54 100644 Binary files a/BestNotesProject/__pycache__/urls.cpython-38.pyc and b/BestNotesProject/__pycache__/urls.cpython-38.pyc differ diff --git a/BestNotesProject/__pycache__/wsgi.cpython-38.pyc b/BestNotesProject/__pycache__/wsgi.cpython-38.pyc index 11339ee..b762953 100644 Binary files a/BestNotesProject/__pycache__/wsgi.cpython-38.pyc and b/BestNotesProject/__pycache__/wsgi.cpython-38.pyc differ diff --git a/BestNotesProject/settings.py b/BestNotesProject/settings.py index 0d46e99..385d1cf 100644 --- a/BestNotesProject/settings.py +++ b/BestNotesProject/settings.py @@ -28,6 +28,11 @@ DEBUG = True ALLOWED_HOSTS = [] +STATIC_URL = '/static/' +# +LOGIN_REDIRECT_URL = '/bestnotes/' +LOGOUT_REDIRECT_URL = '/bestnotes/accounts/login/' + # Application definition INSTALLED_APPS = [ @@ -38,7 +43,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'widget_tweaks' + 'widget_tweaks', ] MIDDLEWARE = [ @@ -120,6 +125,3 @@ USE_TZ = True # https://docs.djangoproject.com/en/2.2/howto/static-files/ STATIC_URL = '/static/' - -LOGIN_REDIRECT_URL = '/bestnotes/subject/' #To change, at this moment we have no home site -LOGOUT_REDIRECT_URL = '/bestnotes/accounts/login' \ No newline at end of file diff --git a/BestNotesProject/static/images/bg_notes.jpg b/BestNotesProject/static/images/bg_notes.jpg new file mode 100644 index 0000000..3e657e4 Binary files /dev/null and b/BestNotesProject/static/images/bg_notes.jpg differ diff --git a/BestNotesProject/urls.py b/BestNotesProject/urls.py index 9856b50..79d2524 100644 --- a/BestNotesProject/urls.py +++ b/BestNotesProject/urls.py @@ -15,8 +15,10 @@ Including another URLconf """ from django.contrib import admin from django.urls import path, include +from bestnotes.views import homepage urlpatterns = [ path('bestnotes/', include('bestnotes.urls')), + path('', homepage, name='homepage'), path('admin/', admin.site.urls), ] diff --git a/bestnotes/__pycache__/__init__.cpython-38.pyc b/bestnotes/__pycache__/__init__.cpython-38.pyc index 4de046f..3dea93c 100644 Binary files a/bestnotes/__pycache__/__init__.cpython-38.pyc and b/bestnotes/__pycache__/__init__.cpython-38.pyc differ diff --git a/bestnotes/__pycache__/admin.cpython-38.pyc b/bestnotes/__pycache__/admin.cpython-38.pyc index 917c192..6d225d1 100644 Binary files a/bestnotes/__pycache__/admin.cpython-38.pyc and b/bestnotes/__pycache__/admin.cpython-38.pyc differ diff --git a/bestnotes/__pycache__/apps.cpython-38.pyc b/bestnotes/__pycache__/apps.cpython-38.pyc index 44c6522..8684cee 100644 Binary files a/bestnotes/__pycache__/apps.cpython-38.pyc and b/bestnotes/__pycache__/apps.cpython-38.pyc differ diff --git a/bestnotes/__pycache__/models.cpython-38.pyc b/bestnotes/__pycache__/models.cpython-38.pyc index aef69e7..1eb4246 100644 Binary files a/bestnotes/__pycache__/models.cpython-38.pyc and b/bestnotes/__pycache__/models.cpython-38.pyc differ diff --git a/bestnotes/__pycache__/urls.cpython-38.pyc b/bestnotes/__pycache__/urls.cpython-38.pyc index b40d5b0..32bfb75 100644 Binary files a/bestnotes/__pycache__/urls.cpython-38.pyc and b/bestnotes/__pycache__/urls.cpython-38.pyc differ diff --git a/bestnotes/__pycache__/views.cpython-38.pyc b/bestnotes/__pycache__/views.cpython-38.pyc index 27023b4..4c8494c 100644 Binary files a/bestnotes/__pycache__/views.cpython-38.pyc and b/bestnotes/__pycache__/views.cpython-38.pyc differ diff --git a/bestnotes/admin.py b/bestnotes/admin.py index 6b4570b..4036e30 100644 --- a/bestnotes/admin.py +++ b/bestnotes/admin.py @@ -2,6 +2,8 @@ from django.contrib import admin # Register your models here. from django.contrib import admin -from .models import StudentProfile +from .models import StudentProfile, Subject, Topic -admin.site.register(StudentProfile) \ No newline at end of file +admin.site.register(StudentProfile) +admin.site.register(Subject) +admin.site.register(Topic) \ No newline at end of file diff --git a/bestnotes/migrations/0002_subject_topic.py b/bestnotes/migrations/0002_subject_topic.py new file mode 100644 index 0000000..6fe04b2 --- /dev/null +++ b/bestnotes/migrations/0002_subject_topic.py @@ -0,0 +1,31 @@ +# Generated by Django 2.2.7 on 2019-12-01 22:21 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('bestnotes', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Subject', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=30)), + ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bestnotes.StudentProfile')), + ], + ), + migrations.CreateModel( + name='Topic', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=30)), + ('add_date', models.DateField()), + ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bestnotes.Subject')), + ], + ), + ] diff --git a/bestnotes/migrations/__pycache__/0001_initial.cpython-38.pyc b/bestnotes/migrations/__pycache__/0001_initial.cpython-38.pyc index 0af4ce3..58c19d0 100644 Binary files a/bestnotes/migrations/__pycache__/0001_initial.cpython-38.pyc and b/bestnotes/migrations/__pycache__/0001_initial.cpython-38.pyc differ diff --git a/bestnotes/migrations/__pycache__/__init__.cpython-38.pyc b/bestnotes/migrations/__pycache__/__init__.cpython-38.pyc index 01a50cd..04a1487 100644 Binary files a/bestnotes/migrations/__pycache__/__init__.cpython-38.pyc and b/bestnotes/migrations/__pycache__/__init__.cpython-38.pyc differ diff --git a/bestnotes/models.py b/bestnotes/models.py index e834dfe..112a068 100644 --- a/bestnotes/models.py +++ b/bestnotes/models.py @@ -18,17 +18,9 @@ class StudentProfile(models.Model): to add as foreign key, when coresponding table is added: CourseId """ + -class Subject(models.Model): - name = models.CharField(max_length=30) - student = models.ForeignKey(StudentProfile, on_delete=models.CASCADE) - -class Topic(models.Model): - name = models.CharField(max_length=30) - subject = models.ForeignKey(Subject, on_delete=models.CASCADE) - add_date = models.DateField() - @@ -41,4 +33,16 @@ def create_studentprofile(sender, instance, created, **kwargs): @receiver(post_save, sender=User) def save_studentprofile(sender, instance, **kwargs): - instance.studentprofile.save() \ No newline at end of file + instance.studentprofile.save() + + +class Subject(models.Model): + name = models.CharField(max_length=30) + student = models.ForeignKey(StudentProfile, on_delete=models.CASCADE) + +class Topic(models.Model): + name = models.CharField(max_length=30) + subject = models.ForeignKey(Subject, on_delete=models.CASCADE) + add_date = models.DateField() + + diff --git a/bestnotes/static/bg_notes.jpg b/bestnotes/static/bg_notes.jpg new file mode 100644 index 0000000..2707b2f Binary files /dev/null and b/bestnotes/static/bg_notes.jpg differ diff --git a/bestnotes/static/homepage.css b/bestnotes/static/homepage.css new file mode 100644 index 0000000..e69de29 diff --git a/bestnotes/static/laptop.jpg b/bestnotes/static/laptop.jpg new file mode 100644 index 0000000..5b9b6ea Binary files /dev/null and b/bestnotes/static/laptop.jpg differ diff --git a/bestnotes/static/laptop.png b/bestnotes/static/laptop.png new file mode 100644 index 0000000..566d5d9 Binary files /dev/null and b/bestnotes/static/laptop.png differ diff --git a/bestnotes/static/subject.css b/bestnotes/static/subject.css new file mode 100644 index 0000000..e69de29 diff --git a/bestnotes/templates/homepage.html b/bestnotes/templates/homepage.html new file mode 100644 index 0000000..e14d60d --- /dev/null +++ b/bestnotes/templates/homepage.html @@ -0,0 +1,39 @@ +{% extends 'base.html' %} +{% load static %} +{% block css %} + +{% endblock %} + +{% block content %} + + + +{% include 'navbar.html' %} + +
+
+
+ +
+ +
+
+
+ +
+
+

Stwórz najlepszą wersję mobilnych notatek

+
+ +
+
+
+

Dziel się notatkami ze znajomymi

+
+ +
+ +
+ + +{% endblock %} \ No newline at end of file diff --git a/bestnotes/templates/navbar.html b/bestnotes/templates/navbar.html index d2c0a5d..204447e 100644 --- a/bestnotes/templates/navbar.html +++ b/bestnotes/templates/navbar.html @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/bestnotes/templates/registration/login.html b/bestnotes/templates/registration/login.html index 620d353..c5e51d9 100644 --- a/bestnotes/templates/registration/login.html +++ b/bestnotes/templates/registration/login.html @@ -5,6 +5,9 @@ {% endblock %} {% block content %} + +{% include 'navbar.html' %} +