🚀
ShipWithDjango Documentation
  • Welcome to ShipWithDjango Documentation
  • When and How to use ShipWithDjango?
  • Getting Started
    • Obtaining a license
    • Downloading ShipWithDjango
    • Running locally
    • Next steps
  • Platform
    • Default Configuration
    • Subnavigation
  • Theme
    • Tailwind CSS
    • Configuration
  • Secret Management
    • Default Configuration
    • Setting your environment variables
    • Third-party providers
      • Infisical
      • AWS Secrets Manager
      • Azure Key Vault
    • Order of retrieval
  • Authentication
    • Default Configuration
    • GitHub
    • LinkedIn
  • Emailing
    • Default Configuration
    • Using SendGrid
    • Using SMTP
    • Using the task queue for sending emails
  • Payments & Billing
    • Billing
    • Stripe
  • OpenAI/Dall-E
    • Default Configuration
  • API
    • Django REST framework
    • Built-in API utilities
    • Postman
  • Logging
    • Default Configuration
    • Using Sentry
    • Using Better Stack
  • Localization
    • Translations
Powered by GitBook
On this page
  • Setting the OpenAI API Key
  • Summary
  1. OpenAI/Dall-E

Default Configuration

PreviousStripeNextDjango REST framework

Last updated 9 months ago

ShipWithDjango provides the capability to integrate with OpenAI's powerful tools, including DALL-E for generating images from textual descriptions. To use these features, you need to configure your OpenAI API key.

The configuration settings for OpenAI are managed in the CONFIG/openai.py file.

Setting the OpenAI API Key

To enable the integration with OpenAI, you need to set the OPENAI_API_KEY variable in your environment variable. This key is essential for authenticating your requests to OpenAI's API, allowing your application to leverage the capabilities of OpenAI models, including DALL-E.

OPENAI_API_KEY = secret_manager.get_secret('OPENAI_API_KEY')

Obtaining Your OpenAI API Key

  1. Sign Up or Log In: If you don't already have an OpenAI account, you'll need to sign up at . If you have an account, log in.

  2. API Key Access: Once logged in, navigate to the API section of your account where you can generate a new API key.

  3. Set the API Key: Copy the generated API key and set it your OPENAI_API_KEY environment variable.

Using OpenAI and DALL-E in Your Application

Once your API key is configured, your application will be able to interact with OpenAI's services. This includes generating images with DALL-E based on textual input, which can be a powerful feature in various use cases, from creative projects to dynamic content generation.

Security Considerations

It's important to keep your OpenAI API key secure. Do not expose this key in public repositories or share it openly. In ShipWithDjango, the secret_manager handles the retrieval of sensitive information, such as your API key, ensuring it is stored securely.

Summary

To enable OpenAI integration in ShipWithDjango:

  1. Set the OPENAI_API_KEY variable in your environment.

  2. Ensure that your API key is kept secure and is not exposed publicly.

With these steps, you can unlock the full potential of OpenAI and DALL-E within your ShipWithDjango project, enabling advanced AI-driven features and capabilities.

Obtain your OpenAI API key from .

Find out here how you can set your OpenAI API key as an environment variable.
OpenAI's website
OpenAI's website