This is a small web application based on the DRF,
which is provided the API, through which you can subscribe
to receive the current weather forecast.
- Python 3.10
- Redis server
- All modules requirements are specified in the requirements.txt file.
You can install it via commandpip install -r requirements.txt
- Install all requirements
- Specify a list of env variables in the .env file:
- SECRET_KEY
- OPENWEATHERMAP_KEY
- DB_NAME
- DB_HOST
- DB_PORT
- DB_USER
- DB_PASSWORD
- EMAIL_HOST_USER
- EMAIL_HOST_PASSWORD
- REDIS_HOST
- REDIS_PORT
- Create migrations for django_weather_reminder app via command
python manage.py makemigrations django_weather_reminder
- Migrate database via command
python manage.py migrate
- To start the server, use the command
python manage.py runserver
- To start celery, use the command
celery -A DjangoWeatherReminder worker -l INFO
If you use Windows:
celery -A DjangoWeatherReminder worker -l INFO -P eventlet
- To start beat, use the command
celery -A DjangoWeatherReminder beat -l INFO
- Optional you can run flower to monitor the workers
celery -A DjangoWeatherReminder flower --port={PORT}
You can use this command:
python manage.py fill_ukraine
- fills the database with cities in Ukrainepython manage.py delete_cities
- deletes all citiespython manage.py fill_weather_all_cities
- Fills in the current weather forecast for all cities
All received data is presented in JSON format.
-
/swagger/
- API docs -
/api/v1/
/countries/
- list of all countries/countries/<country_id>/
- information about particular country/countries/<country_id>/cities/
- list of all cities/countries/<country_id>/cities/<city_id>/
- information about particular city/accounts/subscriptions/
- list of user subscriptions to cities/accounts/subscriptions/<subscription_id>/
- information about particular subscription./register/
- endpoint for registration/token/
- endpoint for token obtaining
https://my-django-weather-forecast-app.herokuapp.com/
MDI