I am doing a Django project, and when I tried to access 127.0.0.1:8000/articles/create, I got the following error in my Ubuntu terminal:
/home/(my name)/django_test/article/forms.py:4: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form ArticleForm needs updating class ArticleForm(forms.ModelForm):
In addition, I also received the following error when visiting my actual localhost site:
ValueError at /articles/create/ The view article.views.create didn't return an HttpResponse object. It returned None instead.
Here is my forms.py file:
from django import forms from models import Article class ArticleForm(forms.ModelForm): class Meta: model = Article
And here is my views.py file:
from django.shortcuts import render_to_response from article.models import Article from django.http import HttpResponse from forms import ArticleForm from django.http import HttpResponseRedirect from django.core.context_processors import csrf
I am not sure how to fix this problem. I looked through the Django documentation, but could not find a solution to my problem, so any help would be appreciated.
python django
brown1001 Feb 03 '15 at 18:36 2015-02-03 18:36
source share