WeatherVue (Report Final)
WeatherVue (Report Final)
Submitted in partial fulfilment of the requirements for the award of the degree of
To GGSIPU
Submitted By:
Submitted to:
Rudra Pratap Singh Gahlot
Ms. M. Gomathy
Roll No. 05911102021
1 Acknowledgement
2 Certificate(es)
3 Synopsis
4 Chapter 1: Introduction
I would like to express my sincere gratitude to all those who contributed to the completion of
this project.Special appreciation goes to my project supervisor, Ms. M.Gomathy, for their
guidance and mentorship throughout the project. Their insights and encouragement
significantly enriched the quality of our work.I’d also like to extend my thanks to my
Director, Dr. Ravish Saggar, for granting me this wonderful opportunity to be part of this
project.My gratitude extends to all our staff members for their invaluable assistance,
guidance, and encouragement, which made this project possible.My appreciation extends to
the library staff for their vital support in accessing research materials.I’d like to express my
heartfelt gratitude to The University of Guru Gobind Singh Indraprastha University for
affording us the opportunity to collaborate on the WeatherVue.
Lastly, I want to acknowledge my family and friends for their unwavering support during the
course of this project. Their encouragement kept me motivated, and their understanding
during busy times was truly appreciated.
Thank you to everyone who played a part in making this project a success.
Rudra Pratap Singh Gahlot
CERTIFICATE
This is to certify that this project entitled “Poly Code Forge Site” submitted in partial
Guru Gobind Singh Indraprastha University done by Mr. Rudra Pratap Singh Gahlot, Roll
_____________________ under my guidance. The matter embodied in this project work has
not been submitted earlier for award of any degree to the best of my knowledge and belief.
partial fulfilment of the requirements for the award of the degree of Bachelor of Computer
project work has not been submitted earlier for award of any degree or diploma to the best of
Roll No.
WeatherVue
A Weather forecasting app Using DJANGO
INTRODUCTION
Explore Your World with Weather Wisdom. WeatherVue is an innovative and user-friendly
web application designed to enhance your travel experiences by seamlessly integrating real-
time weather data with nearby points of interest. Whether you're a seasoned traveler or
someone looking for a spontaneous adventure, WeatherVue provides you with the tools you
need to make informed decisions and create memorable journeys.
Key Features:
Real-time Weather Insights: WeatherVue offers up-to-date weather forecasts and
conditions for your current location and any destination you choose. This information
includes temperature, humidity, wind speed, and precipitation, allowing you to plan your
activities with confidence.
Points of Interest Integration: The app uses your current location and weather
data to recommend nearby points of interest that are best suited to the current
weather conditions. Whether it's a sunny day perfect for hiking, a rainy day ideal
for museum visits, or a snowy day ideal for hitting the slopes, WeatherVue has
you covered.
User Reviews and Ratings: Users can contribute their experiences by leaving
reviews and ratings for points of interest, helping others make informed choices.
Personalization Gap: Many travel apps lack the ability to tailor recommendations to
users' preferences and interests, resulting in generic suggestions that may not resonate
with individual tastes.
Navigational Challenges: While users may find appealing activities, they often face
difficulties in navigating to those locations efficiently, especially when they are
unfamiliar with the area.
Scope:
The scope of the WeatherVue app encompasses a range of features and functionalities
designed to fulfill its objective of seamless weather-integrated travel recommendations. The
app's scope includes:
Real-Time Weather Information:
o Providing accurate and up-to-date weather forecasts for the user's current
location and selected destinations.
o Displaying essential weather parameters such as temperature, humidity, wind
speed, and precipitation.
Personalized Recommendations:
o Displaying a map with weather patterns and overlaying nearby attractions for
easy visualization.
o Allowing users to explore the area, select points of interest, and view real-time
weather data.
Detailed Destination Information:
o Offering a diverse range of activity ideas that are suitable for the current
weather conditions.
o Catering to outdoor enthusiasts, cultural explorers, food enthusiasts, and
more.
Travel Planning and Itineraries:
User Interaction:
Note: The WeatherVue app's scope does not include weather forecasting itself, but it relies
on established weather data providers for accurate and timely information. The app also does
not offer booking or payment services for attractions, focusing solely on recommendations
and information dissemination.
METHODOLOGY
Collecting and presenting accurate weather data is a crucial aspect of the WeatherVue app.
To ensure that users receive up-to-date and reliable information, the app can employ a
combination of methods for data collection:
API Integration with Weather Data Providers: Integrate with reputable weather data
providers that offer APIs (Application Programming Interfaces) for accessing real-time
weather data. Examples of such providers include OpenWeatherMap, AccuWeather, The
Weather Company (IBM), and Dark Sky. These APIs offer a range of weather parameters,
forecasts, and historical data that can be seamlessly integrated into the app.
Historical Weather Data: Include historical weather data to provide users with insights
into typical weather conditions for specific times of the year. This can help users plan trips
and activities more effectively.
Machine Learning and AI: Utilize machine learning algorithms and artificial
intelligence to refine weather predictions based on historical data, real-time observations,
and other relevant factors. This can enhance the accuracy of forecasts and
recommendations.
Hardware :
Creating a web application using Django primarily involves software development, and you
won't require specific hardware components beyond a standard computer setup. However,
here's a list of hardware components that are commonly used for web development using
Django:
Computer: A desktop or laptop computer is the main hardware requirement for Django
web development. It should meet the basic requirements for running your chosen
operating system and development tools.
Processor and RAM: A computer with a decent processor (e.g., Intel Core i5 or higher)
and sufficient RAM (8GB or more) will provide a smooth development experience,
especially when running multiple software tools simultaneously.
Storage: Adequate storage space (e.g., 256GB SSD or larger) is recommended to store
your project files, development tools, databases, and other software.
Software:
To create the WeatherVue app using the Django framework, you'll need a combination of
software tools and technologies. Django is a powerful web framework for building web
applications, and it can be used to create both the backend and frontend components of your
app. Here's a list of software you'll need:
Python: Django is a Python-based framework, so you'll need to install Python on your
development machine. Visit the official Python website (https://www.python.org/) to
download and install the latest version.
Database Management System: Django supports various database systems. You can
choose from options like SQLite (for development), PostgreSQL, MySQL, or others.
Make sure you have the appropriate database system installed and running.
Version Control: Use version control software like Git to manage your project's source
code and collaborate with a team. Platforms like GitHub or GitLab provide hosting and
collaboration features.
Web Browser: You'll need a web browser to test your app's frontend. Popular choices
include Chrome, Firefox, and Safari.
Deployment Tools (For Production): When deploying your app to a production server,
you might need tools like Apache or Nginx for serving your app, as well as tools like
Gunicorn or uWSGI to interface between Django and the web server.
Explore Your World with Weather Wisdom. WeatherVue is an innovative and user-friendly
web application designed to enhance your travel experiences by seamlessly integrating real-
time weather data with nearby points of interest. Whether you're a seasoned traveler or
someone looking for a spontaneous adventure, WeatherVue provides you with the tools you
need to make informed decisions and create memorable journeys.
The scope of the WeatherVue app encompasses a range of features and functionalities
designed to fulfill its objective of seamless weather-integrated travel recommendations. The
app's scope includes:
Personalized Recommendations:
o Offering suggestions for nearby attractions, activities, and points of interest
based on the current weather conditions.
o Considering users' preferences, interests, and historical interactions to tailor
recommendations.
User Interaction:
o Allowing users to leave reviews, ratings, and feedback for recommended
attractions.
o Enabling social sharing of planned itineraries and experiences.
Definition of Problem:
Many individuals face challenges when planning outdoor activities and exploring new places due to
unpredictable weather conditions. The current solutions available lack a comprehensive integration of
real-time weather data and personalized recommendations for nearby attractions. This leads to
situations where people may encounter unfavorable weather during their outings or miss out on
opportunities to engage in activities that align with the current weather.
Gathering Requirements: The first step is to understand what users need. For
WeatherVue, this involves identifying the features and functionalities users expect in
a weather-related application. This might include real-time weather updates, forecasts,
user location tracking, etc.
User Interviews and Surveys: Conducting interviews or surveys helps gather
detailed information about user preferences, expectations, and any specific features
they desire.
System Analysis:
Defining System Scope: Clearly define the scope of the WeatherVue application.
What will it include? What will be excluded? This helps in managing user
expectations and project boundaries.
Use Case Diagrams: Create use case diagrams to represent different interactions
between users and the system. This helps in identifying system functionalities based
on user activities.
System Design:
Architectural Design: Decide on the overall architecture of WeatherVue. This
includes choosing the right technology stack, database structure, and system
components. For instance, if mobile access is important, a responsive design might be
crucial.
User Interface Design: Design the user interface (UI) based on user requirements.
This involves creating wireframes and prototypes that visually represent how users
will interact with the system.
Database Design: Design the database structure to efficiently store and retrieve
weather data. Consider factors like data integrity, normalization, and performance.
Iterative Process:
Prototyping: Create prototypes of Weathervue to get early feedback from users. This
allows for adjustments based on user reactions before the full development is
completed.
Feedback Loop: Keep an iterative process where user feedback is continuously
collected and integrated into the design. This ensures that the final product aligns
closely with user expectations.
Documentation:
System Documentation: Document the system architecture, design decisions, and
user requirements. This documentation serves as a reference for developers and future
maintenance.
DFD 0:
DFD 1:
DFD 2
Use Case Diagram:
Class Diagram:
User Acceptance Testing (UAT):
UAT Scenarios:
Future Enhancements:
For future enhancements to the WeatherVue app, several features can be implemented to
elevate the user experience and expand the app's functionality:
1. Advanced Weather Data Visualization: Enhance the app's weather presentation by
incorporating advanced data visualization techniques. Integrate interactive maps, dynamic
weather animations, and historical weather trends. This can provide users with a more
immersive and insightful view of weather patterns over time.
2. Smart Recommendations with Machine Learning: Implement machine learning
algorithms to analyze user preferences, behavior, and historical weather data. This can enable
the app to provide more accurate and personalized recommendations for activities, places of
interest, and travel plans, creating a truly intelligent and adaptive user experience.
3. Seamless Integration of Wearable Devices: Enable compatibility with wearable devices,
such as smartwatches, fitness trackers, and augmented reality glasses. Users can receive real-
time weather updates and activity suggestions directly on their wearables, enhancing
accessibility and convenience, especially during outdoor activities.
4. Community Engagement and Social Features: Foster a sense of community within the
WeatherVue app by allowing users to share their travel experiences, weather-related insights,
and tips. Implement social features such as user reviews, ratings, and comments for points of
interest, creating a vibrant platform where users can connect and exchange valuable
information.
5. Localized Language and Cultural Considerations: Tailor the app to cater to different
regions and cultures by providing localized weather information, language preferences, and
region-specific points of interest. This can enhance the app's global appeal and make it more
inclusive for users around the world.
6. Integration of Environmental Data: Expand the app's scope by incorporating
environmental data such as air quality, pollen levels, and UV index. This information can
contribute to users' overall well-being and help them make health-conscious decisions based
on the environmental conditions.
7. Integration with Smart Home Devices: Connect WeatherVue with smart home devices to
create a seamless and integrated environment. Users can receive weather-related notifications
on smart speakers, control smart thermostats based on weather forecasts, or automate lighting
based on sunset and sunrise times.
| WeatherVue |
+-------------------------------+
+-------------------------------+
+-------------------------------+
| Task 2: Requirements |
+-------------------------------+
+-------------------------------+
+-------------------------------+
| | |
| +---------------------------+ |
| +---------------------------+ |
| | |
| +---------------------------+ |
| +---------------------------+ |
+-------------------------------+
+-------------------------------+
| Task 4: Development |
+-------------------------------+
| | |
| +---------------------------+ |
| | Development ||
| +---------------------------+ |
| | |
| +---------------------------+ |
| | Development ||
| +---------------------------+ |
+-------------------------------+
+-------------------------------+
| Testing |
+-------------------------------+
| | |
| +---------------------------+ |
| +---------------------------+ |
| | |
| +---------------------------+ |
| +---------------------------+ |
+-------------------------------+
+-------------------------------+
| Testing (UAT) |
+-------------------------------+
+-------------------------------+
| Task 7: Deployment |
+-------------------------------+
Chapter4
Methodology Adopted:
Agile Software Development:
Given the dynamic nature of weather-related applications and the need for continuous user
feedback, an Agile methodology is suitable. This iterative and incremental approach allows
for flexibility, collaboration, and regular reassessment of priorities.
1. Sprints: Break down the development process into time-boxed iterations (sprints) with
specific goals and deliverables.
2. User Stories: Define user stories to capture features or improvements from the user's
perspective. These stories guide development tasks.
3. Scrum Meetings: Conduct regular stand-up meetings, sprint planning, sprint review, and
retrospective meetings for effective communication and continuous improvement.
4. Feedback Loops: Emphasize continuous feedback from users and stakeholders, allowing
adjustments to be made during the development process.
System Implementation:
Architecture:
Choose a suitable architecture for the WeatherVue app, considering factors like scalability,
responsiveness, and ease of maintenance.
1. Frontend: Utilize a modern frontend framework (e.g., React, Vue.js) for a responsive and
user-friendly interface.
2. Backend: Choose a backend technology stack (e.g., Node.js, Django, Flask) for handling
business logic, integrating APIs, and managing data.
3. Database: Design and implement a database structure for storing weather data efficiently.
Consider using both relational and NoSQL databases based on the application's requirements.
Data Integration:
1. Weather Data API: Integrate with a reliable weather data API (e.g., OpenWeatherMap,
Weatherbit) to fetch real-time weather information.
2. Geolocation API: Utilize a geolocation API (e.g., Google Maps API) for user location
tracking and setting.
Testing:
1. Unit Testing: Implement unit tests for individual components to ensure their correctness.
2. Integration Testing: Verify that different components work seamlessly together.
3. User Acceptance Testing (UAT): Engage users in testing to validate that the app meets their
expectations.
Continuous Deployment:
Documentation:
A Level 0 Data Flow Diagram (DFD) provides a high-level overview of the system and its
major processes. In the case of the WeatherVue app, the Level 0 DFD outlines the main
components and their interactions at a broad level. Let's break down the key elements of the
DFD:
Entities:
1. User:
Represents the end-users interacting with the WeatherVue app.
Initiates requests for weather information and interacts with the app's functionalities.
Processes:
1. WeatherVue System:
The central process that encompasses the entire functionality of the WeatherVue app.
Manages the flow of information and interactions between users and the system.
Data Stores:
1. Database:
Represents the data store where weather information is stored.
The app may retrieve and store data related to user preferences, locations, and
historical weather data.
External Entities:
Data Flows:
1. User Interaction:
Represents the flow of information from the user to the WeatherVue System.
Users interact with the system by inputting their preferences, locations, and requests
for weather information.
2. Weather Data Flow:
Represents the flow of weather-related data between the WeatherVue System and the
external Weather Data API.
The system requests current weather and forecast data from the API, and the API
responds with the requested information.
3. Data Storage Flow:
Represents the flow of data between the WeatherVue System and the Database.
The system stores and retrieves relevant weather data in and from the database.
Diagram Notations:
Interaction:
1. The user interacts with the WeatherVue app by providing input, such as setting preferences,
choosing locations, and requesting weather information.
2. The WeatherVue System processes user input, communicates with the Weather Data API to
fetch weather data, and stores relevant information in the Database.
3. The fetched weather data is then presented to the user through the app's interface.
Conclusion:
The Level 0 DFD provides a high-level understanding of the WeatherVue app's major
components and their interactions. It serves as a foundation for more detailed DFDs and
system specifications, allowing stakeholders to grasp the system's architecture and flow of
information at a glance. Further detailed DFDs and specifications can be created for each
process depicted in the Level 0 DFD to provide a more granular understanding of the
system's functionality.
Data Flow Diagram (level 1)
Components:
1. User:
Attributes:
Location: Represents the geographic location chosen by the user.
Preferences: Includes user preferences such as temperature units, notification
settings, etc.
2. UI (User Interface):
Attributes:
Display Weather: The component responsible for presenting weather
information to the user.
User Input: Captures user interactions and input.
3. Controller:
Processes user input and manages the flow of data between the UI and
WeatherService.
Subprocesses:
Process User Input: Validates and processes user input.
Fetch Weather Data: Initiates the request for weather data from the
WeatherService.
4. WeatherService:
Retrieves weather data from external APIs and formats it for presentation.
Subprocesses:
Retrieve Weather: Fetches real-time weather data from external APIs.
Format Data: Structures and formats the raw data for use by the UI.
5. Database:
Stores and retrieves historical weather data.
Subprocesses:
Store Weather Data: Saves weather data in the database for future reference.
Retrieve Weather Data: Retrieves historical weather data from the database.
Data Flows:
User to UI: The user interacts with the UI, providing location and preferences.
UI to Controller: User input is sent to the Controller for processing.
Controller to WeatherService: Requests for weather data are initiated by the Controller.
WeatherService to Database: Retrieves and stores weather data in the database.
WeatherService to UI: Sends formatted weather data to the UI for display.
Database to WeatherService: Retrieves historical weather data from the database.
b. Input and Output Screen Design
(HOME PAGE )
LOGIN PAGE
REGISTER PAGE:
Objective: Verify that the user authentication module correctly handles user credentials and
authentication processes.
Features to Test:
Registration of new users.
Login with valid credentials.
Handling of invalid login attempts.
Password reset functionality.
Objective: Ensure that the code search functionality retrieves relevant results based on user
queries.
Features to Test:
User input validation in the search bar.
Retrieval of code snippets from the database.
Display of search results to the user interface.
Code Generation Module:
Objective: Ensure that the code generation module correctly generates code based on user
queries.
Features to Test:
Proper interpretation of user queries.
Successful communication with the ChatGPT API.
Generation of accurate and syntactically correct code snippets.
Database Interaction:
Objective: Verify that the system interacts correctly with the database.
Features to Test:
Proper storage and retrieval of user data.
Correct handling of code snippets in the database.
Ensuring data integrity and consistency.
INTEGRATION TESTING
Integration testing in WeatherVue is pivotal for validating the collaborative functioning of its
diverse modules. This testing phase ensures that user authentication seamlessly influences
code access, manipulated code integrates accurately with the generation process, and
database updates are promptly reflected in real-time. By comprehensively testing the end-to-
end workflow, WeatherVue can ascertain the reliability, cohesion, and interoperability of its
entire system. This process helps identify and rectify potential issues arising from the
interaction between different components, ensuring a robust and well-integrated software
solution.
VI. Coding and Screenshots of the project
File structure:
Virtual environment
The coding portion can be divided into two parts
1.Templates(html files)
2.The python files of the Django framework that have been used
Templates
index.html
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WeatherVue</title>
<link rel="stylesheet" href="{% static 'style.css' %}">
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;600&display=swap
"
rel="stylesheet"
/>
</head>
<body {% if exception_occurred %}
style="background-image: url('https://images.pexels.com/photos/3008509/pexels-photo-
3008509.jpeg?auto=compress&cs=tinysrgb&w=1600');"
{% else %}
style="background-image: url('{{ image_url }}');"
{% endif %}>
<div class="container">
<h1 class="heading">WeatherVue</h1>
<form method="POST">
{% csrf_token %}
<input type="text" name="city" placeholder="Enter City">
<button type="submit" class="btn">Search</button>
</form>
<div class="weather">
<div class="left">
<h2 class="temp">{{ temp }}° C</h2>
<h2 class="city">{{ city }}</h2>
<h3 class="new-page"> <a href="{% url 'nearby_points_of_interest' city='city' %}"
target="_blank">Find places to visit here </a></h3>
</div>
<div class="right">
<div class="icon">
<p><img src="http://openweathermap.org/img/w/{{ icon }}.png"
width="120px"></p>
</div>
<div class="condition">
<p>{{ description }}</p>
<p>{{ day }}</p>
</div>
</div>
</div>
</div>
{% if exception_occurred %}
<script>
window.onload = function() {
alert("City information is not available to Weather API");
}
</script>
{% endif %}
</body>
</html>
Output:
login.html
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login And Registration Page</title>
<style>
*{
margin: 0;
padding: 0;
font-family: sans-serif;
text-decoration: none;
list-style: none;
}
body{
background: url("../img/bg.jpeg") 50% 0 no-repeat fixed;
background-color: #cccccc;
}
.a{
margin-top:80px; height: 100%;
width: 100%;
background-image: url("bg.jpg");
background-position: center;
background-size: cover; position: absolute;
}
nav{
background: transparent;
height: 80px;
width: 100%;
position: fixed;
top: 0;
z-index: 99;
}
label.logo{
color: black;
font-size: 35px;
line-height: 80px;
padding: 0 100px;
font-weight: bold;
}
nav ul{
float:right;
margin-right: 20px;
}
nav ul li{
display:inline-block;
line-height: 80px;
margin:0 5px;
}
nav ul li a{
color:rgb(13, 13, 14);
font-size: 17px;
padding: 7px 13px;
border-radius: 3px ;
text-transform: uppercase;
}
a:hover{
background: #918a8a;
color: black;
transition: 0.5s;
/* Dropdown styles */
.dropdown {
position: relative;
display: inline-block;
border-radius: 30px;
.dropdown-content {
display: none;
position: absolute;
background-color:#3498db ;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown:hover .dropdown-content {
display: block;
}
.social-links li {
margin-bottom: 10px;
}
.social-links a {
color: #333;
text-decoration: none;
}
.social-links li a {
transition: transform 0.3s;
/* Add a transition for smooth effect*/
}
.social-links li a:hover {
transform: scale(1.2);
/* Enlarge the icon on hover */
background: white;
color: black;
transition: 0.5s;
}
.form-box{
width: 380px;
height: 480px;
position: relative;
margin: 6% auto;
background: #fff;
padding: 5px;
overflow: hidden;
}
.button-box{
width: 220px;
margin: 35px auto;
position: relative;
box-shadow: 0 0 20px 9px #ff61241f;
border-radius: 30px;
}
.toggel-btn{
padding: 10px 30px;
cursor:pointer;
background: transparent;
border: 0;
outline: none;
position: relative;
}
#btn{
top:0;
left: 0;
position: absolute;
width: 110px;
height: 100%;
background: rgb(101, 101, 240);
border-radius: 30px;
transition: .5s;
}
.input{
top: 180px;
position: absolute;
width: 280px;
transition: .5s;
}
.input-field{
width: 100%;
padding: 10px 0;
margin: 5px 0;
border-left: 0;
border-top: 0;
border-right: 0;
border-bottom: 1px solid #999;
outline: none;
background: transparent;
}
.submit-btn{
width: 85%;
padding: 10px 30px;
cursor: pointer;
display: block;
margin: auto;
background: rgb(101, 101, 240);
border: 0;
outline: none;
border-radius: 30px;
}
.check-box{
margin: 30px 10px 30px 0;
}
span{
color: #777; font-size: 12px;
bottom: 68px;
position: absolute;
}
.re{
color: #777;
font-size: 12px;
bottom: 40px;
position: absolute;
#login{
left: 60px;
}
#register{
left: 460px;
}
</style>
</head>
<body>
<nav>
<label class="logo">WeatherVue </label>
<ul>
<li class="dropdown">
<div class="dropdown-content">
<ul class="social-links">
</ul>
</div>
</li>
<li class="dropdown">
<a href="#" class="contact-link">CONTACT</a>
<div class="dropdown-content">
<ul class="social-links">
<li><a href="https://www.instagram.com/your-instagram- profile"
target="_blank">Instagram</a></li>
<li><a href="https://www.youtube.com/Smart Programming">YouTube</a></li>
<li><a href="https://wa.me/8851610577" target="_blank">WhatsApp</a></li>
<li><a href="contact.html" target="_blank">Feedback</a></li>
</ul>
</div>
</li>
<li><a href="about.html">ABOUT</a></li>
<li><a href="/admin">ADMIN</a></li>
</ul>
</nav>
<div class="a">
<div class="form-box">
<div class="button-box">
<div id="btn"></div>
<button class="toggel-btn" onclick="login()">Login</button>
<button class="toggel-btn" onclick="register()">Register</button>
</div>
return false;
return true;
}
}
</body>
</html>
Output:
contact.html
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Weathervue</title>
<style>
*{
margin: 0;
padding: 0;
font-family: sans-serif;
text-decoration: none;
list-style: none;
}
body{
background: url("../img/bg.jpeg") 50% 0 no-repeat fixed;
background-color: #cccccc;
}
.a{
margin-top:80px; height: 100%;
width: 100%;
background-image: url("bg.jpg");
background-position: center;
background-size: cover; position: absolute;
}
nav{
background: transparent;
height: 80px;
width: 100%;
position: fixed;
top: 0;
z-index: 99;
}
label.logo{
color: black;
font-size: 35px;
line-height: 80px;
padding: 0 100px;
font-weight: bold;
}
nav ul{
float:right;
margin-right: 20px;
}
nav ul li{
display:inline-block;
line-height: 80px;
margin:0 5px;
}
nav ul li a{
color:rgb(13, 13, 14);
font-size: 17px;
padding: 7px 13px;
border-radius: 3px ;
text-transform: uppercase;
}
a:hover{
background: #918a8a;
color: black;
transition: 0.5s;
/* Dropdown styles */
.dropdown {
position: relative;
display: inline-block;
border-radius: 30px;
}
.dropdown-content {
display: none;
position: absolute;
background-color:#3498db ;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown:hover .dropdown-content {
display: block;
}
.social-links li {
margin-bottom: 10px;
}
.social-links a {
color: #333;
text-decoration: none;
}
.social-links li a {
transition: transform 0.3s;
/* Add a transition for smooth effect*/
}
.social-links li a:hover {
transform: scale(1.2);
/* Enlarge the icon on hover */
background: white;
color: black;
transition: 0.5s;
}
h1, h2 {
color: #3498db;
}
form {
max-width: 400px;
width: 100%;
padding: 20px;
box-sizing: border-box;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.form-box{
width: 380px;
height: 420px;
position: relative;
margin: 6% auto;
background: #fff;
padding: 5px;
overflow: hidden;
}
label {
display: block;
margin-bottom: 8px;
}
input, textarea {
width: 100%;
padding: 8px;
margin-bottom: 16px;
box-sizing: border-box;
}
button {
background-color: #3498db;
color: #fff;
padding: 10px 15px;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<nav>
<label class="logo"> WeatherVue </label>
<ul>
<li class="dropdown">
<div class="dropdown-content">
<ul class="social-links">
</ul>
</div>
</li>
<li class="dropdown">
<a href="#" class="contact-link">CONTACT</a>
<div class="dropdown-content">
<ul class="social-links">
<li><a href="https://www.instagram.com/your-instagram- profile"
target="_blank">Instagram</a></li>
<li><a href="https://www.youtube.com/Smart Programming">YouTube</a></li>
<li><a href="https://wa.me/8851610577" target="_blank">WhatsApp</a></li>
<li><a href="contact.html" target="_blank">Feedback</a></li>
</ul>
</div>
</li>
<li><a href="about.html">ABOUT</a></li>
<li><a href="/admin">ADMIN</a></li>
</ul>
</nav>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="message">Message:</label>
<textarea id="message" name="message" rows="4" required></textarea>
<button type="submit">Submit</button>
</form>
</body>
</html>
OUTPUT:
About.html
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About Weathervue</title>
<style>
body {
background-image: url('% static "img/bg.jpeg" %');
font-family: 'Arial', sans-serif;
margin: 20px;
}
h1, h2 {
color: #3498db;
}
</style>
</head>
<body>
<h1>About Weathervue</h1>
<h2>Our Story</h2>
<p>Welcome to Weathervue, where weather meets innovation. Weathervue was born out
of a passion for providing users with accurate and personalized weather information in a
visually appealing and user-friendly way. Our journey began with a simple idea: to create a
weather platform that goes beyond the forecast, offering a comprehensive and engaging
experience for users of all backgrounds.</p>
<h2>Our Mission</h2>
<p>At Weathervue, our mission is to empower individuals and communities with the
knowledge they need to make informed decisions about their daily lives and activities. We
believe that weather information should be accessible, reliable, and enjoyable for everyone.
By combining cutting-edge technology with a user-centric approach, we strive to redefine the
way people interact with and understand the weather.</p>
<h2>Key Features</h2>
<ul>
<li><strong>Accurate Forecasts:</strong> We leverage advanced meteorological data
and state-of-the-art forecasting models to provide you with precise and up-to-date weather
information.</li>
<li><strong>Intuitive Design:</strong> Our user interface is designed with simplicity in
mind, ensuring that you can effortlessly access the weather details that matter most to
you.</li>
<li><strong>Personalization:</strong> Tailor your weather experience by setting up
personalized alerts, favorite locations, and specific weather parameters to receive the
information you need.</li>
<li><strong>Real-time Updates:</strong> Stay ahead of the weather with real-time
updates and notifications, so you can plan your day with confidence.</li>
</ul>
<h2>Contact Us</h2>
<p>We value your feedback and are here to assist you. If you have any questions,
suggestions, or just want to say hello, please don't hesitate to <a href="#contact">contact
us</a>.</p>
<p>Thank you for choosing Weathervue for your weather needs. We look forward to being
your go-to weather companion.</p>
</body>
</html>
OUPUT:
2. Python Files
Settings.py
"""
Django settings for weatherproject project.
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'weatherapp.apps.WeatherappConfig',
]
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 = 'weatherproject.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(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 = 'weatherproject.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'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/3.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
urlpatterns = [
path('login/', views.login, name='login'),
path('register/', views.register, name='register'),
# path('home/', views.home),
path('admin/', admin.site.urls),
path('',views.register),
path('log',views.home),
path('main.html',views.returnhome),
path('about.html',views.about),
path('contact.html', views.contact),
path('nearby/<str:city>/', views.nearby_points_of_interest,
name='nearby_points_of_interest')
]
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL)),
],
),
]
App files
1.admin.py
class RegAdmin(admin.ModelAdmin):
list_display=['user_name','email','password','confirm_password']
class PointAdmin(admin.ModelAdmin):
list_display=['name', 'description', 'latitude', 'longitude']
admin.site.register(Registration, RegAdmin)
admin.site.register(PointOfInterest, PointAdmin)
2.apps.py
class WeatherappConfig(AppConfig):
name = 'weatherapp'
4)models.py
class User(models.Model):
username = models.CharField(max_length=20)
password = models.CharField(max_length=20)
email = models.EmailField()
class PointOfInterest(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
latitude = models.FloatField()
longitude = models.FloatField()
Urls.py
urlpatterns = [
path('', include('weatherapp.urls') ),
]
Views.py
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login
from .models import User
from .models import PointOfInterest
import requests
from django.contrib import messages
import datetime
from .forms import LoginForm, RegistrationForm
def login(request):
if request.method == 'POST':
form = LoginForm(request.POST)
if form.is_valid():
username = form.cleaned_data['user_name']
password = form.cleaned_data['password']
user = authenticate (request, username = username, password=password)
if user is not None:
login(request, user)
return redirect('weather:index')
else:
messages.info(request, 'Invalid Username or Password')
else:
form = LoginForm()
return render(request, 'weather/index.html', {'form': form})
def register(request):
if request.method == 'POST':
form = RegistrationForm(request.POST)
if form.is_valid():
user_name = form.cleaned_data['user_name']
email = form.cleaned_data['email']
password = form.cleaned_data['password']
def about(request):
return render(request,'weather/about.html')
def contact(request):
return render(request, 'weather/contact.html')
def home(request):
if 'city' in request.POST:
city = request.POST['city']
else:
city = 'delhi'
url =
f'https://api.openweathermap.org/data/2.5/weather?q={city}&appid=7c965a8f4ced8a2a8f932
8129dac6b94'
PARAMS = {'units':'metric'}
API_KEY = 'AIzaSyA7G5hX0h424EN9k4RoLcEnlIMcWkfYdXY'
SEARCH_ENGINE_ID = 'e3b80c6033fa948ec'
data = requests.get(city_url).json()
count = 1
search_items = data.get("items")
image_url = search_items[1]['link']
try:
data = requests.get(url,params=PARAMS).json()
description = data['weather'][0]['description']
icon = data['weather'][0]['icon']
temp = data['main']['temp']
day = datetime.date.today()
except KeyError:
exception_occurred = True
messages.error(request,'Entered data is not available to API')
# city = 'indore'
# data = requests.get(url,params=PARAMS).json()
# description = data['weather'][0]['description']
# icon = data['weather'][0]['icon']
# temp = data['main']['temp']
day = datetime.date.today()
Manage.py
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'weatherproject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
VII. Conclusion and Future Scope
The development of the WeatherVue app has been a comprehensive process involving user
requirements gathering, system analysis, design, and implementation. The chosen Agile
methodology facilitated flexibility and continuous feedback, ensuring alignment with user
expectations. The app employs a robust architecture, integrates with external APIs for real-
time weather data, and provides a user-friendly interface.
Key Achievements:
1. User-Centric Design: The app prioritizes user experience with features such as real-time
weather updates, forecasts, and user-friendly controls.
2. Data Integration: Integration with external weather data APIs ensures accurate and up-to-
date information, enhancing the reliability of the app.
3. Scalability and Performance: The app's architecture allows for scalability to accommodate
future feature enhancements and optimizations for performance.
4. Iterative Development: The iterative development process, guided by user feedback, led to a
more refined and user-friendly application.
Future Scope:
Prism Library:
Prism Documentation:
Website: Prism Documentation
Official documentation for Prism, a lightweight syntax highlighter that
can be used in web applications.