Skip to content

Latest commit

 

History

History
86 lines (59 loc) · 1.17 KB

Process.md

File metadata and controls

86 lines (59 loc) · 1.17 KB

Create a virtual environment

python -m venv ./fakeurlgenerator

Activate the virtual environment

cd fakeurlgenerator/scripts
activate

Installing Django and creating the django project

pip install django
django-admin startproject fakeurlgenerator
cd fakeurlgenerator

Create an app for maintaining urls

django-admin startapp app

Update Settings.py

  1. Environments
import os
from dotenv import load_dotenv
load_dotenv()
  1. Installed Apps
'app',
  1. Middlewares
'whitenoise.middleware.WhiteNoiseMiddleware',
  1. STATICFILES STORAGE (for production)
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  1. Templates
  • For connecting the HTML, Javascript
'DIRS': [os.path.join(BASE_DIR,'templates')],
  1. Static Files
  • For Connecting the css
STATIC_URL = 'static/'
STATIC_ROOT = os.path.join(BASE_DIR,'statifiles')
STATICFILES_DIRS = [os.path.join(BASE_DIR,'static')]
  1. Set Allowed Hosts and Debug For Production

Installation

pip install python-dotenv whitenoise gunicorn

Start the Server

python manage.py runserver