so I changed my code into 3 parts. If I understood the documentation right this should create a form based on the Customer model in models.py and display it on my index.htmlforms.pyfrom django import formsfrom .models import Customerclass SignUpForm(forms.ModelForm):class Meta:model = Customermodels.pyclass Customer(models.Model):NAME = models.CharField(max_length=200)WEBSITE = models.CharField(max_length=200)PHONE = models.CharField(max_length=200)EMAIL = models.CharField(max_length=200)ADDRESS = models.CharField(max_length=200)VMIDS = models.CharField(max_length=200)def __unicode__(self):return self.NAMEviews.pyfrom django.shortcuts import renderfrom django.http import HttpResponsefrom vmware.models import Customerfrom django.shortcuts import render_to_responsefrom vmware.models import Vmsfrom .forms import SignUpFormdef index(request):form = SignUpForm(request.POST or None)if form.is_valid():save_it = form.save(commit=False)save_it.save()customers = Customer.objects.all()ctx = { 'customers':customers }return render_to_response('index.html', ctx)index.html<form action='' method='POST'> {% csrf_token %}{{ form.as_p }}<p><input type="submit" value="Add"></p></form>--To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a4f836fc-c039-486c-b53b-55ce4178970a%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.