Skip to content

Commit 83ab875

Browse files
committed
hw1
0 parents  commit 83ab875

File tree

6,108 files changed

+804849
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,108 files changed

+804849
-0
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/test_2.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

book/__init__.py

Whitespace-only changes.
140 Bytes
Binary file not shown.

book/__pycache__/admin.cpython-39.pyc

255 Bytes
Binary file not shown.

book/__pycache__/apps.cpython-39.pyc

413 Bytes
Binary file not shown.
707 Bytes
Binary file not shown.

book/__pycache__/urls.cpython-39.pyc

280 Bytes
Binary file not shown.

book/__pycache__/views.cpython-39.pyc

407 Bytes
Binary file not shown.

book/admin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from django.contrib import admin
2+
from . import models
3+
4+
admin.site.register(models.Post)

book/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class BookConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'book'

book/migrations/0001_initial.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Generated by Django 4.1.7 on 2023-03-18 08:38
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = [
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='Post',
16+
fields=[
17+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('title', models.CharField(max_length=100)),
19+
('description', models.TextField(null=True)),
20+
('image', models.ImageField(null=True, upload_to='')),
21+
('created_date', models.DateTimeField(auto_now_add=True)),
22+
('url', models.URLField(max_length=50)),
23+
],
24+
),
25+
]

book/migrations/__init__.py

Whitespace-only changes.
Binary file not shown.
151 Bytes
Binary file not shown.

book/models.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django.db import models
2+
3+
4+
class Post(models.Model):
5+
title = models.CharField(max_length=100)
6+
description = models.TextField(null=True)
7+
image = models.ImageField(upload_to='', null=True)
8+
created_date = models.DateTimeField(auto_now_add=True)
9+
url = models.URLField(max_length=50)
10+
11+
def __str__(self):
12+
return self.title

book/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

book/urls.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.urls import path
2+
from . import views
3+
4+
5+
urlpatterns = [
6+
path("books/", views.book_view, name='books'),
7+
]

book/views.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.shortcuts import render
2+
from . import models
3+
4+
5+
def book_view(request):
6+
books = models.Post.objects.all()
7+
return render(request, 'index.html', {'books': books})

db.sqlite3

132 KB
Binary file not shown.

gitignore.txt

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/
139+
140+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
141+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
142+
143+
# User-specific stuff
144+
.idea/**/workspace.xml
145+
.idea/**/tasks.xml
146+
.idea/**/usage.statistics.xml
147+
.idea/**/dictionaries
148+
.idea/**/shelf
149+
150+
# AWS User-specific
151+
.idea/**/aws.xml
152+
153+
# Generated files
154+
.idea/**/contentModel.xml
155+
156+
# Sensitive or high-churn files
157+
.idea/**/dataSources/
158+
.idea/**/dataSources.ids
159+
.idea/**/dataSources.local.xml
160+
.idea/**/sqlDataSources.xml
161+
.idea/**/dynamic.xml
162+
.idea/**/uiDesigner.xml
163+
.idea/**/dbnavigator.xml
164+
165+
# Gradle
166+
.idea/**/gradle.xml
167+
.idea/**/libraries
168+
169+
# Gradle and Maven with auto-import
170+
# When using Gradle or Maven with auto-import, you should exclude module files,
171+
# since they will be recreated, and may cause churn. Uncomment if using
172+
# auto-import.
173+
# .idea/artifacts
174+
# .idea/compiler.xml
175+
# .idea/jarRepositories.xml
176+
# .idea/modules.xml
177+
# .idea/*.iml
178+
# .idea/modules
179+
# *.iml
180+
# *.ipr
181+
182+
# CMake
183+
cmake-build-*/
184+
185+
# Mongo Explorer plugin
186+
.idea/**/mongoSettings.xml
187+
188+
# File-based project format
189+
*.iws
190+
191+
# IntelliJ
192+
out/
193+
194+
# mpeltonen/sbt-idea plugin
195+
.idea_modules/
196+
197+
# JIRA plugin
198+
atlassian-ide-plugin.xml
199+
200+
# Cursive Clojure plugin
201+
.idea/replstate.xml
202+
203+
# Crashlytics plugin (for Android Studio and IntelliJ)
204+
com_crashlytics_export_strings.xml
205+
crashlytics.properties
206+
crashlytics-build.properties
207+
fabric.properties
208+
209+
# Editor-based Rest Client
210+
.idea/httpRequests
211+
212+
# Android studio 3.1+ serialized cache file
213+
.idea/caches/build_file_checksums.ser
214+
215+
.DS_Store
216+
# End of https://mrkandreev.name/snippets/gitignore-generator/#Python,PyCharm

main/__init__.py

Whitespace-only changes.
140 Bytes
Binary file not shown.
2.4 KB
Binary file not shown.

main/__pycache__/urls.cpython-39.pyc

1.13 KB
Binary file not shown.

main/__pycache__/wsgi.cpython-39.pyc

537 Bytes
Binary file not shown.

main/asgi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for main project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'main.settings')
15+
16+
application = get_asgi_application()

0 commit comments

Comments
 (0)