/DjangoTest

Simple Django project setup

Primary LanguagePython

Setting up the project

Virtual environment setup

python3 -m venv .venv
source ./.venv/bin/activate

Installing django through pip

pip install django
pip install django-debug-toolbar

Running the project

cd tutorial

Before running the project, making the necessary migrations is required:

python3 manage.py makemigrations polls
python3 manage.py migrate

Now we are able to run the server

python3 manage.py runserver

Opening the shell

python3 manage.py shell

Running tests

python3 manage.py test polls

Using coverage

# Installation on the virtual environment
pip install coverage
# Running tests and gathering coverage data
coverage run --source='.' manage.py test polls

# Showing results
coverage report

Modifying the default admin page

The admin override template files must be placed in tutorial/templates/admin/ folder. In order to override the default admin templates, you must first find the original in this repo, copy and paste it to the previous mentioned folder and do the modifications.

References

This project follows the official django tutorial