Basic template of Django web framework in Python using HTML, JS and SASS.
- Make sure you have python3.8 (or higher) and clone this repository:
> git clone https://github.com/maxu-s/spp-website
> cd spp-website
- Create a virtual environment then install the required packages:
> python -m venv venv
> pip install -r requirements.txt
- Activate virtual enviroment from your terminal system:
> cd path/to/your/repository
> source venv/bin/activate # on Linux/macOS
> venv\Scripts\activate # on Windows
- To keep sensitive information out of the code, environment variables are stored in a .env file. You will need to create this file manually. Create a file named
.env
in the root of your project (where manage.py is located) and add the following content to it:
DJANGO_SECRET_KEY='print-your-web-key-here'
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1,
- Replace
print-your-web-key
with your actual DjangoSECRET_KEY
. Generate that key using:
> python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
- Run the following commands to apply the migrations and start the server:
> python manage.py collectstatic
> python manage.py migrate
> python manage.py runserver