Professional Documents
Culture Documents
Practical: 3: AIM: Design A Django Project For "Email Sender"
Practical: 3: AIM: Design A Django Project For "Email Sender"
PRN : 1941059
CLASS : TY COMP
BATCH : T4
THEORY
INTRODUCTION:
When you register on some websites, you get a mail from that company or institution? The
email would be, verification email or welcome email, account creation successful email or
thanks-regard email, etc. Let’s, illustration a Django project to send emails.
A New Folder with the name projectName will be created. To enter in the project using the
terminal enter command
cd EmailProject
Now let’s run the server and see everything is working fine or not. To run the server, type
the below command in the terminal.
CREATING APP
Till now we have created the Django project and now we will create an app. Django is
famous for its unique and fully managed app structure. To create an app we need to go to
the directory containing manage.py and run the following command –
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'subscriber',
]
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'waykarshubham2025@gmail.com'
EMAIL_HOST_PASSWORD = 'password_here'
➢ Urls.py:
Create an urls.py in your app
urlpatterns = [
path("", myfun, name="home"),
➢ Views.py:
Create views.py in your app
➢ urls.py:
Now add your apps urls in the project
urlpatterns = [
path('admin/', admin.site.urls),
path("", include("subscribe.urls"))
You can send emails now. But if you are using Gmail, then the first time you make these
changes in your project and run, you might get SMTP error.
To correct that-
1-Go to the Google account registered with the sender’s mail address and select Manage
your account
2-Go to security section at the left nav and scroll down. In Less secure app access, turn on
the access. By default, it would be turned off.
OUTPUT:
Sender Gmail:
Receiver Gmail:
CONCLUSION:
Hence, in this practical we learnt to make email sender project in django
Sign of Teacher