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

WeatherVue (Report Final)

This document describes a weather forecasting app called WeatherVue. The app aims to provide real-time weather data integrated with personalized recommendations for nearby points of interest to help users plan activities and optimize their travel plans based on weather conditions. It offers features like weather forecasts, interactive maps, activity suggestions, and travel planning assistance.

Uploaded by

HUNTER RONY
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

WeatherVue (Report Final)

This document describes a weather forecasting app called WeatherVue. The app aims to provide real-time weather data integrated with personalized recommendations for nearby points of interest to help users plan activities and optimize their travel plans based on weather conditions. It offers features like weather forecasts, interactive maps, activity suggestions, and travel planning assistance.

Uploaded by

HUNTER RONY
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

WeatherVue

Submitted in partial fulfilment of the requirements for the award of the degree of

Bachelor of Computer Applications

To GGSIPU

Submitted By:
Submitted to:
Rudra Pratap Singh Gahlot
Ms. M. Gomathy
Roll No. 05911102021

College Name: Banarsidas


Chandiwala Institute of
Information and Technology
CONTENTS

Sno. TOPIC Page no:

1 Acknowledgement

2 Certificate(es)

3 Synopsis

4 Chapter 1: Introduction

5 Chapter 2: System Analysis

6 Chapter 3: System Design

7 Chapter 4: System Development


8 Chapter 5: Life Cycle of the Project
9 Code & Screenshot

10 Conclusion & Future scope


Acknowledgment

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

fulfillment of the degree of Bachelor of Computer Applications to the “__________” through

Guru Gobind Singh Indraprastha University done by Mr. Rudra Pratap Singh Gahlot, Roll

No. 05911102021 is an is an authentic work carried out by him/her at

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

Signature of the student Signature of the Guide


SELF CERTIFICATE

This is to certify that the dissertation/project report entitled

“…………………………………” is done by me is an authentic work carried out for the

partial fulfilment of the requirements for the award of the degree of Bachelor of Computer

Applications under the guidance of __________________ . The matter embodied in this

project work has not been submitted earlier for award of any degree or diploma to the best of

my knowledge and belief.

Signature of the student

Name of the Student

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.

 Personalized Recommendations: WeatherVue takes into account your


preferences and interests to curate personalized recommendations. If you're a
foodie, it might suggest nearby cafes and restaurants with indoor seating during
inclement weather. If you're an outdoor enthusiast, it could highlight parks, trails,
and outdoor attractions when the weather is favorable.

 Activity Suggestions: The app provides a variety of activity suggestions based


on the current weather. From outdoor sports and recreational activities to cultural
events and indoor attractions, WeatherVue helps you discover new experiences
no matter the weather.

 Travel Planning: Whether you're a local looking for weekend activities or a


traveler exploring a new city, WeatherVue assists you in creating detailed
itineraries based on the weather forecast.

 User Reviews and Ratings: Users can contribute their experiences by leaving
reviews and ratings for points of interest, helping others make informed choices.

 Notifications: Receive timely weather updates and notifications about special


events, promotions, or changes in operating hours for recommended places.
PROBLEM DEFINITION
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.
Key Problems to Address:
Lack of Weather-Integrated Recommendations: Existing travel apps often lack the
ability to provide seamless integration between weather forecasts and nearby points of
interest. This leaves users to manually cross-reference weather information with
potential activities, leading to inconvenience and frustration.

Informed Decision-Making: Without accurate and real-time weather data,


individuals struggle to make informed decisions about what activities to pursue and
how to dress appropriately for the weather, impacting the overall quality of their
experiences.

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.

OBJECTIVE & SCOPE


Objective:
The primary objective of the WeatherVue app is to enhance user travel experiences by
providing real-time weather information integrated with personalized recommendations for
nearby points of interest. The app aims to empower users to make informed decisions about
their activities, optimize their plans based on weather conditions, and discover new
attractions that align with their preferences and interests.

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 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.
 Interactive Map Interface:

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 Providing comprehensive details about recommended places, including


opening hours, admission fees, user reviews, and contact information.
o Enabling users to make informed decisions about their chosen activities.
 Activity Suggestions:

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:

o Assisting users in creating and organizing travel itineraries based on the


weather forecast and selected activities.

o Integrating with navigation apps for seamless directions to chosen


destinations.

 User Interaction:

o Allowing users to leave reviews, ratings, and feedback for recommended


attractions.

o Enabling social sharing of planned itineraries and experiences.

 Notifications and Alerts:

o Sending users timely weather updates, special event notifications, and


changes in operating hours.

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.

User-Reported Conditions: Allow users to report current weather conditions in their


area. While this might not be as accurate as data from specialized weather sources, it can
provide a real-time snapshot of local conditions.

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.

