delco97 / django-playground

A quick way to start experimenting with django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Playground

A simple Django project to play around with Django features.

Warning: This project is not meant to be used in production !!!

Key Features

This simple project use the following libraries:

  • djangorestframework: for building APIs
  • django: the web framework
  • pytest-django: for testing

Requirements

Useful commands

docker-compose and docker are your best friends here! Check the official documentation for more information. Here below some useful commands:

# Build required images
docker-compose build 
# Build required images without using caching
docker-compose build --no-cache
# Run a command inside the container
docker-compose exec web <command>
# Add a new python package 
docker-compose exec web poetry add <package_name>
# Run all tests
docker-compose exec web pytest
# Run a specific test
docker-compose exec web pytest server/tests/tests_school/test_views.py::test_create_course
# Start the project
docker-compose up
# Cleanup docker stuff related to this project
docker-compose down -v --remove-orphans --rmi all
docker rmi -f $(docker-compose images -q) 2>/dev/null

Pycharm setup

  • Run configurations are shared django-playground/.idea/runConfigurations, so hopefully pycharm should work out of the box 🤞🏻

  • Create a remote python interpreter using the docker-compose service web

    img.png img-2.png

  • Make sure to have the following run configurations img_3.png img_4.png img_5.png img_6.png img_7.png

  • Make sure to have the following settings: img_8.png img_9.png img_10.png

About

A quick way to start experimenting with django


Languages

Language:Python 95.0%Language:Dockerfile 3.4%Language:Shell 1.6%