Django Project with Django REST Framework, SimpleJWT, Cockroachlabs, Astra Cassandra, Redis, and R2 Cloudflare
This project is a Django application that utilizes Django REST Framework and SimpleJWT for authentication. It uses Cockroachlabs as the main database, Astra Cassandra as the secondary database, Redis for caching, and R2 Cloudflare for storage.
Ensure you have the following before setting up the project:
-
Install the required Python packages:
pip install -r requirements.txt
-
Collect static files:
python manage.py collectstatic
-
Make migrations for the Django models:
python manage.py makemigrations
-
Apply the migrations to the main database:
python manage.py migrate
-
Sync the schema to the Astra Cassandra database:
python manage.py sync_cassandra
Start the Django development server:
python manage.py runserver
Docker Deployment You can also deploy the project using Docker and docker-compose with Nginx. Follow the steps below:
Build and start the containers:
docker compose up --build
The application should now be running and accessible at http://localhost.
Database Settings Ensure you have set up your database configurations in the settings.py and .env file for Cockroachlabs and Astra Cassandra.
Redis Configuration Configure Redis in your settings.py and .env file to use Upstash.
Cloudflare R2 Configuration Set up Cloudflare R2 for storage in your settings.py and .env file.