Professional Documents
Culture Documents
A Project report submitted in partial fulfillment of the requirement for the award of the
Degree of
Vaishnavi. B
M.C.A, M.Phil., M.B.A., Ph.D
Affiliated to the University of Madras & Reaccredited ‘A+’ Grade by NAAC Ranked No. 1 in
Tamil Nadu & 18th in India among Top Non-Autonomous Colleges by Education World
Awarded 4 star Rating with Mentor Status, Ministry of Education, Government of India.
Railway Station, 3,Canal Bank Road, Gandhi Nagar, Behind Kotturpuram, Adyar, Chennai,
Tamil Nadu 600020.
MARCH 2024
PATRICIAN COLLEGE OF ARTS AND SCIENCE
Railway Station, 3,Canal Bank Road, Gandhi Nagar, Behind Kotturpuram, Adyar, Chennai,
Tamil Nadu 600020.
CERTIFICATE
This is to Certify that the project work entitled “Online Weather Detector Website” is the
bonafide record of the project work done by Hariharan VK (Reg.no.212104339),
Harishkumar JP (Reg.no.212104340), Irfan J (Reg.No.212104341) in partial fulfillment of
the Requirement for the award of the Degree of Bachelor of Computer Applications during
the academic year 2021-2024.
Examiners:
ACKNOWLEDGEMENT
1
Above all I would thank God for the blessings and my parents also for their valuable
suggestion and support in my project Report. I extend my deep sense of gratitude to all those
who made this project come alive and encouraged and guided me from the start to finish.
I would like to acknowledge the interest and the support extended by our project guide
Vaishnavi, Associate Professor of Computer Applications,M.C.A, M.Phil., M.B.A.,
Ph.D,to make this project implementation successful.
I also thank my Team Members for their constant support and suggestions for this
project (Hariharan VK and Irfan J).
2
S.NO CONTENT PAGE
NO
ABSTRACT
1 INTRODUCTION
• PURPOSE
• SCOPE
• OBJECT
2 SYSTEM OVERVIEW
• ARCHITECTURE
• COMPONENTS
3 FEATURES
• REAL-TIME WEATHER UPDATES
• LOCATION-BASED WEATHER FORECAST
• USER AUTHENTICATION
• SEARCH FUNCTIONALITY
4 TECHNOLOGIES USED
• FRONTEND
• BACKEND
• DATABASE
5 SYSTEM REQUIREMENTS
• HARDWARE REQUIREMENTS
• SOFTWARE REQUIREMENTS
7 USAGE
• USER REGISTRATION
• WEATHER DATA RETRIEVAL
• LOCATION-BASED FORCAST
8 TESTING
• UNIT TESTING
• INTEGRATION TESTING
• FUNCTIONAL TESTING
• REGRESSION TESTING
• PERFORMANCE TESTING
3
• LOAD TESTING
• SECURITY TESTING
• USABILITY TESTING
• COMPATIBILITY TESTING
9 CODING
FRONTEND
BACKEND
11 CONCLUSION
12 REFERENCES
4
ABSTRACT
The online weather detector website is a comprehensive solution designed to provide users
with real-time weather updates and forecasts. Leveraging a clientserver architecture, the
system offers a user-friendly interface built with HTML, CSS on the frontend, Django handles
serverside logic. Sqllite3 is employed as the database to store user data and preferences.
Key features include real-time weather updates, location-based forecasts, user
authentication, and search functionality. The system's modular design facilitates easy
installation and setup, ensuring accessibility for users. Through unit testing, integration
testing, and user acceptance testing, the website is rigorously validated for reliability and
performance. With future enhancements like mobile responsiveness and integration with
additional weather APIs, the online weather detector website continues to evolve as a
dependable platform for accessing accurate weather information.
With future enhancements like mobile responsiveness and integration with additional
weather APIs, the online weather detector website continues to evolve as a dependable
platform for accessing accurate weather information.
INTRODUCTION
The online weather detector website is a pioneering endeavor aimed at revolutionizing the
way individuals interact with and access weather information in the digital era. With the
omnipresence of the internet and the ever-growing demand for real-time data, this project
serves as a beacon of innovation, offering users a centralized platform to obtain accurate
and up-to-the-minute weather updates. This website seeks to address the inherent
challenges of accessing reliable weather forecasts by providing a user-friendly interface,
robust backend infrastructure, and seamless integration with modern web technologies.
Through this introduction, we embark on a journey to explore the essence of this
groundbreaking project, delving into its purpose, scope, and objectives, and highlighting its
potential to redefine the landscape of weather information dissemination. Join us as we
unveil a transformative tool designed to empower individuals with the knowledge they need
to make informed decisions in the face of ever-changing weather conditions.
1. Purpose:
The purpose of the online weather detector website is to offer users a convenient and
accessible platform for obtaining accurate and real-time weather updates. In an
increasingly digital world, where timely information is crucial, this website aims to bridge
the gap between users and reliable weather data. By consolidating information from
trusted sources and presenting it in a user-friendly interface, the website seeks to
5
empower individuals with the knowledge they need to plan their activities, make informed
decisions, and stay safe in varying weather conditions. Ultimately, the purpose of this
project is to enhance the overall user experience and streamline the process of
accessing weather information in today's fast-paced world.
2. Scope:
The scope of the online weather detector website encompasses providing users with a
comprehensive platform for accessing real-time weather updates and forecasts. This
includes features such as current weather conditions, locationbased forecasts, user
authentication, and search functionality. The website aims to cater to a wide range of
users, from weather enthusiasts to professionals who rely on accurate weather data for
their daily activities. While the primary focus is on delivering essential weather
information, the website also prioritizes user experience by ensuring ease of navigation,
responsiveness, and security. Additionally, the scope extends to the implementation of a
scalable and adaptable architecture to accommodate future enhancements and
technological advancements.
System Overview
6
The online weather detector website operates on a client-server architecture, with distinct
frontend and backend components. On the frontend, the website utilizes HTML, CSS, to
create an intuitive user interface that interacts seamlessly with users. Meanwhile, the
backend, built upon django, handles server-side operations, including user requests, data
retrieval from external APIs, and processing. A sqllite3 database is employed to store user
data and preferences, ensuring efficient data management. Through this architecture, the
website delivers real-time weather updates and forecasts to users while maintaining
scalability and reliability. Overall, the system overview highlights a cohesive approach to
providing users with a seamless experience in accessing weather information.
1. Architecture
The architecture of the online weather detector website revolves around a client-server
model, meticulously designed to ensure efficient data flow and seamless user
experience. At the forefront, the frontend components, comprising HTML, CSS, and
facilitate the creation of an intuitive and visually appealing user interface. This interface
interacts directly with users, providing them with access to various features and
functionalities. On the backend, django forms the backbone of the server-side operations,
handling user requests, data processing, and interaction with external APIs to fetch real-
time weather data. The sqllite3 database serves as the repository for user information
and preferences, ensuring data persistence and scalability. Through this architectural
framework, the website delivers timely and accurate weather updates while maintaining
flexibility and adaptability to future enhancements and technological advancements.
2. Components:
Frontend: Responsible for the user interface, developed using HTML, CSS, and
7
Features
The online weather detector website boasts a multitude of features designed to provide users
with comprehensive access to weather information. Primarily, it offers real-time updates on
weather conditions, including temperature, humidity, and wind speed, sourced from reliable
APIs. Additionally, the website provides location-based forecasts, enabling users to retrieve
weather predictions tailored to specific geographic regions. User authentication functionality
ensures secure access to personalized weather data, allowing users to customize their
experience. Furthermore, a sophisticated search feature allows users to quickly find weather
information for desired locations, enhancing usability. Overall, these features collectively
empower users with the knowledge they need to make informed decisions and stay abreast
of changing weather patterns.
8
delivering forecasts customized to user’s geographical preferences, the website
enhances the relevance and applicability of the weather information provided,
empowering users to plan their activities with greater precision and foresight.
3. User Authentication:
User authentication is a crucial aspect of the online weather detector website, ensuring
secure access to personalized weather information. Through a robust authentication
system, users can register for an account and log in securely, safeguarding their data
and preferences. Upon registration, users provide necessary details, which are securely
stored in the database. Subsequently, during the login process, users authenticate
themselves using their credentials, such as username and password. This authentication
mechanism ensures that only authorized users can access their personalized weather
updates and utilize the website's features. By prioritizing user security, the website
fosters trust and confidence among its users, enhancing their overall experience and
satisfaction with the platform.
4. Search Functionality:
The online weather detector website offers users a versatile search functionality, allowing
them to quickly find weather information for specific locations of interest. Through an
intuitive search feature, users can input location names or coordinates, enabling the
website to retrieve relevant weather data efficiently. This functionality empowers users to
access weather updates for diverse geographic regions, whether it be their current
location or a destination they plan to visit. By streamlining the process of accessing
weather information, the search feature enhances user experience and utility, ensuring
that users can obtain the data they need with ease and convenience.
Technologies Used
The online weather detector website leverages a suite of cutting-edge technologies to deliver
a robust and efficient platform for accessing weather information. At the forefront, the
frontend is developed using HTML, CSS enabling the creation of a responsive and visually
appealing user interface. This interface is further enhanced by the implementation of the
Bootstrap framework, ensuring compatibility and consistency across various devices and
screen sizes. On the backend, the website utilizes Node.js in conjunction with the Express.js
framework to handle server-side logic and facilitate seamless communication between the
client and server. Additionally, MongoDB serves as the database solution, providing efficient
storage and retrieval of user data and preferences. Together, these technologies form a
9
powerful stack that enables the website to deliver real-time weather updates and forecasts
while ensuring scalability, reliability, and performance.
1. Frontend:
The frontend of the online weather detector website is meticulously crafted to deliver an
intuitive and visually appealing user experience. Built with HTML, CSS the frontend
components form the foundation of the website's user interface. Through a combination
of well-structured markup, styling, and interactivity, the frontend seamlessly integrates
various features and functionalities, ensuring accessibility across different devices and
screen sizes. Leveraging modern web technologies and frameworks like Bootstrap, the
frontend provides a responsive and engaging interface that adapts to the needs and
preferences of users. With a focus on usability and aesthetics, the frontend enhances
user engagement and satisfaction, facilitating seamless interaction with the website's
weather data and features.
• HTML :
HTML (Hypertext Markup Language) is the standard markup language used to create
web pages. It provides the basic structure and content for websites through a system of
tags and attributes. HTML documents are interpreted by web browsers to display text,
images, multimedia, and interactive elements. It's the foundation of web development,
working in conjunction with CSS for styling and JavaScript for interactivity.
• CSS:
CSS (Cascading Style Sheets) is a style sheet language used to define the visual
presentation of HTML and XML documents. It controls the layout, design, and formatting
of web pages, enabling developers to create visually appealing and consistent user
interfaces. CSS promotes separation of concerns by separating the content from its
presentation, enhancing maintainability and reusability of code. It includes selectors to
target specific elements, units for specifying measurements, and features like media
queries for creating responsive designs. Overall, CSS is essential for creating attractive
and functional websites.
2. Backend:
Backend development involves managing the server-side aspects of web applications. It
encompasses the logic, data processing, and storage components that power the
functionality of websites and web services. Backend developers use programming
languages like Python, Java, Ruby, PHP, and Node.js to create the underlying
functionality of applications. They work with databases to store and manage data, design
APIs to facilitate communication between different software systems, and implement
authentication and authorization systems to ensure data security. Additionally, backend
developers configure web servers, deploy applications, and optimize performance for
scalability and reliability. Overall, backend development is crucial for building robust,
scalable, and secure web applications that provide dynamic and data-driven experiences
to users.
10
Django: Django is a high-level Python web framework that encourages rapid
development and clean, pragmatic design. It follows the model-view-template (MVT)
architectural pattern, which is similar to the model-view-controller (MVC) pattern used
in many other web frameworks.
2. **View**: Views in Django are Python functions or classes that receive web requests and
return web responses. They contain the business logic of your application.
3. **Template**: Templates are HTML files with embedded Python-like code. They are used
to generate dynamic HTML content that is sent to the client's web browser.
4. **URL Dispatcher**: This component maps URLs to the appropriate views in your
application.
Django comes with many built-in features for common web development tasks, including
user authentication, URL routing, form handling, database migrations, and more. It also
follows the DRY (Don't Repeat Yourself) principle, which encourages code reuse and
reduces redundancy.
Django's popularity stems from its robustness, scalability, and extensive documentation. It's
widely used in the industry for building various types of web applications, from simple blogs
to complex enterprise-level systems.
Python:.
Python is a high-level, interpreted programming language known for its simplicity and
readability. It was created by Guido van Rossum and first released in 1991. Python
emphasizes code readability and clean syntax, making it an excellent choice for beginners
and experienced developers alike.
1. **Easy to Learn and Read**: Python's syntax is designed to be intuitive and easy to
understand, making it accessible for beginners. It uses indentation to define code blocks,
which encourages clean and consistent code formatting.
11
3. **High-Level**: Python abstracts away low-level details like memory management and
allows developers to focus on solving problems at a higher level of abstraction.
4. **Dynamic Typing**: Python is dynamically typed, meaning that variable types are inferred
at runtime. This makes Python flexible and allows for rapid development, but it can also lead
to potential runtime errors if not handled carefully.
5. **Strong Typing**: Despite being dynamically typed, Python is also strongly typed,
meaning that variables have a specific type that cannot be changed implicitly.
7. **Extensive Standard Library**: Python comes with a comprehensive standard library that
provides modules and packages for a wide range of tasks, from file I/O and networking to
web development and data processing.
8. **Community and Ecosystem**: Python has a large and active community of developers
who contribute to libraries, frameworks, and tools that extend its capabilities. The Python
Package Index (PyPI) hosts thousands of third-party packages that can be easily installed
and used in Python projects.
10. **Used in Various Fields**: Python is used in a variety of domains, including web
development, data science, machine learning, artificial intelligence, automation, scientific
computing, and more.
Overall, Python's simplicity, versatility, and robust ecosystem make it a popular choice for a
wide range of programming tasks.
4. DATABASE:
The database for a weather detector website serves as the central repository for storing,
managing, and retrieving weather-related data. It stores various types of data including
12
current weather conditions, forecasts, historical records, and user preferences. The
database is integrated with the website's server to facilitate data retrieval and updates
based on user requests. It is designed with appropriate schema and tables to efficiently
store and organize weather data. Additionally, the database implements security
measures to protect sensitive information and scalability features to accommodate
increasing user traffic. Overall, the database plays a critical role in ensuring users receive
accurate and timely weather information on the website.
SYSTEM REQUIREMENTS
The system requirements for an online weather detector website encompass various
components to ensure its functionality, security, and scalability. At the core is the need for a
reliable web server capable of handling HTTP and HTTPS protocols, alongside a server-side
scripting language like PHP or Python to process weather data. This processing relies on a
robust database system such as MySQL or MongoDB for storing weather information and
user preferences. Integration with weather APIs is crucial for accessing real-time data.
Frontend technologies like HTML, CSS, and JavaScript are used to design the user
interface, while security measures such as SSL/TLS encryption and secure authentication
mechanisms protect user data. Scalability features are essential to accommodate increasing
traffic, and monitoring tools help track system performance. Backup and recovery
mechanisms safeguard against data loss, while compliance with regulations ensures
adherence to industry standards. Overall, these system requirements form the foundation of
an effective and reliable online weather detector website.
1. Hardware Requirements:
The hardware requirements for an online weather detector website can vary based on
factors such as the expected traffic volume, the complexity of the website, and the scale
of data processing required. Here's a general outline of hardware requirements are:
Processor: Choose a server with a multi-core processor to handle concurrent requests
efficiently. A processor with multiple cores can execute multiple tasks simultaneously,
improving the website's responsiveness and performance.
• Memory (RAM): Allocate sufficient RAM to the server to ensure smooth operation and
fast data retrieval. The amount of RAM required depends on factors such as the size of
the database, the complexity of data processing algorithms, and the number of
concurrent users accessing the website.
• Storage: Ensure the server has ample storage space to store website files, databases,
and other resources. Consider using solid-state drives (SSDs) for faster data access and
improved performance compared to traditional hard disk drives (HDDs).
13
• Network Bandwidth: Choose a hosting provider or network infrastructure capable of
providing sufficient bandwidth to handle incoming and outgoing traffic to the website.
Higher bandwidth ensures faster data transfer speeds and better user experience.
• Scalability: Choose hardware that allows for easy scalability as the website grows. This
may involve using cloud-based infrastructure or deploying additional servers to handle
increased traffic and data processing requirements.
2. Software Requirements:
The software requirements for an online weather detector
website are critical for its development, deployment, and
ongoing operation. Here's a comprehensive list of software
components needed:
• Operating System: Choose a reliable operating system (OS) to host the website.
Common choices include Linux distributions like Ubuntu, CentOS,
or Debian, which are well-suited for web server environments. Alternatively, Windows
Server can be used if you're more familiar with Microsoft technologies.
• Web Server Software: Install and configure a web server software to serve the
website to users. Apache HTTP Server and Nginx are popular choices for hosting
dynamic websites. Both support HTTP and HTTPS protocols and offer robust
performance and security features.
• Database Management System (DBMS): Install a DBMS to store weather data, user
preferences, and other relevant information. MySQL, PostgreSQL,
14
MongoDB, or SQLite are commonly used for web applications. Choose a DBMS
based on your data storage and retrieval needs, scalability requirements, and
familiarity with the technology.
• Weather APIs: Integrate with one or more weather APIs to fetch real-time weather
data. Choose APIs that provide accurate and reliable weather information for your
target locations. Examples include Open Weather Map, Weather stack, and Dark Sky
API.
• Frontend Technologies: Use frontend technologies to create the user interface and
display weather information to users. HTML, CSS are fundamental for building the
website's layout, styling, and interactivity. Consider using frontend frameworks and
libraries like React, Vue.js, or Angular for building interactive and responsive UI
components.
• Security Software: Implement security measures to protect the website and user
data. This includes using SSL/TLS certificates for encrypting data transmitted over
the network, implementing secure authentication mechanisms, and regularly updating
software components to patch security vulnerabilities.
• Monitoring and Analytics Tools: Set up monitoring and analytics tools to track
website performance, user interactions, and traffic patterns. Tools like Google
Analytics, New Relic, or Prometheus can provide insights into website usage,
performance metrics, and user behavior.
• Backup and Version Control: Implement backup mechanisms to prevent data loss
in case of system failures or disasters. Additionally, use version control systems like
Git to manage code changes, collaborate with team members, and track revisions to
the website codebase.
15
Installation and Setup
Setting up an online weather detector website involves several crucial steps to ensure its
functionality, reliability, and performance. Firstly, selecting a suitable hosting provider is
essential to accommodate the website's traffic volume and data processing requirements.
Once the server environment is set up, including the installation of the operating system, web
server software, and database management system, integration with weather APIs becomes
paramount. This entails obtaining API access, implementing server-side code to fetch and
store weather data, and configuring the website to display this information to users.
Concurrently, developing the user interface with HTML, CSS, enables the creation of an
intuitive and visually appealing frontend. Security measures, such as SSL/TLS encryption
and secure authentication mechanisms, safeguard user data and website integrity.
Monitoring and analytics tools are then set up to track website performance and user
interactions, enabling proactive management and optimization. Through rigorous testing,
deployment, and ongoing maintenance, the website is continuously refined to ensure optimal
functionality, security, and user experience.
1. Frontend Setup:
Setting up the frontend for an online weather detector
website involves designing and implementing the user
interface to display weather information to users. Here's a
step-by-step guide to setting up the frontend:
16
Consider using frontend frameworks or libraries like
Bootstrap, Foundation, or Materialize to streamline
development and ensure a responsive design.
17
Firefox, Safari, Edge) to ensure compatibility and
responsiveness.
Use browser developer tools and online testing platforms
to identify and fix any layout or functionality issues.
2. Backend Setup:
Setting up the backend for an online weather detector
website involves implementing the server-side functionality to
fetch, process, and manage weather data. Here's a step-by-
step guide to setting up the backend:
18
Write server-side code to establish connections
to the database and perform CRUD (Create,
Read, Update, and Delete) operations on
weather data and user information.
Use database query languages (e.g., SQL for
relational databases) or ORM (Object-Relational
Mapping) libraries/frameworks to interact with
the database.
19
Use encryption techniques (e.g., SSL/TLS) to
secure data transmission between the server
and clients.
20
Continuously monitor and optimize the backend
infrastructure to ensure reliability, scalability, and
optimal performance.
3. Database Setup:
Setting up the database for an online weather detector
website involves designing and implementing the database
schema, setting up the database management system
(DBMS), and integrating it with the backend server. Here's a
step-by-step guide to setting up the database:
21
• Implement Database Integration:
Write server-side code to establish connections to the
database from your backend server.
Implement CRUD (Create, Read, Update, Delete)
operations to interact with the database, allowing your
backend server to store and retrieve weather data and
user information.
22
Test the database functionality thoroughly to ensure that
data is stored and retrieved correctly.
Conduct unit tests and integration tests to validate CRUD
operations, data integrity constraints, and error handling
mechanisms.
4. Usage:
An online weather detector website offers users a convenient platform to access accurate
and up-to-date weather information for their location and beyond. Users typically visit the
website to check weather forecasts for the current day, upcoming days, and even long-
term projections. The website provides detailed insights into various weather parameters
such as temperature, humidity, wind speed, and country code ,latitude and longitud,
allowing users to plan their activities accordingly.. With mobile accessibility and
community features such as forums and social media integration, online weather detector
websites offer a comprehensive and user-friendly experience for individuals seeking
reliable weather information to navigate their daily lives effectively.
Testing:
In software engineering, testing is a crucial phase of the software development life cycle
(SDLC) that involves verifying and validating whether the software meets its requirements
and functions correctly. Testing ensures that the software is reliable, robust, and free
from defects before it is deployed to users. Testing helps identify and fix issues early in
the development process, thereby reducing costs and improving the overall quality of the
software.
1. **Unit Testing**: Unit testing involves testing individual units or components of the
software in isolation. It focuses on verifying that each unit of the software performs as
expected. Unit tests are usually automated and written by developers. Frameworks like
JUnit, NUnit, and XCTest are commonly used for unit testing in various programming
languages.
23
2. **Integration Testing**: Integration testing verifies the interactions between different
modules or components of the software. It ensures that integrated units work together as
expected. Integration testing can be done at different levels, such as module integration
testing, API integration testing, and system integration testing.
4. **Regression Testing**: Regression testing ensures that recent code changes have
not adversely affected the existing functionality of the software. It involves re-running
previously executed tests to check for any regression bugs introduced by new code
changes.
6. **Load Testing**: Load testing is a type of performance testing that evaluates the
software's behavior under expected load conditions. It involves simulating multiple users
or concurrent transactions to determine how the software handles the load and whether it
can scale to meet the demands of its users.
7. **Security Testing**: Security testing assesses the software's ability to protect data and
resources from unauthorized access, vulnerabilities, and attacks. It includes techniques
like penetration testing, vulnerability scanning, and security code reviews to identify and
mitigate security risks.
8. **Usability Testing**: Usability testing evaluates the software's user interface (UI) and
user experience (UX) to ensure that it is intuitive, user-friendly, and meets the needs of
its intended users. Usability testing involves real users performing tasks to identify
usability issues and areas for improvement.
These testing types are often conducted iteratively throughout the software development
process to detect defects early and ensure that the software meets its quality objectives.
Each testing type serves a specific purpose and contributes to delivering a high-quality
and reliable software product.
Coding :
Front-End:
24
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>weather</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
</head>
<body>
<nav class="row" style="background: black; color: orangered;">
<div align="center"><h1 class="col-md-3 text-center">Weather Detector</h1></div>
</nav>
<br />
<br />
<center class="row">
<form action="" method="post" class="col-md-6 col-md-offset-3">
{% csrf_token %}
<div class="input-group">
<input type="text" class="form-control" name="city" placeholder="Search">
<div class="input-group-btn">
<a href="/"></a><button class="btn btn-default" type="submit">
<i class="glyphicon glyphicon-search"></i>
</button>
</div>
<form>
</center>
<div class="row">
{% if data.country_code %}
<div class="col-md-6 col-md-offset-3">
<h1>{{city}}</h1>
<h3>country code : {{data.country_code}}</h1>
<h5>coordinate : {{data.coordinate}}</h5>
25
<h5>temp : {{data.temp}}</h5>
<h5>pressure : {{data.pressure}} </h5>
<h5>humidity : {{data.humidity}}</h5>
</div>
{% endif %}
</div>
</body>
</html>
Backend-End:
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
26
'django.contrib.messages',
'django.contrib.staticfiles',
'weather'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'weatherdetector.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR/'templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'weatherdetector.wsgi.application'
# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
27
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
STATIC_URL = 'static/'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
28
29
30
Output:
31
REFRENCES:
https://youtu.be/jBzwzrDvZ18?si=wJOjw9j26rfO5IZn
32
https://github.com/tomitokko/weather_detector
33