Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

lOMoARcPSD|23579794

Internship Report-HET

Bachelor of engineering (Gujarat Technological University)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Belayneh Abirham (2749belay@gmail.com)
lOMoARcPSD|23579794

INTERNSHIP REPORT

ON

Web development using


Python (Django framework)
Report

BACHELOR OF ENGINEERING

IN

COMPUTER ENGINEERING

GUJARAT TECHNOLOGICAL UNIVERSITY

Submitted by:

Het Patel

(191040107039)

GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE

Mehsana, Gujarat-384002.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

DECLARATION

I, Het Patel, hereby declare that the work presented in the internship report has been

carried out by me after the completion of 2 weeks internship at InfoLabz. 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.

Het Patel
191040107039

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

ACKNOWLEDGEMENT

The internship opportunity I had with InfoLabz 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 InfoLabz 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.

Sincerely.

MR. CHINTAN NAGRECHA

(DIRECTOR, INFOLABZ IT SERVICES PVT LTD)

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

ABSTRACT

This report is describing the work I completed as a Computer Engineering intern at InfoLabz
during June-July of 2022. 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 InfoLabz 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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

JOINING LETTER

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

COMPLETION CERTIFICATE

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

TABLE OF CONTENT

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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................................................................................................................................ 9
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

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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 labeling 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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

 IDE SETUP FOR PYTHON (PYCHARM):


During this internship we use PyCharm IDE for our Django project.
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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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):

(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

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

 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: admin@example.com

Password:

Password (again):

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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:

 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

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

 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.

 Create tables in django:


o Create models in your app.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

o Apply foreign key to the table.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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

o Create the view for the app.

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

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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).

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

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

 Make creative cards:

o Make the card using the bootstrap

o Use the for loop for creating the more cards.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

 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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

o Create a html page inside the templates directory.

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

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

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

Downloaded by Belayneh Abirham (2749belay@gmail.com)


lOMoARcPSD|23579794

 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.

Downloaded by Belayneh Abirham (2749belay@gmail.com)

You might also like