Internet Connection: A reliable internet connection is required for accessing


documentation, resources, libraries, and for testing your web application on different
devices and browsers.

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.

Django: Install Django using Python's package manager, pip.

Integrated Development Environment (IDE): Choose an IDE or code editor to write


your Django app. Popular options include:
o PyCharm
o Visual Studio Code
o Sublime Text
o Atom

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.

Virtual Environment (Recommended): It's a good practice to create a virtual


environment for your Django project to isolate dependencies. You can use Python's built-
in venv or third-party tools like virtualenv for this purpose.
CHAPTER-1 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.

Objective and the scope


The primary objective of the WeatherVue app is to enhance user travel experiences by providing real-
time weather information integrated with personalized recommendations for nearby points of interest.
The app aims to empower users to make informed decisions about their activities, optimize their plans
based on weather conditions, and discover new attractions that align with their preferences and
interests.

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

Interactive Map Interface:


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 Providing comprehensive details about recommended places, including
opening hours, admission fees, user reviews, and contact information.
o Enabling users to make informed decisions about their chosen activities.
Activity Suggestions:
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:
o Assisting users in creating and organizing travel itineraries based on the
weather forecast and selected activities.
o Integrating with navigation apps for seamless directions to chosen
destinations.

User Interaction:
o Allowing users to leave reviews, ratings, and feedback for recommended
attractions.
o Enabling social sharing of planned itineraries and experiences.

Notifications and Alerts:


o Sending users timely weather updates, special event notifications, and changes
in operating hours.

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.

Key Problems to Address:


 Lack of Weather-Integrated Recommendations: Existing travel apps often lack the
ability to provide seamless integration between weather forecasts and nearby points of
interest. This leaves users to manually cross-reference weather information with potential
activities, leading to inconvenience and frustration.
 Informed Decision-Making: Without accurate and real-time weather data,
individuals struggle to make informed decisions about what activities to pursue and how
to dress appropriately for the weather, impacting the overall quality of their experiences.
 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.
CHAPTER-2
System Analysis & Design vis-a-vis User Requirements

System analysis involves a detailed examination of the WeatherVue application,


considering its functionalities, components, and interactions. This analysis
provides insights into the system's requirements, design, and potential
improvements

Understanding User Requirements:

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

Verification and Validation:


 Testing: Conduct thorough testing to ensure that Weathervue functions as intended.
This involves functional testing, usability testing, and performance testing.
 User Acceptance Testing (UAT): Involve users in the testing phase to confirm that
the system meets their requirements and expectations.

Documentation:
 System Documentation: Document the system architecture, design decisions, and
user requirements. This documentation serves as a reference for developers and future
maintenance.

Data Flow Diagram (DFD):

DFD 0:
DFD 1:
DFD 2
Use Case Diagram:

Class Diagram:
User Acceptance Testing (UAT):

UAT Scenarios:

1. User Registration and Authentication:


 Users validate the registration process and authenticate successfully.
2. Code Search and Retrieval:
 Test the effectiveness of the code search functionality and the accuracy of
code retrieval.
3. Code Manipulation:
 Users assess the ability to add, edit, and delete code snippets.
4. Code Generation:
 Validate the correctness of code generated by the application using the
ChatGPT API.
5. Database Interaction:
 Users check if data is stored and retrieved correctly from the database.
6. User Interface:
 Evaluate the user interface for design, responsiveness, and overall user
experience.

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.

By implementing these future enhancements, WeatherVue can solidify its position as a


comprehensive and intelligent weather companion, providing users with not only accurate
weather information but also valuable insights and personalized recommendations for a
diverse range of activities and lifestyles.
Chapter 3

System Planning (PERT CHART)

Flow of the Cycle


+-------------------------------+

| WeatherVue |

+-------------------------------+

| Task 1: Project Initiation |

+-------------------------------+

+-------------------------------+

| Task 2: Requirements |

| Gathering and Analysis |

+-------------------------------+

+-------------------------------+

| Task 3: System Design |

+-------------------------------+

| | |

| +---------------------------+ |

| | Task 3.1: Database Design | |

| +---------------------------+ |

| | |
| +---------------------------+ |

| | Task 3.2: UI/UX Design ||

| +---------------------------+ |

+-------------------------------+

+-------------------------------+

| Task 4: Development |

+-------------------------------+

| | |

| +---------------------------+ |

| | Task 4.1: Backend ||

| | Development ||

| +---------------------------+ |

| | |

| +---------------------------+ |

| | Task 4.2: Frontend ||

| | Development ||

| +---------------------------+ |

+-------------------------------+

+-------------------------------+

| Task 5: Integration & |

| Testing |

+-------------------------------+
| | |

| +---------------------------+ |

| | Task 5.1: API Integration | |

| +---------------------------+ |

| | |

