Skip to content

Commit 56ce397

Browse files
committed
first commit
0 parents  commit 56ce397

File tree

569 files changed

+61932
-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.

569 files changed

+61932
-0
lines changed

.gitignore

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
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/

Procfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web: gunicorn first.wsgi
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"Local: models","url":"c:\\Users\\DeLL\\Documents\\django\\django\\first\\blog\\models.py","tests":[{"id":1626501992436,"input":"","output":""}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"c:\\Users\\DeLL\\Documents\\django\\django\\first\\blog\\models.py","group":"local","local":true}

blog/__init__.py

Whitespace-only changes.

blog/admin.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.contrib import admin
2+
from .models import Post
3+
4+
admin.site.register(Post)
5+
6+
7+

blog/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class BlogConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'blog'

blog/forms.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .models import Comment
2+
from django import forms
3+
4+
class CommentForm(forms.ModelForm):
5+
class Meta:
6+
model = Comment
7+
fields = ('name', 'email', 'body')

blog/migrations/0001_initial.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Generated by Django 4.0.dev20210706084406 on 2021-07-19 04:22
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
import django.utils.timezone
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15+
('auth', '0012_alter_user_first_name_max_length'),
16+
]
17+
18+
operations = [
19+
migrations.CreateModel(
20+
name='Post',
21+
fields=[
22+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
23+
('title', models.CharField(max_length=100)),
24+
('content', models.TextField()),
25+
('date_posted', models.DateTimeField(default=django.utils.timezone.now)),
26+
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='auth.user')),
27+
('likes', models.ManyToManyField(blank=True, related_name='likes', to=settings.AUTH_USER_MODEL)),
28+
],
29+
),
30+
]

blog/migrations/__init__.py

Whitespace-only changes.

blog/models.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from django.db import models
2+
from django.utils import timezone
3+
from django.contrib.auth.models import User
4+
from django.urls import reverse
5+
class Post(models.Model):
6+
title=models.CharField(max_length=100)
7+
content=models.TextField()
8+
date_posted=models.DateTimeField(default=timezone.now)
9+
author=models.ForeignKey(User,on_delete=models.CASCADE)
10+
likes=models.ManyToManyField(User,related_name='likes',blank=True)
11+
def __str__(self) :
12+
return self.title
13+
def get_absolute_url(self):
14+
return reverse('post-detail',kwargs={'pk':self.pk})
15+
def total_likes(self):
16+
return self.likes.count()
17+
18+

blog/rdemo.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

blog/static/blog/def.jfif

6.77 KB
Binary file not shown.

blog/static/blog/main.css

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
body {
2+
background:url("./manga panel.jpg");
3+
color: #333333;
4+
margin-top: 5rem;
5+
}
6+
7+
h2, h3, h4, h5, h6 {
8+
color: #444444;
9+
}
10+
h1{
11+
color:crimson
12+
}
13+
ul {
14+
margin: 0;
15+
}
16+
17+
.bg-steel {
18+
background-color: rgb(192, 16, 51);
19+
}
20+
21+
.site-header .navbar-nav .nav-link {
22+
color: #cbd5db;
23+
}
24+
25+
.site-header .navbar-nav .nav-link:hover {
26+
color: #ffffff;
27+
}
28+
29+
.site-header .navbar-nav .nav-link.active {
30+
font-weight: 500;
31+
}
32+
33+
.content-section {
34+
background: #ffffff;
35+
padding: 10px 20px;
36+
border: 1px solid #dddddd;
37+
border-radius: 3px;
38+
margin-bottom: 20px;
39+
}
40+
41+
.article-title {
42+
color: #444444;
43+
}
44+
45+
a.article-title:hover {
46+
color: #428bca;
47+
text-decoration: none;
48+
}
49+
50+
.article-content {
51+
white-space: pre-line;
52+
}
53+
54+
.article-img {
55+
height: 65px;
56+
width: 65px;
57+
margin-right: 16px;
58+
}
59+
60+
.article-metadata {
61+
padding-bottom: 1px;
62+
margin-bottom: 4px;
63+
border-bottom: 1px solid #e3e3e3
64+
}
65+
66+
.article-metadata a:hover {
67+
color: #333;
68+
text-decoration: none;
69+
}
70+
71+
.article-svg {
72+
width: 25px;
73+
height: 25px;
74+
vertical-align: middle;
75+
}
76+
77+
.account-img {
78+
height: 125px;
79+
width: 125px;
80+
margin-right: 20px;
81+
margin-bottom: 16px;
82+
}
83+
84+
.account-heading {
85+
font-size: 2.5rem;
86+
}
87+
.content-section a:hover {
88+
color: crimson;
89+
text-decoration: none;
90+
}
91+
.content-section a {
92+
color: #333;
93+
text-decoration: none;
94+
}
95+
.updown{
96+
97+
}

blog/static/blog/manga panel.jpg

158 KB
Loading

blog/templates/blog/about.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
{% extends "blog/base.html" %}
3+
{% block content %}
4+
<h1>Blog About!</h1>
5+
6+
{% endblock content %}

0 commit comments

Comments
 (0)