浏览代码

post

master
jfinn 5 天前
父节点
当前提交
5b07e81e0a
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 2
    1
      wsps/templates/post.html
  2. 2
    0
      wsps/views.py

+ 2
- 1
wsps/templates/post.html 查看文件

1
 <!-- templates/post.html -->
1
 <!-- templates/post.html -->
2
 <h1>Create Post Page</h1>
2
 <h1>Create Post Page</h1>
3
-<form method="post" enctype="multipart/form-data" action="/jstp_dev5">
3
+<!-- <form method="post" enctype="multipart/form-data" action="/jstp_dev5"> -->
4
+<form method="post" enctype="multipart/form-data" action="/djc_srv_v2/jstp_dev5">
4
   {% csrf_token %}
5
   {% csrf_token %}
5
   {{ form.as_p }}
6
   {{ form.as_p }}
6
   <button type="submit">Submit New Post</button>
7
   <button type="submit">Submit New Post</button>

+ 2
- 0
wsps/views.py 查看文件

11
 from django.views.generic import ListView, CreateView  # new
11
 from django.views.generic import ListView, CreateView  # new
12
 from .models import Post,PostForm
12
 from .models import Post,PostForm
13
 
13
 
14
+from django.core.files.base import ContentFile
15
+
14
 
16
 
15
 import wsps.gmod as gmod
17
 import wsps.gmod as gmod
16
 
18
 

正在加载...
取消
保存