Artur Galyamov
2 years ago
4 changed files with 36 additions and 6 deletions
@ -0,0 +1,5 @@ |
|||||||
|
from django.forms import ModelForm |
||||||
|
|
||||||
|
|
||||||
|
class ArticleForm(ModelForm): |
||||||
|
pass |
@ -0,0 +1,13 @@ |
|||||||
|
<h1>Заполните данные статьи для продвижения в соц. сетях</h1> |
||||||
|
<form |
||||||
|
method="post" |
||||||
|
enctype="application/x-www-form-urlencoded" |
||||||
|
action="{% url 'create-article' %}" |
||||||
|
> |
||||||
|
{% csrf_token %} |
||||||
|
<label for="body">Краткий текст статьи</label> |
||||||
|
<textarea id="body" name="body"></textarea> |
||||||
|
<label for="link">Ссылка</label> |
||||||
|
<input type="text" name="link" id="link"> |
||||||
|
<input type="submit" value="Продвинуть"> |
||||||
|
</form> |
@ -1,7 +1,8 @@ |
|||||||
from django.urls import path |
from django.urls import path |
||||||
|
|
||||||
from .views import ArticleView |
from .views import ArticleView, new_article |
||||||
|
|
||||||
urlpatterns = [ |
urlpatterns = [ |
||||||
path('articles/', ArticleView.as_view()) |
path('articles/', ArticleView.as_view(), name='create-article'), |
||||||
|
path('articles/new/', new_article, name='new-article'), |
||||||
] |
] |
||||||
|
Loading…
Reference in new issue