This Django project implements a site for a legal agency. It allows users to view blog posts, create new posts, read reviews, and schedule appointments. The site also includes user registration and login functionality. Registered users can leave comments and they will be published after a moderator approve them.
The project's main components are organized as follows:
blog
app: Contains models, forms, views, and templates for the blog functionality.users
app: Handles user registration and authentication.- Templates: HTML templates for rendering pages.
title
: The title of the blog post.content
: The content of the blog post.publish
: A boolean field indicating whether the post is published.date_added
: The date and time when the post was created.
article
: A field linking an article with comments.user_name
: The nickname of the person leaving the comment.comment
: A text of the comment.date_added
: A description of the problem or reason for the appointment.status
: A boolean field indicating whether the comment is published.
name
: The name of the reviewer.phone
: The phone number of the reviewer.content
: The content of the review.publish
: A boolean field indicating whether the review is published.date_added
: The date and time when the review was created.grade
: The grade or rating given by the reviewer.
name
: The name of the person scheduling the appointment.phone
: The phone number of the person scheduling the appointment.email
: The email address of the person scheduling the appointment.problem
: A description of the problem or reason for the appointment.
PostForm
: Form for creating and editing blog posts.ReviewForm
: Form for creating and editing reviews.AppointmentForm
: Form for scheduling appointments.CommentForm
: Form for creating and editing blog comments.
The project includes views for the following functionality:
- Home view
- Prices view
- List reviews view
- Create review view
- Posts view
- New post view
- Appointment view
- User registration and authentication views
The project defines URL patterns for routing requests to the appropriate views.
- Clone this repository to your local machine.
- Create a virtual environment:
python -m venv venv
. - Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
- Install the required packages:
pip install -r requirements.txt
. - Run migrations:
python manage.py migrate
.
- Start the development server:
python manage.py runserver
. - Access the application in your web browser at
http://localhost:8000
.