Skip to content

lopentusska/postgram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postgram

Used technologies:

Django

Django REST

React

Start the project:

Clone the repository

git clone [email protected]:lopentusska/postgram.git

Create .env file with the following script

cd postgram/
echo '''DB_NAME=postgram_db
POSTGRES_USER=postgram_user
POSTGRES_PASSWORD=postgram_password
DB_HOST=localhost
DB_PORT=5432
DJANGO_SECRET_KEY=your_secret_key
DJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS=127.0.0.1 localhost
DJANGO_CORS_ALLOWED_ORIGINS=http://localhost:3000 http://127.0.0.1:3000
REDIS_LOCATION=redis://127.0.0.1:6379/1''' > .env

Run project in docker:

docker compose up -d

wait some time to let docker build containers

logs:

docker logs <container_name> -f

stop containers:

docker compose down

Run locally:

Start backend

postgresql

sudo su postgres
psql
CREATE DATABASE postgram_db;
CREATE USER postgram_user WITH PASSWORD 'postgram_password';
GRANT ALL PRIVILEGES ON DATABASE postgram_db TO postgram_user;
ALTER USER postgram_user CREATEDB;

Create venv and install requirements.txt

cd backend/
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

Run migrations and start server

python manage.py migrate
python manage.py runserver

Optionally create superuser

python manage.py createsuperuser

Start frontend

cd frontend/
yarn install
yarn build
yarn start

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published