0% found this document useful (0 votes)
25 views

Django Internship Report

Django internship report
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Django Internship Report

Django internship report
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

lOMoAR cPSD| 32763705

INTERNSHIP REPORT
ON

Web development using


Python (Django framework)
Report

BACHELOR OF ENGINEERING

IN

Electronics and communication engineering


GUJARAT TECHNOLOGICAL UNIVERSITY

Submitted by:

Khyati Tripathi (210130111520)

Internal Guide : Prof . Nisarg Bhatt

1
lOMoAR cPSD| 32763705

DECLARATION

I Khyati Tripathi hereby declare that the work presented in the internship report has been

carried out by me after the completion of 2 weeks internship at Shreenath developers. I also

confirm that the report is only prepared for my academic requirement, not for any other

purpose. It might not be used with interest of opposite party of corporation.

Khyati Tripathi
210130111520
lOMoAR cPSD| 32763705

ACKNOWLEDGEMENT

The internship opportunity I had with Shreenath developers was a great chance for learning
and professional development. Therefore. I consider myself as a very lucky individual as I
was provided with an opportunity to be a part of it. I am also grateful for having a chance to
meet so many wonderful people and professionals who led me though this internship period.
Bearing in mind previous I am using this opportunity to express my deepest gratitude and
special thanks to the Mentor of Shreenath developers who in spite of being extraordinarily
busy with his duties, took time out to hear, guide and keep me on the correct path and allowing
me to carry out my project at their esteemed organization and extending during the training.
I will strive to use gained skills and knowledge in the best possible way, and I will continue
to work on their improvement, in order to attain desired career objectives. Hope to continue
cooperation with all of you in the future.

3
lOMoAR cPSD| 32763705

ABSTRACT

This report is describing the work I completed as a Electronics and communication


Engineering intern at Shreenath Developers during June-July of 2023. It provides an overview
of the company; an overview of my role and the projects I worked on at the company.

The report presents the project completed during internship at Shreenath developers .Which is
“Real time API integration in web pages using Django framework”.

This project has been completed successfully and result was according to expectations.
And all the Circuits are tested and working to our expectations.
lOMoAR cPSD| 32763705

COMPANY PROFILE

Established in 2016, incorporation with our parent IT company, INFOLABZ IT SERVICES PVT. LTD.
has managed to make its own position in IT Sector. We are involved in Web Development, App
Development, Progressive Web Application Development, IOT solutions, Graphics & Designing, Digital
Marketing, Domain & Hosting services, SMS services etc.

In the span of six years, we have managed to deliver all projects on time with utmost accuracy to our
clients across the globe. We have dedicated teams of experienced and hardworking developers. Our
developers who are always willing to take new challenges and looking forward to learn new things, are
heart of this company.

Our objective is to sustain with exponential growth in IT industry. Our mission is to deliver the best with
top notch quality every quarter and vision is to develop a product with one of its kind concepts which
could be used by millions of people.

5
lOMoAR cPSD| 32763705

JOINING LETTER
lOMoAR cPSD| 32763705

COMPLETION CERTIFICATE

7
lOMoAR cPSD| 32763705

TABLE OF CONTENT
1. Declaration..........................................................................................................................2
2. Acknowledgement..............................................................................................................3
3. Abstract...............................................................................................................................4
4. Company Profile..................................................................................................................5
5. Joining Letter ......................................................................................................................6
6. Completion Certificate .7
7. Table of Content..................................................................................................................8
8. Week 1……………………………………………………………………………………
8.1 Getting Started with Python …………………………………………………………….9
8.2 Create a first project in Django ………………………………………………… …….12
8.3 Create a new app in Django Project …………………………………………………..16
8.4 Django Migrations …………………………………………………………………….17
9. Week 2 ………………………………………………………………………………….20
9.1 Create One Web Page Index.Html in App and Set as Default Page ......................20
9.2 Make Creative Cards ……………………………………………………………23
9.3 Creating A News Blog Application Using Live API …………………………25

10. Conclusion …………………………………………………………………………….26


lOMoAR cPSD| 32763705

WEEK 1:
GETTING STARTED WITH PYTHON
o Download Python on the machine:
From the python.org download the python language.

o Installation Process:
1. Double-click the icon labelling the file python-3.9.6-amd64.exe.
A Python 3.9.6 (64-bit) Setup pop-up window will appear.

2. Highlight the Install Now (or Upgrade Now) message, and then click it.
When run, a User Account Control pop-up window may appear on your screen. I
could not capture its image, but it asks, do you want to allow this app to make
changes to your device.
3. Click the Yes button.
A new Python 3.9.6 (64-bit) Setup pop-up window will appear with a Setup Progress
message and a progress bar.
During installation, it will show the various components it is installing and move
the progress bar towards completion. Soon, a new Python 3.9.6 (64-bit) Setup
pop-up window will appear with a Setup was successfully message.

9
lOMoAR cPSD| 32763705

4. Click the Close button.


Python should now be installed.

o Verifying:
Double-click the icon/file python.exe.
The following pop-up window will appear.

• IDE SETUP FOR PYTHON (PYCHARM):


During this internship we use PyCharm IDE for our Django project.
lOMoAR cPSD| 32763705

o Download PyCharm on the machine:


From the www.jetbrains.com download the python language.

o Installation Process:
1. Now, begin the installation procedure similar to any other software package.

11
lOMoAR cPSD| 32763705

2. Once the installation is successful, PyCharm asks you to import settings of the
existing package if any.

• CREATE FIRST PROJECT ON DJANGO:


o Create a new project:
Open the IDE and create a normal project by selecting File -> New Project. Here names
the project by any name.
lOMoAR cPSD| 32763705

o Install Django:
(venv) C:\Users\HetPatel\PycharmProjects\DjangoWork>python -m pip install django

Collecting django Using cached Django-3.2.3-py3-none-any.whl (7.9 MB)

Collecting asgiref<4,>=3.3.2 Using cached asgiref-3.3.4-py3-none-any.whl

(22 kB)

Collecting sqlparse>=0.2.2 Using cached sqlparse-0.4.1-py3-none-any.whl

(42 kB)

Collecting pytz Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB)

Collecting typing-extensions

Using cached typing_extensions-3.10.0.0-py3-none-any.whl (26 kB)

Installing collected packages: typing-extensions, sqlparse, pytz, asgiref, django

Successfully installed asgiref-3.3.4 django-3.2.3 pytz-2021.1 sqlparse-0.4.1 typing-


extensions-3.10.0.0

o Check Installed Django version:


(venv) C:\Users\HetPatel\PycharmProjects\DjangoWork>python -m django –version

3.2.3
o Install mysqlclient(optional):

13
lOMoAR cPSD| 32763705

(venv) C:\Users\HetPatel\PycharmProjects\DjangoWork>pip install mysqlclient

Collecting mysqlclient Downloading mysqlclient-2.0.3-cp37-cp37m-win_amd64.whl (178

kB)

|████████████████████████████████| 178 kB 467 kB/s

Installing collected packages: mysqlclient

Successfully installed mysqlclient


o Once Installed, verify the installed modules by selecting File -> Settings -> Project
Interpreter.

o Create Django Project:


(venv) C:\Users\HetPatel\PycharmProjects\DjangoWork>django-admin startproject FirstDjango .

o Once created, you should be able to see below folder structure with default files inside it.
lOMoAR cPSD| 32763705

o Run Default Django web server:


(venv) C:\Users\ HetPatel\PycharmProjects\DjangoProject>python manage.py runserver

Watching for file changes with StatReloader Performing system checks...

System check identified no issues (0 silenced).

You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth,

contenttypes, sessions. Run 'python manage.py migrate' to apply them.

May 27, 2021 - 22:01:52

Django version 3.2.3, using settings 'FirstDjango.settings'

Starting development server at http://127.0.0.1:8000/

Quit the server with CTRL-BREAK.


o If everything goes well, hit the above highlighted URL which will redirect you to below
Django Home page.

15
lOMoAR cPSD| 32763705

• CREATE NEW APP IN DJANGO PROJECT:


o I will name my app members.
o Start by navigating to the selected location where you want to store the app, and run the
command below.
o If the server is still running, and you are not able to write commands, press [CTRL]
[BREAK] to stop the server and you should be back in the virtual environment.
Python manage.py startapp members
• CREATE SUPERUSERS OR ADMIN PANAL IN DJANGO PROJECT:
o First, we’ll need to create a user who can login to the admin site. Run the following
command:
Python manage.py createsuperuser

Username: admin Email address:

[email protected] Password:

Password (again):
Superuser created successfully.
o Start the development server:
Python manage.py runserver
o Now, open a Web browser and go to “/admin/” on your local domain – e.g.,
http://127.0.0.1:8000/admin/. You should see the admin’s login screen:
lOMoAR cPSD| 32763705

• DJANGO MIGRATIONS:
Migration is a way of applying changes that we have made to a model, into the database schema.
Django creates a migration file inside the migration folder for each model to create the table
schema, and each table is mapped to the model of which migration is created.