| +---------------------------+ |

| | Task 5.2: System Testing | |

| +---------------------------+ |

+-------------------------------+

+-------------------------------+

| Task 6: User Acceptance |

| Testing (UAT) |

+-------------------------------+

+-------------------------------+

| Task 7: Deployment |

+-------------------------------+
Chapter4

Methodology adopted & System Implementation

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.

User Experience (UI/UX):


1. Wireframing and Prototyping: Design wireframes and prototypes to visualize the user
interface. Gather feedback early in the process.
2. Responsive Design: Ensure the application is accessible and functional across various
devices and screen sizes.

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:

1. Continuous Integration/Continuous Deployment (CI/CD): Implement CI/CD pipelines to


automate testing and deployment processes.
2. Version Control: Use a version control system (e.g., Git) to manage code changes and
collaborate effectively.

Documentation:

1. Technical Documentation: Create comprehensive documentation covering system


architecture, APIs, and data models.
2. User Documentation: Develop user guides to help users navigate and utilize the
WeatherVue app effectively.
Chapter 5
Detailed Life Cycle of the Project a. ERD, DFD

Data Flow Diagram (level 0)

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:

1. Weather Data API:


 Represents an external data source providing real-time weather information.
 The WeatherVue app may fetch current weather and forecasts from this API.

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:

 Rectangles: Represent processes or systems (e.g., WeatherVue System).


 Ovals: Represent external entities (e.g., User, Weather Data API).
 Arrows: Represent data flows, showing the direction of data movement between entities,
processes, and data stores.

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:

Methodology used testing

Unit Testing in WeatherVue:

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.

Code Search Module:

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 }}&#176; 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 media link styles */


.social-links {
list-style-type: none;
padding: 0;
}

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

<form id="login" class="input" method="post" action="/log" onsubmit="return


validatelog()">
{% csrf_token %}
{% for message in messages%}
<p>{{message}}</p>
{% endfor %}
<input type="text" class="input-field" placeholder="User Id" name="user_name" required
/>
<input type="password" class="input-field" placeholder="Password" name="password"
required />
<input type="checkbox" class="check-box"
/><span>Remember Me</span>
<div class="re">
Do Not Have An Account ? Click on Register button
</div><br>
<button type="submit" class="submit-btn">Login <a href="/home"></a></button>
</form>
<form id="register" action="#" class="input" onsubmit="return validateForm()" method
="post">
{% csrf_token %}
<input type="text" class="input-field" placeholder="User Id" required name="user_name"
value="{{user_name}}">
<input type="text" class="input-field" placeholder="[email protected]" required
name="email" value="{{email}}">
<input type="password" id="password" class="input-field" placeholder="Password"
required name="password"
value="{{password}}">
<input type="password" id="confirmPassword" class="input-field" placeholder="Confirm
Password" required
name="confirm_password" value="{{confirm_password}}">

<button type="submit" class="submit-btn">Register</button>


</form>
</div>
</div>
<script>
var x = document.getElementById("login"); var y =
document.getElementById("register"); var z = document.getElementById("btn");

function register() { x.style.left = "-400px"; y.style.left = "50px"; z.style.left = "110px";


}
function login() { x.style.left = "50px"; y.style.left = "450px"; z.style.left = "0px";
}
function validateForm() { var password =
document.getElementById("password").value; var confirmPassword =
document.getElementById("confirmPassword").value;

if (password !== confirmPassword) { alert("Passwords Do Not Match !");

return false;

} else { passwordError.innerText = ""; login();

return true;
}
}

function validatelog() { var username =


document.getElementById("user_name").value; var password =
document.getElementById("password").value;

if (user_name.trim() === "" || password.trim() === "") { alert("Username and Password


fields cannot be empty!"); return false;
}
return true;
}
</script>

</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 media link styles */


.social-links {
list-style-type: none;
padding: 0;
}

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

<form class="form-box" caction="process-form.php" method="post">


<h1 class="text">Contact Weathervue</h1><br>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>

<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>Our Commitment to Quality</h2>


<p>Weathervue is committed to maintaining the highest standards of quality and accuracy.
Our team of dedicated meteorologists, developers, and designers work tirelessly to ensure
that our platform remains at the forefront of weather technology. We continually update our
systems to provide you with the most reliable and relevant weather information.</p>

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

Generated by 'django-admin startproject' using Django 3.1.6.

For more information on this file, see


https://docs.djangoproject.com/en/3.1/topics/settings/

For the full list of settings and their values, see


https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.


BASE_DIR = Path(__file__).resolve().parent.parent

# Quick-start development settings - unsuitable for production


# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!


SECRET_KEY = 'y!^f73w5xi5zi17+q&hu+krknlm*j&018xfy8xx5(a)axn0%b%'

# SECURITY WARNING: don't run with debug turned on in production!


DEBUG = True

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 files (CSS, JavaScript, Images)


# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]

Urls.py of outer folder

from django.urls import path


from django.conf import settings
from django.contrib import admin
from . import views

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')
]

