Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_k3git
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Gomez
midterm_k3git
Commits
a33d1373
Commit
a33d1373
authored
Mar 01, 2023
by
Nate Brevin A. Que
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created the Assignments page and its models, and updated the project's settings.
parent
a3222ac8
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
96 additions
and
17 deletions
+96
-17
.env
widget_k3git/.env
+1
-0
__init__.py
widget_k3git/assignments/__init__.py
+0
-0
admin.py
widget_k3git/assignments/admin.py
+3
-0
apps.py
widget_k3git/assignments/apps.py
+6
-0
0001_initial.py
widget_k3git/assignments/migrations/0001_initial.py
+35
-0
__init__.py
widget_k3git/assignments/migrations/__init__.py
+0
-0
models.py
widget_k3git/assignments/models.py
+15
-0
tests.py
widget_k3git/assignments/tests.py
+3
-0
urls.py
widget_k3git/assignments/urls.py
+10
-0
views.py
widget_k3git/assignments/views.py
+14
-0
db.sqlite3
widget_k3git/db.sqlite3
+0
-0
settings.py
widget_k3git/widget_k3git/settings.py
+7
-1
urls.py
widget_k3git/widget_k3git/urls.py
+2
-16
No files found.
widget_k3git/.env
0 → 100644
View file @
a33d1373
SECRET_KEY = 'django-insecure-0ne3r+4_-4wxim9e1!jkyw8%fnii1af4pc$irxf%nvrs3wp*1f'
\ No newline at end of file
widget_k3git/assignments/__init__.py
0 → 100644
View file @
a33d1373
widget_k3git/assignments/admin.py
0 → 100644
View file @
a33d1373
from
django.contrib
import
admin
# Register your models here.
widget_k3git/assignments/apps.py
0 → 100644
View file @
a33d1373
from
django.apps
import
AppConfig
class
AssignmentsConfig
(
AppConfig
):
default_auto_field
=
'django.db.models.BigAutoField'
name
=
'assignments'
widget_k3git/assignments/migrations/0001_initial.py
0 → 100644
View file @
a33d1373
# Generated by Django 3.2 on 2023-03-01 14:37
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Course'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'code'
,
models
.
CharField
(
max_length
=
10
)),
(
'title'
,
models
.
CharField
(
max_length
=
100
)),
(
'section'
,
models
.
CharField
(
max_length
=
3
)),
],
),
migrations
.
CreateModel
(
name
=
'Assignment'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'description'
,
models
.
TextField
()),
(
'perfect_score'
,
models
.
IntegerField
()),
(
'passing_score'
,
models
.
IntegerField
()),
(
'course'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'assignments.course'
)),
],
),
]
widget_k3git/assignments/migrations/__init__.py
0 → 100644
View file @
a33d1373
widget_k3git/assignments/models.py
0 → 100644
View file @
a33d1373
from
django.db
import
models
class
Course
(
models
.
Model
):
code
=
models
.
CharField
(
max_length
=
10
)
title
=
models
.
CharField
(
max_length
=
100
)
section
=
models
.
CharField
(
max_length
=
3
)
class
Assignment
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
100
)
description
=
models
.
TextField
()
course
=
models
.
ForeignKey
(
Course
,
on_delete
=
models
.
CASCADE
)
perfect_score
=
models
.
IntegerField
()
passing_score
=
models
.
IntegerField
()
\ No newline at end of file
widget_k3git/assignments/tests.py
0 → 100644
View file @
a33d1373
from
django.test
import
TestCase
# Create your tests here.
widget_k3git/assignments/urls.py
0 → 100644
View file @
a33d1373
from
django.contrib
import
admin
from
django.urls
import
path
from
.views
import
index
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
]
app_name
=
"assignments"
\ No newline at end of file
widget_k3git/assignments/views.py
0 → 100644
View file @
a33d1373
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
def
index
(
request
):
return
HttpResponse
(
"""<H1>Widget's Assignments Page</H1><br>
<H2><ul>
<li>Assignment Name: </li>
<li>Description: </li>
<li>Perfect Score: </li>
<li>Passing Score: </li>
<li>Course/Section: </li>
</H2>
"""
)
\ No newline at end of file
widget_k3git/db.sqlite3
0 → 100644
View file @
a33d1373
File added
widget_k3git/widget_k3git/settings.py
View file @
a33d1373
...
@@ -10,7 +10,12 @@ For the full list of settings and their values, see
...
@@ -10,7 +10,12 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
https://docs.djangoproject.com/en/4.1/ref/settings/
"""
"""
import
os
from
pathlib
import
Path
from
pathlib
import
Path
from
dotenv
import
load_dotenv
load_dotenv
()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR
=
Path
(
__file__
)
.
resolve
()
.
parent
.
parent
BASE_DIR
=
Path
(
__file__
)
.
resolve
()
.
parent
.
parent
...
@@ -20,7 +25,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
...
@@ -20,7 +25,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'django-insecure-0ne3r+4_-4wxim9e1!jkyw8
%
fnii1af4pc$irxf
%
nvrs3wp*1f'
SECRET_KEY
=
os
.
getenv
(
'SECRET_KEY'
)
# SECURITY WARNING: don't run with debug turned on in production!
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
DEBUG
=
True
...
@@ -37,6 +42,7 @@ INSTALLED_APPS = [
...
@@ -37,6 +42,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'assignments'
,
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
...
widget_k3git/widget_k3git/urls.py
View file @
a33d1373
"""widget_k3git URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/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.contrib
import
admin
from
django.urls
import
path
from
django.urls
import
include
,
path
urlpatterns
=
[
urlpatterns
=
[
path
(
'assignments/'
,
include
(
'assignments.urls'
,
namespace
=
"assignments"
)),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'admin/'
,
admin
.
site
.
urls
),
]
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment