navidabasi
navidabasi

Reputation: 181

Forms has no attribute form

Hi guys im new to django so i tried to import forms from django and use it to make a section to send out articles and this is the code :

from django import forms

class SendArticleForm(forms.form):
    title = forms.CharField()
    body = forms.CharField(widget = forms.Textarea)
    published_at = forms.DateField()

so after i tried to upload this code and run local server it gave me this error and i cant findout how this is happend.

Upvotes: 1

Views: 1020

Answers (1)

CC7052
CC7052

Reputation: 577

You should use Form attribute of froms it goes like this:

from django import forms

class SendArticleForm(forms.Form):
     title = forms.CharField()

Upvotes: 1

Related Questions