Django provides the various commands that are used to perform migration related tasks. After
creating a model, we can use these commands.

o makemigrations: It is used to create a migration file that contains code for the tabled
schema of a model.
o migrate: It creates table according to the schema defined in the migration file. o
sqlmigrate: It is used to show a raw SQL query of the applied migration. o
showmigrations: It lists out all the migrations and their status.

o Model (model.py):

from django.db import models


class Employee(models.Model):
eid = models.CharField(max_length=20) ename =
models.CharField(max_length=100) econtact =
models.CharField(max_length=15)
class Meta: db_table =
"employee"

To create a migration for this model, use the following command. It will create a migration file
inside the migration folder.
Python manage.py makemigrations

17
lOMoAR cPSD| 32763705

VIEWING TABLES IN DB BROWSER:


DB Browser for SQLite (DB4S) is a high quality, visual, open-source tool to create, design, and
edit database files compatible with SQLite.

DB4S is for users and developers who want to create, search, and edit databases. DB4S uses a
familiar spreadsheet-like interface, so complicated SQL commands do not have to be learned.

• Controls and wizards are available for users to:

o Create and compact database files o Create, define,


modify and delete tables o Create, define, and delete
indexes o Browse, edit, add, and delete records o Search
records
o Import and export records as text o Import and export
tables from/to CSV files o Import and export databases
from/to SQL dump files o Issue SQL queries and inspect
the results
o Examine a log of all SQL commands issued by the
application o Plot simple graphs based on table or query
data

• After making migrations we are able to see the Django project’s default tables which is on the
default dbsqlite3 file provided by the project.
lOMoAR cPSD| 32763705

• Create tables in django:


o Create models in your app.

o Apply foreign key to the table.

19
lOMoAR cPSD| 32763705

WEEK 2:

• CREATE ONE WEB PAGE INDEX.HTML IN APP AND SET AS DEFAULT PAGE:
o Create the directory named templates in the app. o Create the one html file in this directory
named index.html
lOMoAR cPSD| 32763705

o Create the view for the app.

o Add the URL to the project in the urls.py file.

o Add the path to the app in the urls.py file.

o Run the server.

• INSTALL REQUEST PACKAGE AND FETCH THE DATA FROM THE API:

o The requests module allows you to send HTTP requests using Python.
o The HTTP request returns a Response Object with all the response data (content, encoding,
status, etc).

21
lOMoAR cPSD| 32763705

Method Description

GET method is used to retrieve information from the given server using a given
GET
URI.

POST request method requests that a web server accepts the data enclosed in the
POST
body of the request message, most likely for storing it

The PUT method requests that the enclosed entity be stored under the supplied
URI. If the URI refers to an already existing resource, it is modified and if the URI
PUT
does not point to an existing resource, then the server can create the resource with
that URI.

DELETE The DELETE method deletes the specified resource

The HEAD method asks for a response identical to that of a GET request, but
HEAD
without the response body.

It is used for modify capabilities. The PATCH request only needs to contain the
PATCH
changes to the resource, not the complete resource

o Install the request.

o Make a request to a web page, and print the response text.


When one makes a request to a URI, it returns a response. This Response object in terms of
python is returned by requests.method(), method being – get, post, put, etc. Response is a
powerful object with lots of functions and attributes that assist in normalizing data or creating
ideal portions of code.
lOMoAR cPSD| 32763705

• Make creative cards:

o Make the card using the bootstrap

o Use the for loop for creating the more


cards.

23
lOMoAR cPSD| 32763705
lOMoAR cPSD| 32763705

• CREATING A NEWS BLOG APPLICATION UISNG LIVE API: o Add the URL to the project
in the urls.py file.

o Then add the path to the app in the urls.py file.

o Create views to the app.

o Create a html page inside the templates directory.

25
lOMoAR cPSD| 32763705

o Now we have to run the server to see the output:


lOMoAR cPSD| 32763705

27
lOMoAR cPSD| 32763705

• CONCLUSION:

In a nutshell, this internship has been an excellent and rewarding experience. I can conclude that
there has been a lot I’ve learned from my work at InfoLabz. The technical aspects of my work
are not flawless and could be improved provided enough time. As someone with no prior
experience with Node.js whatsoever, I believe my time spent in research and discovering it was
well worth it and contributed to finding an acceptable solution to build a fully functional web
service. Two main things that I’ve learned the importance of are time-management skills and
self-motivation.

You might also like