项目作者: hellosophiee

项目描述 :
☔️ Weather app in Django that gets the current weather for multiple cities. To do this, I used Python Requests to call the Open Weather Map API.
高级语言: Python
项目地址: git://github.com/hellosophiee/django-weather-app.git
创建时间: 2019-10-29T17:08:54Z
项目社区:https://github.com/hellosophiee/django-weather-app

开源协议:

下载


Weather app in Django using Python Requests

Weather app in Django that gets the current weather for multiple cities. To do this, I used Python Requests to call the Open Weather Map API.

License: MIT GitHub contributors Open Source Love png1 saythanks

forthebadge made-with-python

ForTheBadge built-with-love

Demo

Building

Note: In this project I’ve used Python 3.7, so you need to install it first. It’s highly recommended to use pyenv for installation (if you’re on MacOS).

It’s best to use the python pipenv tool to build locally:

$ pipenv --python python3

$ pipenv shell

$ pipenv install django requests autopep8

Start the project

$ django-admin startproject the_weather

$ cd the_weather/

$ python manage.py startapp weather

Open up the files in your editor and add app weather to the project within the_weather/settings.py:

  1. INSTALLED_APPS = [
  2. 'django.contrib.admin',
  3. 'django.contrib.auth',
  4. 'django.contrib.contenttypes',
  5. 'django.contrib.sessions',
  6. 'django.contrib.messages',
  7. 'django.contrib.staticfiles',
  8. 'weather',
  9. ]

$ python manage.py migrate

$ python manage.py createsuperuser --username=<your name> --email=<your email address>

And then just startapp the app:

$ python manage.py runserver

Open http://localhost:8000 to view it in the browser and go to admin panel http://localhost:8000/admin/

The page will NOT reload if you make any edits.

Subscribe for free OpenWeather API

Ypu can get your API from OpenWeather

Learn More

To learn more on Django web framework visit Django.

Write your first Django app, check out the Writing your first Django app, part 1.

Creating a Weather App in Django Using Python Requests, check out this YouTube Tutorial Creating a Weather App in Django Using Python Requests.