/SocialRep

Primary LanguageJavaScript

Project SocialRep

First Use

Prefer use in Docker instead set up your environment.

Install pip

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Reference: https://pip.pypa.io/en/stable/installing/

Create virtual environment

python -m pip install venv
python -m venv venv

Active virtual env

For Linux

source venv/Scripts/active

For Windows Prompt

venv\Scripts\active.bat

For Windows PowerShell

venv\Scripts\active.ps1

Reference: https://docs.python.org/pt-br/3/library/venv.html

Install dependencies

pip install -r src/requirements.txt

Make migrations

python manage.py makemigrations

Reference: https://docs.djangoproject.com/en/3.2/topics/migrations/

Migrate

python manage.py migrate

Create admin user

python manage.py createsuperuser

To run in Docker

Build the image

docker build -t socialrep .

Before build in Windows, it's need change the line separator in docker-entrypoint.sh file to LF instead CRLF.

Execute the container

docker run --name socialrep -d -e SECRET_KEY=test -e DEBUG=True -p 80:8000 socialrep

Reference: https://docs.docker.com/engine/reference/commandline/run/

Now you can access the web application in your localhost

Environment Variables

Env. Variables Values Examples Descriptions
ALLOWED_HOSTS IPv4/IPv6 IP Address or HostName 192.168.0.101,127.0.0.1,[::1] https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/#allowed-hosts
DEBUG True or False True https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/#debug
SECRET_KEY String my_secret_key https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/#secret-key