This project now supports file uploads for various media types:
- Artist Images: Upload images for artists
- Album Cover Images: Upload cover images for albums
- Track Audio Files: Upload audio files for tracks
- Ad Campaign Videos: Upload videos for ad campaigns
All uploaded files are stored in the media/ directory at the project root, organized in subdirectories:
- Artist images:
media/artists/ - Album cover images:
media/albums/ - Track audio files:
media/tracks/ - Ad campaign videos:
media/ads/
Files are automatically renamed using UUID to prevent filename conflicts.
To test file uploads:
- Navigate to the appropriate form (e.g., ad campaign upload form)
- Select a file to upload
- Submit the form
- The file will be uploaded to the appropriate directory
The project uses placeholder SVG graphics from the static directory when no images are available.
If you want to use the Pexels API for placeholder images:
- Get a Pexels API key from Pexels API
- Add your API key to the
.envfile:PEXELS_API_KEY=your_pexels_api_key_here - If you don't have python-dotenv installed, you can install it with:
Then uncomment the dotenv loading code in
pip install python-dotenvtfn_ctv/settings.py
- Django 5.2.1
- For image processing (optional): Pillow
pip install Pillow - For fake data generation:
pip install Faker requests
The project includes a faker factory to load the database with sample data. This is useful for development and testing purposes.
To generate fake data, run the following command:
python manage.py generate_fake_dataThis will create:
- 10 genres
- 20 artists with images from Unsplash
- 30 albums with cover images from Unsplash
- 100 tracks
- 15 users
- 10 ad campaigns with video placeholders from Unsplash
- 5 service requests
You can customize the number of entities to create by using the following options:
python manage.py generate_fake_data --genres 5 --artists 10 --albums 15 --tracks 50 --users 8 --ad_campaigns 5 --service_requests 3All form submissions are sent to the development email specified in settings.py. By default, this is set to developer@tfnms.co.
The email backend is set to console backend for development, so emails will be printed to the console instead of being sent.
To change the development email, update the DEVELOPER_EMAIL setting in tfn_ctv/settings.py.