parent
b9942e15b6
commit
241404ca37
5 changed files with 95 additions and 5 deletions
@ -0,0 +1,12 @@ |
||||
from django.contrib import admin |
||||
from django.urls import path, re_path |
||||
from django.views.static import serve |
||||
from form_demo import views |
||||
from django_demo import settings |
||||
|
||||
urlpatterns = [ |
||||
path('userinfo/', views.userinfo_form), |
||||
path('uploadimg/', views.img_file_form), |
||||
path('userinfomodel/', views.userinfo_model_form), |
||||
re_path(r'media/(?P<path>.*)', serve, {'document_root': settings.MEDIA_ROOT}), |
||||
] |
@ -0,0 +1,27 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<title>user_info_models</title> |
||||
</head> |
||||
<body> |
||||
<form action="" method="POST" novalidate> |
||||
{% csrf_token %} |
||||
<p>{{ form_obj.username.label }}:{{ form_obj.username }} |
||||
{{ errors.username.0 }}</p> |
||||
<p>{{ form_obj.password.label }}:{{ form_obj.password }} |
||||
{{ errors.password.0 }}</p> |
||||
<p>{{ form_obj.confirm_password.label }}:{{ form_obj.confirm_password }} |
||||
{{ errors.config_password.0 }}</p> |
||||
<p>{{ form_obj.status.label }}:{{ form_obj.status }} |
||||
{{ errors.status.0 }}</p> |
||||
<p>{{ form_obj.age.label }}:{{ form_obj.age }} |
||||
{{ errors.age.0 }}</p> |
||||
<p>{{ form_obj.mobile.label }}:{{ form_obj.mobile }} |
||||
{{ errors.mobile.0 }}</p> |
||||
{{ errors }} |
||||
<input type="submit" value="提交"> |
||||
</form> |
||||
|
||||
</body> |
||||
</html> |
Loading…
Reference in new issue