Skip to content

Danialslm/virgool_clone

Repository files navigation

Virgool clone

A clone of virgool blog written in django

postgres django docker swagger


Installation

first rename the .env.sample to .env and fill it.

with docker

  • docker-compose up --build to build the images and run the project in dev mode.

without docker

  1. create a virtualenv by running virtualenv -p python3 .venv. if you don't have virtualenv, install it by pip pip install virtualenv
  2. activate the virtualenv source .venv/bin/activate in Linux/Mac or .venv\Scripts\activate in Windows.
  3. install the dependencies by running pip install -r requirements.txt.
  4. migrate the migration files by running python manage.py migrate
  5. run the server on localhost by running python manage.py runserver

Endpoints

you can see the project endpoints in /swagger or /redoc

Internationalization

For all texts in project, I used gettext_lazy. so you can run makemessages to translate the texts.

Note that replace lang with your language abbreviation.

with docker

docker-compose exec blog_django python manage.py makemessages -l lang

without docker

python manage.py makemessages -l lang

Then find django.mo file in locale/lang/LC_MESSAGES and fill it by your language.

Compiling messages

It's time to compile the django.mo file to use translated texts.

with docker

docker-compose exec blog_django python manage.py compilemessages

without docker

python manage.py compilemessages

hope to enjoy the project :)