0001_initial.py (made during migration )

# Generated by Django 4.2.7 on 2023-12-15 03:37

from django.conf import settings


from django.db import migrations, models
import django.db.models.deletion

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

from django.contrib import admin


from weatherapp.models import Registration
from weatherapp.models import PointOfInterest

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)

# Register your models here.

2.apps.py

from django.apps import AppConfig

class WeatherappConfig(AppConfig):
name = 'weatherapp'

4)models.py

from django.db import models

# Create your models here.


class Registration(models.Model):
user_name = models.CharField(max_length=100,null=False)
email=models.EmailField()
password = models.CharField(max_length=100)
confirm_password = models.CharField(max_length=100)

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

def str (self):


return self.user_name

Urls.py

from django.urls import path ,include


from django.conf import settings
from django.conf.urls.static import static

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']

user = User.objects.create(username=user_name, email=email, password=password)


user.save()
messages.success(request, 'Account Successfully Created.')
return render(request, 'weather/login.html')
else:
form = RegistrationForm()

return render(request, 'weather/login.html', {'form': form})

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'

query = city + " 1920x1080"


page = 1
start = (page - 1) * 10 + 1
searchType = 'image'
city_url =
f"https://www.googleapis.com/customsearch/v1?key={API_KEY}&cx={SEARCH_ENGIN
E_ID}&q={query}&start={start}&searchType={searchType}&imgSize=xlarge"

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

return render(request,'weather/index.html' , {'description':description , 'icon':icon


,'temp':temp , 'day':day , 'city':city , 'exception_occurred':False ,'image_url':image_url})

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

return render(request,'weatherapp/index.html' ,{'description':'clear sky', 'icon':'01d'


,'temp':25 , 'day':day , 'city':'indore' , 'exception_occurred':exception_occurred } )

def nearby_points_of_interest(request, city):


# Assuming you have a model called PointOfInterest with latitude and longitude fields
# Fetch points of interest based on the city or location
points_of_interest = PointOfInterest.objects.all() # You need to filter based on the city or
location

return render(request, 'weather/place.html', {'points_of_interest': points_of_interest, 'city':


city})

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:

1. Enhanced Forecasting: Incorporate advanced weather forecasting models to provide more


accurate and detailed forecasts.
2. User Personalization: Expand user preferences to include more customization options, such
as personalized weather alerts and notifications.
3. Geographical Expansion: Extend the app's coverage to include a broader range of
geographic locations and consider language localization.
4. Community Features: Integrate social features, allowing users to share weather updates,
recommendations, and experiences.
5. Weather Maps: Implement interactive weather maps with overlays for additional insights
into weather patterns.
6. Accessibility Features: Ensure the app is accessible to users with disabilities by
incorporating accessibility features.
7. Smart Device Integration: Explore integration with smart devices, providing users with
weather updates through voice commands or smart home devices.
8. Collaboration with Meteorological Agencies: Collaborate with official meteorological
agencies for authoritative and localized weather information.
9. Historical Weather Data Analysis: Develop features that allow users to explore and analyze
historical weather data for specific locations.
10. Continuous Improvement: Regularly update the app based on user feedback, technological
advancements, and emerging weather-related technologies.
In conclusion, the WeatherVue app, with its current features and planned future
enhancements, aims to provide a comprehensive and user-friendly solution for accessing
weather information. Continuous engagement with users and the integration of cutting-edge
technologies will contribute to the app's success and its ability to meet evolving user
expectations in the dynamic field of weather applications.
References

Official Django Documentation:

 Website: Django Documentation


 A comprehensive resource covering everything from getting started to
advanced topics in Django development.

Django for Beginners by William S. Vincent:

 Book: Django for Beginners


 A beginner-friendly book that provides practical examples and
explanations for Django development.

Django Project GitHub Repository:

 Repository: Django GitHub


 Access the source code, report issues, and contribute to the development
of Django.

Integrating OpenAI API:

OpenAI API Documentation:

 Website: OpenAI API Documentation


 Official documentation for the OpenAI API, providing details on
endpoints, usage, and integration.

OpenAI GitHub Repository:

 Repository: OpenAI GitHub


 Explore the OpenAI GitHub organization for additional resources, code
samples, and projects.

Prism Library:

Prism Documentation:
 Website: Prism Documentation
 Official documentation for Prism, a lightweight syntax highlighter that
can be used in web applications.

Prism GitHub Repository:

 Repository: Prism GitHub


 Access the source code, contribute, and stay updated on Prism's
development.

You might also like