ssh -R 80:localhost:8000 serveo.net
Copy the forwarding message:
Forwarding HTTP traffic from https://your_host.serveo.net
http://localhost:8000/
cd backend/
echo "Creating .env file..."
cat <<EOL > .env
# Django configuration
SECRET_KEY=YOUR_SECRET_KEY
DEBUG=1
# PostgreSQL (docker/local)
DB_ENGINE=django.db.backends.postgresql_psycopg2
POSTGRES_DB=weather_db
POSTGRES_USER=postgres
POSTGRES_PASSWORD=example
DB_PORT=5432
# pgadmin container
PGADMIN_DEFAULT_EMAIL=admin@gmail.com
PGADMIN_DEFAULT_PASSWORD=root
# OPENWEATHERMA
OPENWEATHERMAP_URL=http://api.openweathermap.org/data/2.5/forecast
# OPENWEATHERMA API key (test)
OPENWEATHERMAP_API_KEY=5b44ac6286917292ea1dc572affc3aff
EOL
cd ..
docker-compose -f docker/docker-compose.yml up --build
docker exec -it django-container bash
python3 manage.py createsuperuser
- Open localhost:5050 in your browser.
- Register the server.
- In the connection settings:
- Host: postgres-container
- Username: postgres
- Password: your_password
- POST
/api/token/: Log in and receive a JWT token. - POST
/api/token/refresh/: Refresh the JWT token.
- POST
/api/create_user/: Create a new user. - GET/PUT/DELETE
/api/users/<user_id>/: CRUD operations for a specific user. - GET
/api/users/: Retrieve a list of all users.
- GET
/api/weather/current/: Get the current weather at your location. - GET
/api/weather/search/: Get the current weather for a specified location. - GET
/api/weather/forecast/: Get a 7-day weather forecast for a specified location. - GET
/api/weather/current_forecast/: Get a 7-day weather forecast for your current location.