Skip to content

Manny2706/DJANGO-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini Blog Django Project

Live Demo: https://django-task-bgej.onrender.com/

Features

  • 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

Getting Started (Local Development)

Prerequisites

Setup

  1. Clone the repository

    git clone <your-repo-url>
    cd DJANGO TASK
  2. Create and activate a virtual environment

    python -m venv env
    .\env\Scripts\Activate.ps1
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment variables

    • Copy .env.example to .env (or create .env in myblog/)
    • 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_KEY and other settings as needed.
  5. Run migrations

    python manage.py makemigrations
    python manage.py migrate
  6. Create a superuser (admin)

    python manage.py createsuperuser
  7. Start the development server

    python manage.py runserver

    Visit http://127.0.0.1:8000/

Deployment

  • 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

API Endpoints

  • JWT Auth:
    • POST /api/auth/token/ (get access/refresh tokens)
    • POST /api/auth/token/refresh/ (refresh access token)
  • Blog post CRUD via web UI

Media/Image Storage

  • All images are stored on Cloudinary. You must set your Cloudinary credentials in .env.

Troubleshooting

  • Cloudinary errors: Make sure your .env file is correct and in the myblog/ 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.

License

MIT


For questions or issues, open an issue in the repository or contact the maintainer.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors