- Download this repository
- Option 1
- Install git
- Clone this repository
git clone https://github.com/Yu-Leo/public-notes.git cd public-notes
- Option 2 - Download ZIP
- Option 1
- Copy
/.env.example
to/.env
,/.env.dev
and/.env.localdev
.env
file - for run project in production mode (using Docker compose).env.dev
file - for run project in development mode (using Docker compose).env.localdev
file - for development and run on a local machine:
- Add your configurations in them
DJANGO_DEBUG
- Run in DEBUG mode or not (set 1 or 0). Default 0.DJANGO_SECRET_KEY
- SECRET_KEY for the Django config- Settings for sending e-mail:
EMAIL_HOST
EMAIL_PORT
EMAIL_HOST_USER
EMAIL_HOST_PASSWORD
- Settings for database (optional):
DB_ENGINE
(defaultdjango.db.backends.sqlite3
. For using PostgreSQL:django.db.backends.postgresql
)DB_NAME
(defaultos.path.join(BASE_DIR, 'db.sqlite3')
)DB_HOST
DB_PORT
DB_USER
DB_PASSWORD
- Settings for PostgreSQL (for run using Docker compose):
POSTGRES_DB
POSTGRES_USER
POSTGRES_PASSWORD
Now you can:
- Run in production mode using Docker compose
- Run in development mode using Docker compose
- Setting up for development and run on a local machine
docker-compose up --build
docker-compose run web ./publicnotes/manage.py migrate
docker-compose -f docker-compose.yaml -f docker-compose.dev.yaml up --build
docker-compose run web ./publicnotes/manage.py migrate
SQLite3 will be used by default
- Create a virtual environment in the project repository
python3 -m venv venv
- Activate the virtual environment
source venv/bin/activate
- Install project dependencies
pip install -r requirements.txt
- Compile phrase translations
- Install
gettext
:
sudo apt-get install gettext
- Run in
publicnotes
folder:
django-admin compilemessages
- Install
- Apply migrations
./publicnotes/manage.py migrate
- Run the server
./publicnotes/manage.py runserver