Codebase for Official PizzaPy Website
Python dependencies:
python -m venv venv # creates a Virtual Environment inside the /venv directory
./venv/Scripts/activate # activates the venv, to exit, type "deactivate" || for MAC: source venv/bin/activate
pip install -r requirements.txt # installs all the Python dependenciesJavaScript dependencies:
cd PizzaPyWebApp/js_lib
npm install- You'll need two environment variables to be able to run the
manage.py runservercommand. If you're using VSCode, run these commands:
npx shx cp PizzaPyWebApp/.env.example PizzaPyWebApp/.env # copies .env.example to .env
code PizzaPyWebApp/.env # opens your editor for .env- If you don't use VSCode, just edit the newly created
.envfile manually.
-
Next, you'll need to replace the
check-jira-references-columnvalues with the values found in Jira. -
The next section should work without issues, otherwise ask the maintainers for help.
Warning
Ensure you've set up the .env file with the proper values found in Jira before proceeding!
Once you've installed the dependencies, you can now run the application or build scripts.
cd PizzaPyWebApp/
python manage.py runserverIf you want to watch for TailwindCSS changes, run the following commands in another terminal instance:
cd PizzaPyWebApp/js_lib/
npm run watchThis will create a /PizzaPyWebApp/static/css/output.css stylesheet based on the /PizzaPyWebApp/js_lib/input.css file.
Django setup
django-admin startproject project_name
python manage.py startapp app_name
Writes all python dependecies for tracking only (and deployment)
python -m pip freeze > requirements.txt
Installing of packages
pip install package_name
For production to collect static files
python manage.py collectstatic
Removing files from the repo and not locally
directory
git rm --cached -r venv
rm 'venv'
files
git rm --cached venv
rm 'venv'
do the git ignore and remove at the same the time
git rm --cached (git ls-files -i -c -X .gitignore)
rm 'venv'
rm '/PizzaPyWebApp/js_lib/node_modules'- To build the container, Run
docker build -t pizzapy-website . - To run the container, use
docker run -d -p 8000:8000 pizzapy-website - Visit
http://localhost:8000to view the site