Skip to content

rushxpush/weather-api-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Api Django

A Django-based microservice for providing weather data using PostgreSQL. This service is part of a larger distributed application.

Prerequisites

  • Docker and Docker Compose
  • Python 3.9+ (if running locally)
  • PostgresSQL database

Running with Docker

TO-DO

  1. Run the Container
docker run --env-file .env -p 8000:8000 weather-api-django

If not using Docker (manual installation)

  1. Clone the repository:
git clone https://github.com/rushxpush/weather-api-django.git
  1. Create a virtual environment and activate it:
# Linux
source venv/bin/activate
# Windows
venv/Scripts/activate # I need to check this
  1. Install dependencies
pip install -r requirements.txt
  1. Apply migrations
python manage.py migrate
  1. Run the development server
python manage.py runserver

Environment variables

Create a '.env' file in the project root with the following variables:

DEBUG=True POSTGRES_USERNAME=<YOUR_DATABASE_USERNAME> POSTGRES_PASSWORD=<YOUR_DATABASE_PASSWORD> POSTGRES_PORT=5430 POSTGRES_HOST=localhost

Project Structure

  • weather_project/: The main Django project containing settings and configurations.
  • weather_api/: The Django app containing the API logic and models.

Frequently used commands

  • Run the development server:
python manage.py runserver
  • Create a new migration:
python manage.py makemigrations
  • Apply migrations:
python manage.py migrate
  • Run tests:
python manage.py test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages