Skip to content

Commit 704c54e

Browse files
committed
edit code
1 parent be878e5 commit 704c54e

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

source/django-get-started/django-create-app.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,30 @@ Create an Application
7777

7878
.. code-block:: bash
7979

80-
python manage.py migrate
80+
python3 manage.py migrate
8181

82-
.. step:: Create models for movie and users data
82+
.. step:: Create models for movie and user data
8383

8484
Open the ``models.py`` file in the ``sample_mflix`` directory and replace
8585
its contents with the following code:
8686

8787
.. code-block:: python
8888

89+
import datetime
90+
8991
from django.db import models
9092

9193

9294
class Movies(models.Model):
93-
name = models.CharField(max_length=200)
95+
title = models.CharField(max_length=200)
96+
plot = models.CharField(max_length=800)
9497
runtime = models.IntegerField(default=0)
95-
98+
released = models.DateTimeField("release date", null=True)
9699

97100
class Users(models.Model):
98-
name = models.CharField(max_length=200)
101+
name = models.CharField(max_length=100)
99102
email = models.CharField(max_length=200)
100-
103+
password = models.CharField(max_length=100)
101104

102105
.. step:: Include your app in your project
103106

source/django-get-started/django-write-data.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Write Data to MongoDB
3030
.. code-block:: python
3131

3232
from sample_mflix.models import Movies, Users
33-
parasite = Movies(name="Parasite", runtime=132)
33+
parasite = Movies(title="Parasite", runtime=132)
3434
parasite.save()
3535

36-
This code inserts a movie with a ``name`` value of ``"Parasite"`` into
36+
This code inserts a movie with a ``title`` value of ``"Parasite"`` into
3737
the ``sample_mflix`` MongoDB database.

0 commit comments

Comments
 (0)