Skip to main content

slick Banner Ads for Django

Project description

DJ Banner

🌟 Slick Banner Ads for Django

How to Get Started

  • in first step you need to install dj_banner

      pip install dj_banner
    
  • add dj_banner app to INSTALLED_APPS

      # config.settings.py
      INSTALLED_APPS = [
        ...
        'dj_banner',
        ...
    ]
    
  • add urls to setting urls

    # config.urls.py
    urlpatterns = [
     ...
     path('', include('dj_banner.urls')),
     ...
    ]
    
  • add static directory in settings static

    # config.settings.py
    STATICFILES_DIRS = [
      ...
      'dj_banner/static',
      ...
    ]
    
  • run migrate command

      python manage.py migrate
    
  • setup and load static files in base template

    • add styles

      <link rel="stylesheet" href="{% static 'dj_banner/css/index.css' %}">
      <!-- Or just hardcode the file path -->
      <link rel="stylesheet" href="Path/to/your/index.css">
      
    • add scripts

      <script src="{% static 'dj_banner/js/index.js' %}"></script>
      <!-- Or point directly to the JS file -->
      <script src="Path/to/your/index.js"></script>
      
    • set backend address: Add the domain URL to your template like this

      <script>
          const DJ_BANNER_BACKEND_URL = 'YOUR_BACKEND_ADDRESS' // local(default): http://127.0.0.1:8000
      </script>
      
  • Create Your Objects by DJANGO ADMIN: Build and customize your banner setup:

    • Page: Define the page where your banner will pop up.
    • Banner Style: Pick different styles and sizes for your banner.
    • Banner: The main object where you set all your banner details.

Tip 📝
The default small size for Banner Style is set to 768px, but you can tweak it in the index.js file to whatever vibe you’re going for :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj_banner-1.0.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dj_banner-1.0.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file dj_banner-1.0.0.tar.gz.

File metadata

  • Download URL: dj_banner-1.0.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for dj_banner-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0a1ae5ad3f006318ada12883d65cafc899915746b5dca0b82c903ba939ac6430
MD5 75374a5ed0b793c3be42dcad32879f96
BLAKE2b-256 cb014de86793e6acf7e39983a3457195aad876ae65be0e3fe8fcd285d9aa1097

See more details on using hashes here.

File details

Details for the file dj_banner-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dj_banner-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for dj_banner-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc1b506c4b2f1f7fcc9183cbd9a09043540aca6815490456dfc1966ad7696fff
MD5 3e84b6865474d5c8aee013e7a54134d6
BLAKE2b-256 29e4b62a9523f1a389c2f58e4c6737062cb11f270be6726ee079316c9c2acc89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page