Skip to content

calindoran/todo-python-api

Repository files navigation

todo-python-api

This is a todoAPI using Python, Django, SQLite and Docker

1. Use the IDE to jump into a python venv

Running this project in a python venv and use pip to install our deps.

python -m venv venv
.\venv\Scripts\activate // for windows
source venv/bin/activate // for mac
pip install -r requirements.txt

Run Migrations

python manage.py makemigrations
python manage.py migrate

Run the server

python manage.py runserver

Create superuser

python manage.py createsuperuser

To jump out of our venv and back to our host machine.

deactivate

2. Use Docker compose

Use docker-compose.yml

docker-compose up --build
docker-compose down

To check the status of your Docker container

docker container ls

Run migrations

docker-compose run web python manage.py migrate

3. Access Your Application

Once the container is up and running, you can access your Django application at http://localhost:8000.

Access Swagger UI

Open your browser and navigate to http://localhost:8000/swagger/ to view the Swagger UI. You should see your API endpoints documented and available for testing.

Alternatively, you can view the ReDoc documentation at http://localhost:8000/redoc/.

Other commands for cleaning up

docker rm container_name
docker image rm image_name
docker system prune
docker images prune

Check folder size:

du -sh *

About

A Python Django API using Docker and Render to host and provide the api.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published