Please install PSQL using this link
https://www.timescale.com/blog/how-to-install-psql-on-mac-ubuntu-debian-windows/
.
This is just a reference for installation.
Assuming the following, after installation is complete.
- PSQL is installed
Username : root
Password : root
Database Created via terminal : yogya
- make sure that user has the permission to the database
I personally prefer PyCharm for python, and use VSCode for React / FE Development. Feel free to use the IDE of your choice. I find VSCode to have a lot of autoformatting plugins for FE Development very useful. Similarly, PyCharm (intelliJ) in general has a tonne of Keyboard Shrotcuts, that make developer quality of life much better.
- Postman will be used for API Testing / Development.
- We will be writing a lot of rest apis, and will add all these to Postman for better management.
- Install NVM using this linl
https://github.com/nvm-sh/nvm
- Node will be used for Building React files.
git clone git@github.com:DEV-CRUSADER/yogya.git
cd yogya
-
python -m venv venv
orpython3 -m venv venv
pip install virtualenv
virtualenv venv
-
source ./venv/bin/activate
-
- Please run in command prompt
\venv\Scripts\activate
- Please run in command prompt
pip install -r requirements.txt
Go to .dev
file in env/
folder. Create one if not already present. You can copy one of the existing files and change the name and properties in place.
Update the following properties
DEBUG=True
DB_HOST=localhost
DB_NAME=koffee_local
DB_USERNAME=root
DB_PASS=root
DB_PORT=5432
SITE_URL = "localhost:8000"
ASYNC_EMAILS = False
Comment out, all the other EMAIL_BACKEND, and just use the below one. This will make sure that all emails are shown on the console, and not actually sent to someone's inbox. This will help in local dev and testing.
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
- Kindly note the below commande before perfoming the migrate command
python manage.py makemigrations
python manage.py migrate
python manage.py refresh_permissions
python manage.py fix_roles
python manage.py load_initial_indexes
- Note: before running below command run the above command
python manage.py load_initial_index_data
- This command will take approx 10 minutes, So kindly hold and wait fot sucess message.
- Your device must have internet access before running the above command
python manage.py load_seo
python manage.py runserver
gunicorn core.wsgi:application --bind 0.0.0.0:8000
- Your server would start running on Go to 127.0.0.1:8000 .
- Your server would start running on Go to localhost:8000 .
During development RMQ is not required, and can be disabled by making ASYNC_EMAILS = False
in .dev file
If you wish to see how RMQ workers are behaving, and have not set ASYNC_EMAILS = False
, then you will be doing the following :
- Run RMQ worker, by opening a new terminal, activating virtual environment and executing the following command
celery -A core worker --loglevel=info
- To run the celery beat use this command in the same folder as your project
manage.py
file in another terminalcelery -A core beat -l info
If you are working on React Components, then you will need to run a listener, that keeps on updating bundle.js
, that houses the react app.
We are working with a mixed setup, where both React APP and ServerSide rendered HTML/CSS/JS are being executed together.
The following commands for installing and running auto-compiler for Javascript files.
npm install
npx webpack --config webpack.config.js --mode=development
Keep the second command running, so that it listens to changes to JS files and automatically builds them.
npx webpack --config webpack.config.js --mode=production