Skip to content

Commit

Permalink
项目初始配置以及用户登录注册和帖子展示相关功能完成
Browse files Browse the repository at this point in the history
  • Loading branch information
xishandong committed Jul 10, 2023
0 parents commit 568eb52
Show file tree
Hide file tree
Showing 73 changed files with 1,044 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

93 changes: 93 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/webServer.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added Server01/__init__.py
Empty file.
Binary file added Server01/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added Server01/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file added Server01/__pycache__/apps.cpython-39.pyc
Binary file not shown.
Binary file added Server01/__pycache__/models.cpython-39.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions Server01/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions Server01/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class Server01Config(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "Server01"
143 changes: 143 additions & 0 deletions Server01/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Generated by Django 4.1 on 2023-07-09 04:34

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


class Migration(migrations.Migration):

initial = True

dependencies = []

operations = [
migrations.CreateModel(
name="Post",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("title", models.CharField(max_length=64, verbose_name="标题")),
(
"content",
models.TextField(max_length=3000, null=True, verbose_name="内容"),
),
(
"created_at",
models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
),
],
),
migrations.CreateModel(
name="User",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("username", models.CharField(max_length=32, verbose_name="用户名")),
("password", models.CharField(max_length=64, verbose_name="密码")),
(
"avatar",
models.CharField(
default="http://localhost:8000/static/img/defaultAvatar.jpg",
max_length=64,
null=True,
verbose_name="头像",
),
),
(
"signature",
models.CharField(
default="暂时没有个性签名~",
max_length=64,
null=True,
verbose_name="个性签名",
),
),
(
"collected",
models.ManyToManyField(
blank=True, related_name="collected", to="Server01.post"
),
),
(
"favorites",
models.ManyToManyField(
blank=True, related_name="favorite", to="Server01.post"
),
),
(
"following",
models.ManyToManyField(
blank=True, related_name="followers", to="Server01.user"
),
),
],
),
migrations.AddField(
model_name="post",
name="user",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="posts",
to="Server01.user",
),
),
migrations.CreateModel(
name="Comment",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("content", models.TextField(max_length=3000, verbose_name="评论")),
(
"created_at",
models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
),
(
"parent_comment",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="replies",
to="Server01.comment",
),
),
(
"post",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="comments",
to="Server01.post",
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="comments",
to="Server01.user",
),
),
],
),
]
22 changes: 22 additions & 0 deletions Server01/migrations/0002_alter_user_avatar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.1 on 2023-07-09 05:19

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("Server01", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name="user",
name="avatar",
field=models.CharField(
default="http://localhost:8000/static/img/defaultAvatar.jpg",
max_length=64,
verbose_name="头像",
),
),
]
22 changes: 22 additions & 0 deletions Server01/migrations/0003_alter_user_avatar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.1 on 2023-07-09 07:28

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("Server01", "0002_alter_user_avatar"),
]

operations = [
migrations.AlterField(
model_name="user",
name="avatar",
field=models.CharField(
default="http://localhost:8000/static/img/avatar/defaultAvatar.jpg",
max_length=64,
verbose_name="头像",
),
),
]
20 changes: 20 additions & 0 deletions Server01/migrations/0004_user_email.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.1 on 2023-07-09 10:43

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("Server01", "0003_alter_user_avatar"),
]

operations = [
migrations.AddField(
model_name="user",
name="email",
field=models.CharField(
default="123@123.com", max_length=32, verbose_name="邮箱"
),
),
]
Loading

0 comments on commit 568eb52

Please sign in to comment.