user9963543
user9963543

Reputation:

SyntaxError: invalid syntax Django-app deployment

I check the documentation but still the problem unsolved. Invalid syntax in my forms.py file

from django import forms
from blog.models import Post,Comment

class PostForm(forms.ModelForm):

    class Meta():
        model = post
        fields = ('author', 'title','text')

    widgets = {
        'title':forms.TextInput(attrs={'class':'textinputclass'}),
        'text':forms.Textarea(attrs={'class':'editable medium-editor-textarea postcontent'})
    }

    class CommentForm(forms.ModelForm):

        class Meta():
            model = Comment
            fields = ('author', 'text')

        widgets = {
            'author': forms.TextInput(attrs={'class':'textinputclass'})
            'text': forms.Textarea(attrs={'class':'editable medium-editor-textarea'})
    }

I was trying to deploy my first django application (study purpose). Almost finish it when comes this error.

Upvotes: 0

Views: 535

Answers (1)

Goran
Goran

Reputation: 269

class PostForm(forms.ModelForm):

    class Meta():
        model = Post   # this needs to be Post not post
        fields = ('author', 'title','text')

Upvotes: 1

Related Questions