Skip to main content

A Django app to integrate event calendar.

Project description

===== Django_event_cal

Django_event_cal is a Django app to intergrate event calendar to your app. users can click a specific date and see events and also can create, edit and delete events.

Installation

Stable version: pip install django_event_cal

Documentation

Usage

  1. Add "django_event_cal" to your INSTALLED_APPS setting like this:
    INSTALLED_APPS = [
        ...
        'django_event_cal',
    ]
  1. Include the django_event_cal URLconf in your project urls.py like this:
    path('', include("django_event_cal.urls")),
  1. Run python manage.py migrate to create the events models.

  2. run import inside views.py like this:

    from django_event_cal.functions import cal_context
  1. call cal_context function inside desired view like this and pass your context dictionary, it will return a context with additional event calendar values dictionary:
    def index_view(request):
        context = {}
        context = cal_context(context) #add this line
        return render(request,"base/index.html",context)
  1. add {% include 'events_cal/event.html' %} inside the template where you want the calendar and events:
    {% include 'events_cal/event.html' %}
  1. Start the development server and visit http://127.0.0.1:8000/admin/ to create a poll (you'll need the Admin app enabled).

  2. Visit http://127.0.0.1:8000/polls/ to participate in the poll.

Month navigation

  1. accept two parameters in ur desired url:
    urlpatterns = [
        path("<int:year>/<str:month>/",views.index_view,name="index"),
    ]
  1. receive them in your view and pass additional arguments to the cal_context function like this:
    def index_view(request,year,month):
        context = {}
        context = cal_context(context,year,month,True) #add this line
        return render(request,"base/index.html",context)

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

django_event_cal-0.2.tar.gz (10.5 kB view details)

Uploaded Source

File details

Details for the file django_event_cal-0.2.tar.gz.

File metadata

  • Download URL: django_event_cal-0.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.1

File hashes

Hashes for django_event_cal-0.2.tar.gz
Algorithm Hash digest
SHA256 e20a5bf7e874189f9632efc9544adc7e17b9bd0160d1cd4b1876b7728295ed34
MD5 d65b2ac88f4153e23cf5fa5f05f6007e
BLAKE2b-256 ef51704d0216b47adf8ebbfaae5cbb0b00681667fb9357ba1be4a8836a25daa1

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