質問編集履歴

3

MODELS追加

2019/12/25 20:07

投稿

vanvanvan
vanvanvan

score4

test CHANGED
File without changes
test CHANGED
@@ -74,6 +74,42 @@
74
74
 
75
75
  ```
76
76
 
77
+ ## MODELS.PY
78
+
79
+ ```PYTHON
80
+
81
+ from django.db import models
82
+
83
+ from django.contrib.auth.models import User
84
+
85
+
86
+
87
+ class UserProfileInfo(models.Model):
88
+
89
+
90
+
91
+ user = models.OneToOneField(User,on_delete=models.CASCADE)
92
+
93
+
94
+
95
+ portfolio_site = models.URLField(blank=True)
96
+
97
+
98
+
99
+ profile_pic = models.ImageField(upload_to='profile_pics',blank=True)
100
+
101
+
102
+
103
+ def __str__(self): # method
104
+
105
+ return self.user.username
106
+
107
+ ```
108
+
109
+
110
+
111
+
112
+
77
113
  ## FORMS.PY
78
114
 
79
115
  ```forms

2

環境追加

2019/12/25 20:07

投稿

vanvanvan
vanvanvan

score4

test CHANGED
File without changes
test CHANGED
@@ -8,6 +8,18 @@
8
8
 
9
9
 
10
10
 
11
+ ## 環境
12
+
13
+ OS WINDOWS 10
14
+
15
+ PYTHON 3.6
16
+
17
+ DJANGO 2.2
18
+
19
+
20
+
21
+ ## HTML
22
+
11
23
  ```html
12
24
 
13
25
  {% extends 'basic_app/base.html' %}
@@ -62,7 +74,7 @@
62
74
 
63
75
  ```
64
76
 
65
-
77
+ ## FORMS.PY
66
78
 
67
79
  ```forms
68
80
 
@@ -104,6 +116,8 @@
104
116
 
105
117
  ```
106
118
 
119
+ ## VIEWS.PY
120
+
107
121
  ```view
108
122
 
109
123
  from django.shortcuts import render

1

誤字

2019/12/25 20:05

投稿

vanvanvan
vanvanvan

score4

test CHANGED
File without changes
test CHANGED
@@ -104,7 +104,7 @@
104
104
 
105
105
  ```
106
106
 
107
- ```ここに言語を入力
107
+ ```view
108
108
 
109
109
  from django.shortcuts import render
110
110