from django.utils.encoding import smart_unicode
# Create your models here.
class SignUp(models.Model):
first_name = models.CharField(max_length=120, null=True, blank=True)
last_name = models.CharField(max_length=120, null=True, blank=True)
email = models.EmailField()
timestamp = models.DateTimeField(auto_now_add =True, auto_now=False)
updated = models.DateTimeField(auto_now_add=False, auto_now=True)
def __unicode__(self):
return smart_unicode(self.email)
pass
from django.contrib import admin
#Everything Below this
from .models import SignUp
class SignUpAdmin(admin.ModelAdmin):
class Meta:
model = SignUp
admin.site.register(SignUp, SignUpAdmin)
#code
Hi Guys,
I am really new to Django and Python. I have recently started learning them from a course on Udemy and I got stuck on the first example, making a web app. I'm not sure what I have done wrong but when I run my Django server it comes up with a NameError. I think the app is supposed to handle user data, such as first name,last name and email.
Thanks in advance :)
-- I am really new to Django and Python. I have recently started learning them from a course on Udemy and I got stuck on the first example, making a web app. I'm not sure what I have done wrong but when I run my Django server it comes up with a NameError. I think the app is supposed to handle user data, such as first name,last name and email.
Thanks in advance :)
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/468b9c2b-5ff6-412a-bc4f-e3c26aa3ddaf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment