Skip to content

Latest commit

 

History

History
71 lines (45 loc) · 1.36 KB

SETUP.md

File metadata and controls

71 lines (45 loc) · 1.36 KB

How to set up this repository (Debug Mode)

  • Clone this repository.
git clone https://github.com/MagnumDingusEdu/django-templating-boilerplate
  • Set up your virtual environment
# Generate the neessary files
python -m venv env
OR
virtualenv env


# Activate the virtual environment
source env/bin/activate


# Install required packages
pip install --upgrade pip && pip install wheel
pip install -r src/requirements.txt
  • Set up environment variables
# Copy the environment variable file
cp src/.env.debug src/.env


# Generate a secure secret key using the uuid module
sed "s/your-secret-key/$(python -c 'import uuid; print(str(uuid.uuid4()));')/" src/.env -i


# Set the environment variables in your terminal sesssion
while read line; do export $line; done < src/.env
  • Set up your project
# Change to the ./src directory
cd ./src
  • Generate and populate database
# To ensure changes in models.py are reflected
python manage.py makemigrations


# Populate the database tables
python manage.py migrate


# Change the name of the project from boilerplate to something of your choice
python manage.py renameproject <oldname> <newname>
  • Run the debug server
python manage.py runserver

The django development server will run at the default port 8000. Open http://localhost:8000 to view it in the browser.