help to create the project - andreasdvorak/running_results GitHub Wiki

initial setup of the environment

create a virtual environment

pip3 install virtualenv

create a virtual environment Linux

virtualenv -p python3 env

create a virtual environment Windows

python3 -m venv env

The result is the folder "env"

activation of virtual environment

Linux

. env/bin/activate

normal Windows terminal

env\Scripts\activate.bat

Windows PowerShell

env\Scripts\Activate.ps1

stop environment

Linux deactivate

Windows

env\Scripts\deactivate.bat

pip

Upgrade pip

python -m pip install --upgrade pip

Installation django

python -m pip install django

Installation of bootstrap

https://pypi.org/project/django-bootstrap-static/

pip install django-bootstrap-static

https://getbootstrap.com

freeze the dependencies to a requirements file.

python -m pip freeze > requirements.txt

install the requirements on the destination host

python -m pip install -r requirements.txt

check version

python -m django version

Create project

django-admin startproject running_results

Start

python manage.py runserver

http://127.0.0.1:8000/

Apps

resultsapp

app to manage the results and the additional data

python manage.py startapp resultsapp

Administration

http://127.0.0.1:8000/admin

Create a superuser

python manage.py createsuperuser

create a data model for python

python manage.py makemigrations

create the database structure

python manage.py migrate

Requirements:

  • The directories migrations in very app folder
  • below the empty file init.py

Python shell

python manage.py shell

Documentation

django-bootstrap

https://django-bootstrap4.readthedocs.io/en/latest/

django-environ

https://django-environ.readthedocs.io/en/latest/