Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derder3010/django-cockroach-astra
Django Project with Django REST Framework, SimpleJWT, Cockroachlabs, Astra Cassandra, Redis, and R2 Cloudflare
https://github.com/derder3010/django-cockroach-astra
astra cassandra cloudflare cockroach django django-rest-framework python
Last synced: 23 days ago
JSON representation
Django Project with Django REST Framework, SimpleJWT, Cockroachlabs, Astra Cassandra, Redis, and R2 Cloudflare
- Host: GitHub
- URL: https://github.com/derder3010/django-cockroach-astra
- Owner: derder3010
- Created: 2024-07-12T15:40:02.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-12T15:59:53.000Z (4 months ago)
- Last Synced: 2024-09-30T04:02:15.816Z (about 1 month ago)
- Topics: astra, cassandra, cloudflare, cockroach, django, django-rest-framework, python
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
## Prerequisites
Ensure you have the following before setting up the project:
- Python 3.9+
- [Cockroachlabs account](https://www.cockroachlabs.com/get-started-cockroachdb/)
- [Astra account](https://astra.datastax.com/register)
- [Redis (Upstash) account](https://upstash.com/)
- [Cloudflare account](https://dash.cloudflare.com/sign-up)## Installation
### Pre-Run Commands
1. Install the required Python packages:
```bash
pip install -r requirements.txt
```2. Collect static files:
```bash
python manage.py collectstatic
```3. Make migrations for the Django models:
```bash
python manage.py makemigrations
```4. Apply the migrations to the main database:
```bash
python manage.py migrate
```5. Sync the schema to the Astra Cassandra database:
```bash
python manage.py sync_cassandra
```### Running the Server
Start the Django development server:
```bash
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:
```bash
docker compose up --build
```The application should now be running and accessible at http://localhost.
### Configuration
**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.