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_bannerpip install dj_banner
-
add
dj_bannerapp toINSTALLED_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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters