Skip to content

Commit

Permalink
Merge pull request #1 from Ayush-SR/master
Browse files Browse the repository at this point in the history
Web Application Completed
  • Loading branch information
Raynor-X authored May 22, 2021
2 parents 3f9c91b + cfbd33d commit 2d67d68
Show file tree
Hide file tree
Showing 6,177 changed files with 694,788 additions and 1 deletion.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"git.ignoreLimitWarning": true,
"python.pythonPath": "ll_env/bin/python"
}
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# Web-Application
<h1>Learning Log</h1>
#### Developed with :heart: and :coffee: by @Ayush-SR
<p>
<b> Learning Log </b> helps you keep track of your learning, for any topic you're learning about.
</p>

<blockquote style="color:darksalmon; background-color:black; text-align: center; border-radius: 50px;
font-size: 15px; font-weight: 100;">" Live as if you were to die tomorrow. Learn as if you were to live forever.” Mahatma Gandhi </blockquote>

----------------------------------------------------------

#### Topics Page
![Screen](learning_logs/resources/ll.png)
#### Entry Page
![Screen](learning_logs/resources/ll1.png)
#### Admin Page
![Screen](learning_logs/resources/ll2.png)
Binary file added db.sqlite3
Binary file not shown.
Empty file added learning_log/__init__.py
Empty file.
Binary file added learning_log/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added learning_log/__pycache__/settings.cpython-38.pyc
Binary file not shown.
Binary file added learning_log/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added learning_log/__pycache__/wsgi.cpython-38.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions learning_log/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for learning_log project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'learning_log.settings')

application = get_asgi_application()
128 changes: 128 additions & 0 deletions learning_log/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
"""
Django settings for learning_log project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-&e)$+6#(izvjxk&8wjo%d1vb5o=+6^$@3a6bs@gz3xrqeh(xpj'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

# My apps
'learning_logs',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'learning_log.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'learning_log.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}


# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/

STATIC_URL = '/static/'

# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
23 changes: 23 additions & 0 deletions learning_log/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""learning_log URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.conf.urls import include, url
from django.urls import path

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('learning_logs.urls')), #namespace='learning_logs'),
]
16 changes: 16 additions & 0 deletions learning_log/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for learning_log project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'learning_log.settings')

application = get_wsgi_application()
Empty file added learning_logs/__init__.py
Empty file.
Binary file added learning_logs/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added learning_logs/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added learning_logs/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file added learning_logs/__pycache__/forms.cpython-38.pyc
Binary file not shown.
Binary file added learning_logs/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added learning_logs/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added learning_logs/__pycache__/views.cpython-38.pyc
Binary file not shown.
9 changes: 9 additions & 0 deletions learning_logs/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.contrib import admin

# Register your models here.

from learning_logs.models import Topic
from learning_logs.models import Entry

admin.site.register(Topic)
admin.site.register(Entry)
6 changes: 6 additions & 0 deletions learning_logs/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class LearningLogsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'learning_logs'
18 changes: 18 additions & 0 deletions learning_logs/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from django import forms

from .models import Topic, Entry

class TopicForm(forms.ModelForm):
class Meta:
model = Topic
fields = ['text']
labels = {'text': ''}
# widgets = {'text': forms.Textarea(attrs={'cols':80})}

class EntryForm(forms.ModelForm):
class Meta:
model = Entry
fields = ['text']
labels = {'text': ''}
widgets = {'text': forms.Textarea(attrs={'cols':80})}

22 changes: 22 additions & 0 deletions learning_logs/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.2 on 2021-05-04 07:55

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Topic',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.CharField(max_length=200)),
('date_added', models.DateTimeField(auto_now_add=True)),
],
),
]
26 changes: 26 additions & 0 deletions learning_logs/migrations/0002_entry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 3.2 on 2021-05-04 08:27

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('learning_logs', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Entry',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.TextField()),
('date_added', models.DateTimeField(auto_now_add=True)),
('topic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='learning_logs.topic')),
],
options={
'verbose_name_plural': 'entries',
},
),
]
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
26 changes: 26 additions & 0 deletions learning_logs/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from django.db import models

# Create your models here.
class Topic(models.Model):
"""A topic the user is learning about."""
text = models.CharField(max_length=200)
date_added = models.DateTimeField(auto_now_add=True)

def __str__(self):
"""Return a string representation of the model."""
return self.text

class Entry(models.Model):
"""Somethings specific learned about a topic"""
topic = models.ForeignKey(Topic,on_delete=models.CASCADE)
text = models.TextField()
date_added = models.DateTimeField(auto_now_add=True)

class Meta:
verbose_name_plural = 'entries'

def __str__(self):
"""Return a string representation of the model."""
return self.text[:50] + "..."


Binary file added learning_logs/resources/ll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added learning_logs/resources/ll1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added learning_logs/resources/ll2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions learning_logs/templates/learning_logs/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<head>
<title>Learning Log's Web Server</title>
<!-- <link rel="image" href="learning_logs/resources/KNIT.png"> -->
</head>

<p>
<blockquote style="color: black; font-weight: bold; font-size: 50px;">
Welcome to future of learning.
</blockquote>
<a href="{% url 'index' %}"><button>Learning Log</button></a>
<a href="{% url 'topics' %}"><button>Topics</button></a>

</p>

{% block content %}{% endblock content %}
15 changes: 15 additions & 0 deletions learning_logs/templates/learning_logs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% extends "learning_logs/base.html" %}
<p>Learning Log</p>


{% block content %}
&nbsp;

<p>
<b> Learning Log </b> helps you keep track of your learning, for any topic you're learning about.</p>

<blockquote style="color:darksalmon; background-color:black; text-align: center; border-radius: 50px;
font-size: 45px; font-weight: 100; bottom: 10%;">" Live as if you were to die tomorrow. Learn as if you were to live forever.”
Mahatma Gandhi </blockquote>

{% endblock content %}
14 changes: 14 additions & 0 deletions learning_logs/templates/learning_logs/new_entry.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "learning_logs/base.html" %}

{% block content %}

<p><a href="{% url 'topic' topic.id %}">{{ topic }}</a></p>

<!-- <p>Add a new entry:</p> -->
<!-- <form action="{% url 'new_entry' topic.id %}" method = 'post'>
{% csrf_token %}
{{ form.as_p }}
<button name='Submit'>Add Entry</button>
</form> -->

{% endblock content %}
11 changes: 11 additions & 0 deletions learning_logs/templates/learning_logs/new_topic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "learning_logs/base.html" %}

{% block content %}
<p>Add a new topic:</p>
<form action="{% url 'new_topic' %}" method='post'>
{% csrf_token %}
{{ form.as_p }}
<button name="Submit">add topic</button>
</form>

{% endblock content %}
Loading

0 comments on commit 2d67d68

Please sign in to comment.