Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Machine Learning for the Web

You're reading from   Machine Learning for the Web Gaining insight and intelligence from the internet with Python

Arrow left icon
Product type Paperback
Published in Jul 2016
Publisher Packt
ISBN-13 9781785886607
Length 298 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Andrea Isoni Andrea Isoni
Author Profile Icon Andrea Isoni
Andrea Isoni
Steve Essinger Steve Essinger
Author Profile Icon Steve Essinger
Steve Essinger
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Introduction to Practical Machine Learning Using Python FREE CHAPTER 2. Unsupervised Machine Learning 3. Supervised Machine Learning 4. Web Mining Techniques 5. Recommendation Systems 6. Getting Started with Django 7. Movie Recommendation System Web Application 8. Sentiment Analyser Application for Movie Reviews Index

Writing an app – most important features


To create a web application that stores e-mail addresses, we will need a table that stores the data and web pages that allow the end user to add, delete, and review the address book. Furthermore, we may want to transform the address book to read as a spreadsheet, or send the data to another app through the Internet. There are specific Django features to accomplish all these actions (models, views, admin, API REST-framework, and commands) and we will now discuss the way the data is stored.

Models

To create an e-mail address book, we need to store, in a table, the name of each contact with their e-mail address. A table in Django is called a model and it is defined in the models.py file:

from django.db import models
from django.utils.translation import ugettext_lazy as _

class Person(models.Model):
    name = models.CharField(_('Name'), max_length=255, unique=True)
    mail = models.EmailField(max_length=255, blank=True)
    #display name on admin panel...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image