Weather and Forecast Monitoring Web Application
- Used Technologies
- Prerequisites
- Running
- Usage
- Admin Panel
- Features
- Views and Endpoints
- Test
- Logs
- Repository
- License
Django was preferred because backend and view will be used together in this project. However, it may be more appropriate to use django-rest-framework for further development of the project.
SQLite was used to make the project available quickly in different environments.
Thus, there was no need to run a stand-alone database.
This project is backend based, but Bootstrap and JS are used to make frontend improvements fast.
Weather App is written in Python with Django Framework.
Other library requirements are listed in requirements.txt
, to install with pip use following command:
pip3 install requirements.txt
python3 manage.py runserver 8000
Then app will be available on http://127.0.0.1:8000
as shown:
- Select unit type
- Start typing the city name
- Click the view button next to the city name
- Enjoy!
Default Django admin panel is available on http://127.0.0.1:8000/admin
You can create new superuser with following command:
python3 manage.py createsuperuser
Default Super User Credentials:
- Username: weather_app_admin
- Password: weather12345
- Instant Search
User can search cities instantly on home page without seeking within pages. - Unit
User can choose unit while searching cities. - Cookie for Last Viewed City
When the user enters the page, the last viewed city information is kept and the weather for that city is displayed. If the city is changed, the cookie information is also updated. This method is also applied to unit data. - Import Cities Command
User can import cities via Django command line interface with using
python3 manage.py import_cities docs/city.list.json
command.
Parameter | Required | Method | Type | Description |
---|---|---|---|---|
search_query |
Yes | GET |
string |
Minimum 2 char |
Parameter | Required | Method | Type | Description |
---|---|---|---|---|
city_id |
Yes | GET |
integer |
City #ID |
unit |
No | GET |
string |
Unit Type |
Tests are available under WeatherApp/WeatherApp/tests
directory. Django test base was used.
You can simply run test using following command.
python3 manage.py test
Stored under WeatherApp/logs/
directory.
This project available at eminsafa/Weather-App