class CategoryForm(admin.ModelAdmin):
  
from django import forms
from rango.models import Category, Page

class CategoryForm(forms.ModelForm):
  name = forms.CharField(max_length=128, help_text="Please enter a category name")
  views = forms.IntegerField(widget=forms.HiddenInput(), initial = 0)
  likes = forms.IntegerField(widget=forms.HiddenInput(), initial = 0)
  slug = forms.CharField(widget=forms.HiddenInput(), required=False)

  class meta:
    model = Category
    fields = ('name', )

class PageForm(forms.ModelForm):
  title = forms.CharField(max_length=128, help_text="Please enter the title of the page.")
  url = forms.URLField(max_length=200, help_text="Please enter the URL of the page.")
  views = forms.IntegerField(widget=forms.HiddenInput(), initial=0)

  class meta:
    model = Page
    # excluding the category foreign key field from the form
    exclude = ('category', )

create form classes for both models