After the configuration of Django, there is basic poll application that is explained in the official Documentation. Activate the project and run it!
In a separate window start the poll app:
Then, write vim to start :NERDTree. Type the message into the views.py
Create a polls/urls.py file with ‘m’ and ‘a’ inside NERDTree
To link them with the main site, by typing the code in urls.py in your side
To check your changes in the local server 127.0.0.1/polls, see your browser
Now we are going to create a question and choice classes into models.py
Let’s add polls apps into the mysite/settings.py
After this change, it is important to do the migration
In order to have data into the polls, lets migrate tables from sql
To refresh the changes, let’s migrate again to refresh the database
Now, we will code with the python shell to show the objects we created
To import the library of datetime and make compatible python 2 and 3:
Save these changes and start a new Python interactive shell by running
python manage.py shell
again. This time we are going to check q1 and q2:
In this case we have a problem with q2 since it was not declared as q1 was