Live Demo: https://django-task-bgej.onrender.com/
- User signup, login, logout
- Create, edit, delete blog posts (with image upload)
- View all posts and post details
- Contact form with email notification
- JWT authentication endpoints for API
- Cloudinary integration for media/image storage
- Python 3.13+
- pip
- Cloudinary account (for image hosting)
-
Clone the repository
git clone <your-repo-url> cd DJANGO TASK
-
Create and activate a virtual environment
python -m venv env .\env\Scripts\Activate.ps1 -
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
- Copy
.env.exampleto.env(or create.envinmyblog/) - Add your Cloudinary credentials:
CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret - Set your Django
SECRET_KEYand other settings as needed.
- Copy
-
Run migrations
python manage.py makemigrations python manage.py migrate
-
Create a superuser (admin)
python manage.py createsuperuser
-
Start the development server
python manage.py runserver
Visit http://127.0.0.1:8000/
- This project is deployed on Render.
- To deploy, push your code to your Render repo and set all required environment variables in the Render dashboard.
- Run migrations after each deploy:
python manage.py migrate
- JWT Auth:
POST /api/auth/token/(get access/refresh tokens)POST /api/auth/token/refresh/(refresh access token)
- Blog post CRUD via web UI
- All images are stored on Cloudinary. You must set your Cloudinary credentials in
.env.
- Cloudinary errors: Make sure your
.envfile is correct and in themyblog/folder. - Database errors: Always run migrations after deploying or changing models.
- Static/media files: In development, media is served automatically. In production, use Cloudinary for all uploads.
MIT
For questions or issues, open an issue in the repository or contact the maintainer.