import os
import platform

from django import get_version as django_version
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic.edit import CreateView
from django.contrib.auth.decorators import login_required

from .forms import SignUpForm


def home(request):
    return render(request, "core/index.html")

@login_required
def dashboard(request):
    watchlist = request.user.profile.watchlist.all()
    return render(request, 'core/dashboard.html', {'watchlist': watchlist})

class SignUpView(CreateView):
    form_class = SignUpForm
    success_url = reverse_lazy("login")
    template_name = "registration/signup.html"


