Skip to content

Upskill-club is a Django-based project that serves the APIs for course management, utilizing Django Rest Framework (DRF).

License

Notifications You must be signed in to change notification settings

SourabhJaz/upskill-club

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Upskill-club

A Django-based project designed to serve course-related APIs using Django Rest Framework (DRF). It supports a set of APIs that expose course categories, courses, sessions, and concepts, with all course data populated by the Django admin panel.

Features

  • Course Management: Define course categories, courses, and sessions.
  • API Powered by DRF: Expose data through REST APIs with rate limiting.
  • File Upload Support: Upload and serve media files such as thumbnails for courses and sessions.
  • Admin Panel: Content creation and management is handled through the Django admin interface.

Environment Variables

Make sure to set the following environment variables in your .env file:

  • SECRET_KEY: Django secret key for your application.
  • ADMIN_URL: Custom URL for accessing the Django admin panel.

Installation and Setup

  1. Clone the Repository:
    git clone <repository-url>
  2. Create Virtual Environment:
python -m venv venv
source venv/bin/activate  # For Linux/macOS
venv\Scripts\activate     # For Windows
  1. Install Dependencies
pip install -r requirements.txt
  1. Run Migrations
python manage.py migrate
  1. Create Superuser
python manage.py createsuperuser
  1. Run the Development Serve
python manage.py runserver

Access Admin Panel

Navigate to the admin URL (set via ADMIN_URL in your .env file or use the default /admin/).

API Endpoints

  • Categories: /api/categories/
  • Courses: /api/courses/
  • Sessions: /api/sessions/
  • Concepts: /api/concepts/

Configuration

CORS Setup

Allow CORS requests from your frontend (e.g., GitHub Pages) by setting the allowed origins in CORS_ALLOWED_ORIGINS in settings.py.

CORS_ALLOWED_ORIGINS = [
    "https://youralloweddomain.com",
]

Rate Limiting

Anonymous users are limited to 1000 requests per minute, while authenticated users are limited to 100 requests per day.

REST_FRAMEWORK = {
    'DEFAULT_THROTTLE_CLASSES': [
        'rest_framework.throttling.AnonRateThrottle',
        'rest_framework.throttling.UserRateThrottle'
    ],
    'DEFAULT_THROTTLE_RATES': {
        'anon': '1000/min',
        'user': '100/day'
    }
}

Media Files

Uploaded media files are stored in the media/ directory. Make sure the MEDIA_ROOT and MEDIA_URL are configured correctly in settings.py.

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Upskill-club is a Django-based project that serves the APIs for course management, utilizing Django Rest Framework (DRF).

Topics

Resources

License

Stars

Watchers

Forks

Languages