This is a full-stack Django-based web application that integrates the OPENAI API by using the ChatGPT 3.5 Turbo and DALL-E 2 Models to generate random and unique artwork.
This project is live! Check it out here.
- Goals & MVP
- Tech Stack
- Build Steps
- Design Goals
- Project Features
- Additions & Improvements
- Learning Highlights
- Known Issues
- Challenges
The aim of this application is to create a full-stack application in the Django framework that can create random and unique images by leveraging modern tools including the OpenAI API.
- HTML
- CSS
- Django
- Python
- JavaScript
- DALL-E 2 API
- ChatGPT 3.5 Turbo API
- SQLite / Postgres
- AWS S3 Bucket
- Heroku
-
Clone the project from GitHub:
git clone [email protected]:cyberforge1/imageForge.git
-
Register for an OpenAI API key at the following link.
-
Run the
generateSecretKey.py
file in the root directory to create a Django secret key. -
Create a
.env
file in the root directory and attach the values of the keys generated in Steps 1 and 2:OPENAI_API_KEY= replace-this-value SECRET_KEY= replace-this-value
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Install project dependencies with pip:
pip install -r requirements.txt
-
Set up and migrate the SQLite database:
python manage.py migrate
-
Run the application locally:
python manage.py runserver
To create an image, navigate to the generation page and click ‘generate’, then convert the unique prompt into unique art with a button click. The generated images can be viewed in a public gallery or a private history if logged in.
- This project was designed to be a fun and intuitive experience for users to navigate through the application to generate unique artwork.
- A careful selection of backgrounds throughout the application aims to create an immersive user experience.
- The Gallery and User History pages were inspired indirectly by the Instagram platform.
- A user registration and login system
- A collection of local data for creating randomized prompts
- A series of Python scripts that generate prompts and make API requests
- Generation of unique data using the ChatGPT 3.5 Turbo & DALL-E 2 Models
- A full-stack application to display this data
- Addition of delete functionality to the User History page
- Refine the Generation Page background image
- Improve styling on Login and Registration Pages
- Add a download link on modals for images
- Create mobile responsive design and mobile navbar
This project started as a passion project and was my first full-stack application
- Creation of a complete MVC backend
- Implementing API calls, handling the returned data and displaying it in the application
- Setting up local and remote databases
- Solidifying skills in Python scripting
- Deploying a Django application to Heroku
When a user is signed in and has a limited number of images generated, only a partial background image is displayed on the User History page.
- Creating a system that could store the images dynamically so that many users could access and interact with the application simultaneously. This was resolved by attaching an AWS S3 Bucket.
- Correcting the grammar and other inconsistencies of the locally generated prompts. This was resolved by making a call to the ChatGPT API.
- Visit my LinkedIn for more details.
- Check out my GitHub for more projects.
- Or send me an email at [email protected]
Thanks for your interest in this project. Feel free to reach out with any thoughts or questions.
Oliver Jenkins © 2024