diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..367dc61 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..864de42 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fa..37abe7a 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf..d636096 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 8c38f3f..43876c3 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,4 @@ from django.contrib import admin +from .models import Movie -# Register your models here. +admin.site.register(Movie) \ No newline at end of file diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..131e0f6 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# Generated by Django 5.2.7 on 2025-11-23 13:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Movie', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('description', models.TextField()), + ('genre', models.CharField(max_length=100)), + ('thumbnail_url', models.URLField()), + ('video_url', models.URLField()), + ('is_featured', models.BooleanField(default=False)), + ('rating', models.DecimalField(decimal_places=1, default=8.0, max_digits=3)), + ], + ), + ] diff --git a/core/migrations/0002_seed_movies.py b/core/migrations/0002_seed_movies.py new file mode 100644 index 0000000..c1b6c06 --- /dev/null +++ b/core/migrations/0002_seed_movies.py @@ -0,0 +1,65 @@ +# Generated by Django 5.0.6 on 2024-05-22 14:30 + +from django.db import migrations + +def seed_movies(apps, schema_editor): + Movie = apps.get_model('core', 'Movie') + movies = [ + { + "title": "Cyberpunk: Edgerunners", + "description": "A Street Kid trying to survive in a technology and body modification-obsessed city of the future. Having everything to lose, he chooses to stay alive by becoming an Edgerunner, a Mercenary outlaw also known as a Cyberpunk.", + "genre": "Anime", + "thumbnail_url": "https://i.ytimg.com/vi/JtqIas3bYow/maxresdefault.jpg", + "video_url": "https://www.youtube.com/watch?v=JtqIas3bYow", + "is_featured": True, + "rating": 8.6 + }, + { + "title": "Arcane", + "description": "Amid the stark discord of twin cities Piltover and Zaun, two sisters fight on rival sides of a war between magic technologies and clashing convictions.", + "genre": "Animation", + "thumbnail_url": "https://dx35vtwkllw9q.cloudfront.net/netflix/arcane/images/regions/us/onesheet.jpg", + "video_url": "https://www.youtube.com/watch?v=fXmAurh012s", + "is_featured": False, + "rating": 9.0 + }, + { + "title": "Breaking Bad", + "description": "A high school chemistry teacher diagnosed with inoperable lung cancer turns to manufacturing and selling methamphetamine in order to secure his family's future.", + "genre": "Crime", + "thumbnail_url": "https://m.media-amazon.com/images/M/MV5BYmQ4YWMxYjUtNjZmYi00MDQ1LWFjMjMtNjA5ZDdiYjdiODU5XkEyXkFqcGdeQXVyMTMzNDExODE5._V1_FMjpg_UX1000_.jpg", + "video_url": "https://www.youtube.com/watch?v=HhesaQXLuRY", + "is_featured": False, + "rating": 9.5 + }, + { + "title": "Stranger Things", + "description": "When a young boy disappears, his mother, a police chief, and his friends must confront terrifying supernatural forces in order to get him back.", + "genre": "Horror", + "thumbnail_url": "https://resizing.flixster.com/0xxuAB_l3-iRz_9K6gI_pt6-YwE=/ems.cHJkLWVtcy1hc3NldHMvdHZzZWFzb24vUlRUVjI3OTYxNy5lbi5qcGc=", + "video_url": "https://www.youtube.com/watch?v=b9EkMc79ZSU", + "is_featured": False, + "rating": 8.7 + }, + { + "title": "The Witcher", + "description": "Geralt of Rivia, a solitary monster hunter, struggles to find his place in a world where people often prove more wicked than beasts.", + "genre": "Fantasy", + "thumbnail_url": "https://m.media-amazon.com/images/M/MV5BN2FiOWU4YzYtMzVlOS00M2RjLWEyYjEtNjY2ZmNlMzllMTAyXkEyXkFqcGdeQXVyMTkxNjUyNQ@@._V1_FMjpg_UX1000_.jpg", + "video_url": "https://www.youtube.com/watch?v=ndl1W4ltcmg", + "is_featured": False, + "rating": 8.2 + } + ] + for movie_data in movies: + Movie.objects.create(**movie_data) + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0001_initial'), + ] + + operations = [ + migrations.RunPython(seed_movies), + ] \ No newline at end of file diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..1bf17dd Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/migrations/__pycache__/0002_seed_movies.cpython-311.pyc b/core/migrations/__pycache__/0002_seed_movies.cpython-311.pyc new file mode 100644 index 0000000..92c5583 Binary files /dev/null and b/core/migrations/__pycache__/0002_seed_movies.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..c4ce740 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,13 @@ from django.db import models -# Create your models here. +class Movie(models.Model): + title = models.CharField(max_length=200) + description = models.TextField() + genre = models.CharField(max_length=100) + thumbnail_url = models.URLField(max_length=200) + video_url = models.URLField(max_length=200) + is_featured = models.BooleanField(default=False) + rating = models.DecimalField(max_digits=3, decimal_places=1, default=8.0) + + def __str__(self): + return self.title \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 788576e..ceebaa6 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,11 +1,21 @@ +{% load static %} - + - {% block title %}Knowledge Base{% endblock %} + + {% block title %}AmaFlix{% endblock %} + + + + + {% block head %}{% endblock %} - - + + + {% block content %}{% endblock %} - + + + diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 0a3f404..0530945 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,154 +1,80 @@ -{% extends "base.html" %} +{% extends 'base.html' %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} -{% if project_description %} - - - -{% endif %} -{% if project_image_url %} - - -{% endif %} - - - - -{% endblock %} +{% block title %}AmaFlix - Watch Movies Online{% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+ + +{% if featured_movie %} +
+
+

{{ featured_movie.title }}

+

{{ featured_movie.description }}

+
+ Play + More Info +
+
+
+{% endif %} + +
+ + +
-