An application that would let you create, edit and attempt quizzes (intended for tech quizzes), along with keeping a profile. .Here’s a breakdown of the project:

Apps
The project is divided into 2 applications:
Models
The conditional probability of A given B (represented as P(A|B) ), is the probability of occurring event A given that event B has (or if ) occurred.
The Formula for calculating is P(A|B)=P(A∩B) / P(A). Let’s understand this formula with an example:
Let’s take the famous marbles in the bag example, we have 4 green and 3 red balls in the bag. What is the probability of drawing a green ball, when the first ball drawn is a red ball?
There are two events occurring in the question,
Event A: Drawing a red ball; Event B: Drawing a green ball.

…

Let’s consider a trial of flipping a coin. The sample space is S={‘Head’,’ Tail’}.
If we flip the coin once, it will be either Head or Tail, the occurrence of one event(H or T) stops or affects the occurrence of the other event, hence they are called mutually exclusive events.
The probability of mutually exclusive events in a trial can be represented mathematically as: P(H AND T)=0 OR P(H ∩ T)=0;
Since there will be no common element (intersection) in the outcomes of the trial, either H or T (not overlapping sets).
Now consider a trial of flipping two coins…
It’s now the time to add the reset password functionality. Without throwing all the URLs or imports or settings required, let me take you to step by step. We need a URL for a reset password, right?, So jump in the blog_project/urls.py and add the URL or link for the password reset, using the built-in PasswordResetView present in the auth view of django.contrib and specify the url and template name there.
...
path('password-reset/', auth_views.PasswordResetView.as_view(template_name='users/password_reset.html'),
name='password_reset'),
As we specified the template name there, let’s go create that password_reset file (where the other files login, logout exists) in the users/templates/users folder
<h1>Trouble…Moving back to our blogapp, we had defined some views as follows
def home(request):
content={'posts':Post.objects.all()}
return render(request, 'blogapp/home.html',content)
def post(request):
return HttpResponse('<h1>A detailed post..</h1>')def create(request):
return HttpResponse('<h1>Create a new post</h1>')def update(request):
return HttpResponse('<h1>Update your post..</h1>')
def delete(request):
return HttpResponse('<h1>Delete a post..</h1>')
There are many more things to do here.., implement update, delete ,create new or view detailed post.Let’s use class based views here
Class based views have many built-in functionalities,let’s use them to allow users to create,read,update or delete a post using CreateView, DetailView or ListView, UpdateView and DeleteView
Import these views in the blogapp/views.py as follows,
from…When it comes to build forms, Django Forms can be really handy.It will automate a good amount of work as well as providing a really stable and secure functionality.

Django handles three distinct parts of the work involved in forms:
The parts 1 and 3 are usually fine for the most cases. But when it comes to the actual HTML forms rendering, sometimes it lacks some options.
In our DjangoReads project I used Bootstrap…

Let’s make the images auto resize when users upload them and add a new feature for the users to update their profile info.
So first create a UserUpdateForm in users/forms.py (as we want to show it on profile page)
class UserUpdateForm(forms.ModelForm):
class Meta:
model=User
fields=['username','email']This lets our form know that we want to work with username and email fields,and i’ven’t added profile picand bio here, because the model for them is Profile so it’ll be in ProfileUpdateForm.So import the profile model and add this class
class ProfileUpdateForm(forms.ModelForm):
class Meta:
model=Profile
fields=['pic','bio']UserUpdateForm will allow us to update our username…
Credit card numbers follow certain patterns.
The very first number is the Major Industry Identifier (MII), which tells you what sort of institution issued the card.
The first six digits are the Issuer Identification Number (IIN). These can be used to look up where the card originated from.
We have been adding profiles through admin page but we don’t want such on the production, instead we want the profile to be created automatically with the default image for every user(whenever a user is created). We can do this with signals in Django.

The signals are utilities that allow us to associate events(creating profile) with actions(user is created). We can develop a function that will run when a signal(notify) calls it.
Let me give you a basic example:
models.py
from django.db import models
from django.db.models import signalsdef create_cookie(sender, instance, created, **kwargs):
print "Let's start making cookies now"class…

let’s change the navigation items for the authenticated and anonymous users,for the anonymous users the navbar will show login and register urls,whereas for authenticated users it’ll show logout url.So to do this
In base.html,
<a href="{%url 'blog-home'%}" class="nav-item">DjangoReads</a>
<a href="{%url 'about'%}" class="nav-item">About</a>
{%if user.is_authenticated%}
<a href="{%url 'profile'%}" class="nav-item">Profile</a>
<a href="{%url 'logout'%}" class="nav-item">Logout</a>
{%else%}
<a href="{%url 'register'%}" class="nav-item">Register/Login</a>{%endif%}
You can get information about the currently logged in user in templates with the {{ user }} template variable (this is added to the template context by default when you set up the project).{{ user.is_authenticated …

Posting Django Tutorials with Beginner to Advanced Projects