I have created a model.py file in which I define my classes like:
from django.db import models
from mezzanine.pages.models import Page
class Author(Page):
dob = models.DateField("Date of birth")
class Book(models.Model):
author = models.ForeignKey("Author")
cover = models.ImageField(upload_to="authors")
Then my HTML page and place it into templates folder
define URL in urls.py file.
I run command python manage.py collecttemplates
to get all templates
Now I browse 127.0.0.1/8000/page1/
to get my page view.
**Question 1: How to place this page in menu of home page using admin interface?
Question 2: How to solve this error 'NoneType' object has no attribute 'split'
generates if I browse http://127.0.0.1:8000/admin/conf/setting/
?
Question3 : How to access POST DATA from forms created in mezzanine interface?**
UPDATE:
from django.db import models
from mezzanine.pages.models import Page
class Author(Page):
dob = models.DateField("Date of birth")
class Book(models.Model):
author = models.ForeignKey("Author")
cover = models.ImageField(upload_to="authors")
and admin.py with these:
from django.contrib import admin
from mezzanine.pages.admin import PageAdmin
from .models import Author
admin.site.register(Author, PageAdmin)
Now i write these commands: python manage.py syncdb, python manage.py migrate,
and then open python shell to write Author.objects.create(dob = "12/12/2014")
That generates error that author is not defined. It's true because no tables created in my database.?!