Ticket Price - ₹ {{movie.price}}
Session - {{movie.category.category_name}}
???? Book
{% endfor %} {% endblock %}
Register.html : This HTML page is used to collect user information and use it to register users.
{% extends "base.html" %} {% load static %} {% block start %} {% if messages %} {% for message in messages %} {{ message }} {% endfor %} {% endif %} {% csrf_token %}
Already have an Account
{% endblock %}
Cart.html : It displays relevant information such as serial number, ticket cancellation options, photos, movie name and link to pay. This dynamic content is generated based on the items in the user's cart.
{% extends "base.html" %} {% load static %} {% block start %}
{% for cartItems in carts.cart_items.all %} {% endfor %}
S.No. | Cancel Toicket | Book | Movie Name | Watch |
---|---|---|---|---|
{{forloop.counter}} | ???? Cancel Tickets | {{cartItems.movie.movie_name}} | ???? Pay Now | |
{% endblock %}
Urls.py : This code is responsible for routing and serving web pages in the Django application when handling media files and static files based on the application's settings.
from django.contrib import admin from django.urls import path from home.views import * from django.conf.urls.static import static from django.conf import settings from django.contrib.staticfiles.urls import staticfiles_urlpatterns urlpatterns = [ path('', home, name='home'), path('cart/', cart, name='cart'), path('remove_cart_item/', remove_cart_item, name='remove_cart'), path('add_cart/', add_cart , name="add-cart"), path('login/', login_page, name="login"), path('register/', register_page, name="register"), path("admin/", admin.site.urls), ] if settings.DEBUG : urlpatterns +=static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) urlpatterns += staticfiles_urlpatterns()
Run this command to apply the migration:
python3 manage.py makemigrations python3 manage.py migrate
Run this server with the help of the following command:
python3 manage.py runserver
Result:
Hope this article is useful to you!