- Python 3.6 or higher
- Copy .env.example to .env
cd eeet2582_backend && cp .env.example .env
- Install openssl
brew install openssl
- Add path to openssl to bash profile
- Install required packages
pip3 install virtualenv
pip3 install psycopg
- Create new database (required that postgres is installed)
- Open psql shell
psql
- Create new database
CREATE DATABASE eeet2582_backend;
- Go back to project directory and run migrations
poetry install && poetry run manage.py migrate
- Finally, run the server
poetry run manage.py runserver
- Create superuser (I'm using admin as username and password)
poetry run manage.py createsuperuser
- Go to http://localhost:8000/admin/ and login with the superuser credentials
poetry run manage.py runserver
- Download & install choco package manager by following instruction from this link.
- Use choco to install OpenSSL. Please open the powershell in administration mode
choco install openssl
- Add path to openssl to win environment path (if the path is not added automaticly)
- create new variable named as "OPENSSL_CONF" and add this path C:\Program Files\OpenSSL-Win64\bin\openssl.cfg as the its value.
- Install required packages
pip3 install virtualenv
pip3 install psycopg
- Create new database (required that postgres is installed)
- Open psql shell
psql -U postgres
-
if the command isn't recognized, please add C:\Program Files\PostgreSQL\16\bin to the systen environemnt path
-
Create new database
CREATE DATABASE eeet2582_backend;
- check if the database is created successfully
\l
- Go back to project directory and run migrations
- install poetry dependecy management (if not)
pip3 install poetry
- install the project && migrating the database
poetry install && poetry run python manage.py migrate
- Finally, run the server
poetry run python manage.py runserver
- Create superuser (I'm using admin as username and password)
poetry run python manage.py createsuperuser
- Go to http://localhost:8000/admin/ and login with the superuser credentials
poetry run python manage.py runserver
- Install Redis
brew install redis
- Start Redis
brew services start redis
- Run Celery (in a new terminal)
celery -A eeet2582_backend worker --loglevel=info
- Flush Redis(only do to reset redis)
redis-cli flushall
- After runing the server locally on port 8000
- download the ngrok.exe
- add authenticated token
ngrok config add-authtoken 2a1bssHACk98o1MV40hwaWna3TS_NpUqCqMpqfookK7DJaxb
- run ngrok at reserved domain
ngrok http --domain smiling-narwhal-remotely.ngrok-free.app 8000
sudo apt install python3.12-dev sudo apt-get install libpq-dev