Install PostgreSQL
- sudo apt-get update
- sudo apt-get install postgresql postgresql-contrib
Start PostgreSQL
- sudo service postgresql start
Check PostgreSQL status
- sudo systemctl status postgresql
Create a new database
- sudo -u postgres psql
- CREATE DATABASE corestack;
Create a new user
- sudo -u postgres psql
- create user corestack_user with password 'your_password';
- GRANT USAGE, CREATE ON SCHEMA public TO corestack_user;
- ALTER DATABASE corestack OWNER TO corestack_user;
- ALTER USER corestack_user WITH SUPERUSER; (Optional, only if you want superuser rights)
If you want to install directly from a conda snap of environment.yml
conda env create -f environment.yml --verbose
This will create a new conda environment called black with all the dependencies specified in the environment.yml file.
After the successfull installation of all the packages, run the following commands to start the Django server:
- conda activate black (or whatever is the name of your virtual environment)
- python manage.py runserver
Make Migrations
- Make sure the environment is active. Otherwise, run
conda activate black
- Run
python manage.py migrate
For any migration related queries, please send an email to contact@core-stack.org
Run the server
- Make sure the environment is active. Otherwise, run
conda activate black
- Run
python manage.py runserver
Tip: To make local hits to your server, use
python manage.py runserver 0.0.0.0:8080
Running celery
If you are running some tasks, you need to run celery -A tasks worker -l info
example:
celery -A nrm_app worker -l info -Q nrm &
nrm queue is running in this example.
- Use .env.example as a template to create .env file inside nrm_app/ directory
- Update the environment variables
- Add JSON files inside the data/ directory