Ocean of Notions - Masterworks
Ocean of Notions is a Django-based web application designed for the Ocean of Notions Theatre Company's educational outreach program, Masterworks. This application allows educators to sign up, book workshops via a Stripe payment gateway, and cancel them. It is adaptable to fit into a preexisting company page or stand-alone. The user can also leave a review for the workshops they've booked.
Setup Instructions
Prerequisites
- Python 3.8+
- Django 3.2+
- Pip (Python package installer)
Installation
-
Clone the repository:
git clone https://github.com/MarMarAgain/PP4MWV2.git
cd PP4MWV2
-
Create a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Access the application:
Open your browser and navigate to http://127.0.0.1:8000
.
Application Overview
UX Design File Guide
Accounts
The accounts
app manages user registration, login, and profile management.
- models.py: Defines the user profile model.
- forms.py: Contains the forms for user registration and profile editing.
- views.py: Handles user registration, login, logout, and profile editing views.
- urls.py: URL configurations for account-related routes.
- templates: Contains templates for registration, login, and profile management.
Purchase
The bookings
app handles workshop bookings and cancellations.
- models.py: Defines the booking and workshop models.
- views.py: Manages the booking and cancellation logic.
- urls.py: URL configurations for booking-related routes.
- templates: Contains templates for booking-related pages.
Workshops
The workshops
app manages the workshop details, scheduling, and booking records.
- models.py: Defines the workshop, workshop date-time, and booking models.
- views.py: Handles views related to displaying and managing workshops.
- urls.py: URL configurations for workshop-related routes.
- templates: Contains templates for workshop-related pages.
Other_Pages
This app currently holds very little but will be utilised more as the website develops
Static Files
The static
directory contains CSS, JavaScript, and image files used in the application.
Templates
The templates
directory contains HTML templates used in the application. Key templates include:
- base.html: Base template that other templates extend.
- landing_page.html: Homepage template.
- signup.html: User registration template.
- login.html: User login template.
- password_reset.html: Password reset template.
- edit_profile.html: User profile editing template.
- workshop_detail.html: Workshop details template.
Deployment
Using Heroku
-
Login to Heroku:
heroku login
-
Create a new Heroku app:
heroku create ocean-of-notions
-
Add the Heroku remote:
git remote add heroku https://git.heroku.com/masterworkspp4.git
-
Deploy the application:
git push heroku main
-
Run database migrations on Heroku:
heroku run python manage.py migrate
-
Create a superuser on Heroku:
heroku run python manage.py createsuperuser
-
Open the Heroku app:
heroku open
Usage
-
Register a new user:
- Navigate to the signup page and create a new account.
-
Login:
- Use the login page to access your account.
-
Edit Profile:
- Edit your profile information through the profile page.
-
Book a Workshop:
- Browse available workshops and place in cart.
- Purchase workshop via stripe payment.
- Email confirmation is sent to both the uer and the admins email.
-
Cancel a Booking:
- Cancel your bookings through the booking management page.
- Email confirmation is sent to put the admins email and the users.
-
Review a Booking:
- Leave a review for workshops booked.
- Edit review feature.
Testing
NA
SEO Strategy
Google Document
Books
-
Django for Beginners: Build websites with Python and Django
- Vincent, W. S. (2018). Django for Beginners: Build websites with Python and Django. Leanpub.
- Reference - Project Structure and Setup Instructions
-
Django 3 By Example
- Melendez, A. (2020). Django 3 By Example. Packt Publishing.
- Reference - accounts/models.py, forms.py, views.py, urls.py
-
Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming
- Matthes, E. (2019). Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming. No Starch Press.
- Reference - General Python code
-
The Definitive Guide to Django: Web Development Done Right
- Holovaty, A., & Kaplan-Moss, J. (2009). The Definitive Guide to Django: Web Development Done Right. Apress.
- Reference - models.py, views.py, urls.py, templates
Online Resources
-
Django Documentation
- Django Software Foundation. (n.d.). Django documentation. Retrieved from https://docs.djangoproject.com/en/stable/
- Reference - Project Structure, Setup Instructions, models.py, views.py, urls.py, templates
-
Mozilla Developer Network (MDN) Django Tutorial
-
Django REST Framework
-
Heroku: Deploying Django Apps
-
Django Packages
- Django Packages. (n.d.). Django Packages. Retrieved from https://djangopackages.org/
- Reference - Enhancing project with additional packages
Corresponding References to Project Code
-
Project Structure and Setup Instructions
- Vincent, W. S. (2018). Django for Beginners: Build websites with Python and Django. Leanpub.
- Melendez, A. (2020). Django 3 By Example. Packt Publishing.
- Django Software Foundation. (n.d.). Django documentation. Retrieved from https://docs.djangoproject.com/en/stable/
-
General Django development
-
accounts/models.py, forms.py, views.py, urls.py
- Melendez, A. (2020). Django 3 By Example. Packt Publishing.
- Greenfeld, D. R., & Greenfeld, A. R. (2019). Two Scoops of Django 3.x: Best Practices for the Django Web Framework. Two Scoops Press.
- Real Python. (n.d.). Django Tutorials. Retrieved from https://realpython.com/tutorials/django/
-
General Python code
- Matthes, E. (2019). Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming. No Starch Press.
-
models.py, views.py, urls.py, templates
- Holovaty, A., & Kaplan-Moss, J. (2009). The Definitive Guide to Django: Web Development Done Right. Apress.