Welcome to TreadUcation
TreadUcation is a tire e-learning Django web app with two main functionalities:
A portal for instructors to build courses about tires. This will include being able to add text and pictures that make up content in modules. Instructors will be able to see a list of the courses they created and have the ability to add to and edit modules.
A portal for students to enroll in courses. Once a student hits the enroll button they will have access to that course in their list of courses. They will also be able to view the course and see its contents (text and pictures).
Link to ERD
Django Models and Migrations
Django has many built-in helper tags and filters when building the site templates. We strongly recommend reading this documentation while building your templates.
This projects utilizes ModelForm
If you’re building a database-driven app, chances are you’ll have forms that map closely to Django models. For instance, you might have a BlogComment model, and you want to create a form that lets people submit comments. In this case, it would be redundant to define the field types in your form, because you’ve already defined the fields in your model.
Installation of SQLite (if needed)
To get started, type the following command to check if you already have SQLite installed.
And you should see:
SQLite version 184.108.40.206 2014-08-15 11:53:05 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite>
If you do not see above result, then it means you do not have SQLite installed on your machine. Follow the appropriate instructions below.
Go to SQLite Download page and download the precompiled binaries for your machine. You will need to download
sqlite-dll-win32-*.zip zipped files.
Create a folder
C:\sqlite and unzip the files in this folder which will give you
C:\sqlite to your PATH environment variable and finally go to the command prompt and issue
First, try to install via Homebrew:
brew install sqlite3
If not, download the package from above. After downloading the files, follow these steps:
$tar -xvzf sqlite-autoconf-3071502.tar.gz $cd sqlite-autoconf-3071502 $./configure --prefix=/usr/local $make $make install
sudo apt-get update sudo apt-get install sqlite3
SQL Browser - DB Browser
The DB browser for SQLite will let you view, query and manage your databases during the course.
Visual Studio Code
Visual Studio Code is Microsoft's cross-platform editor that we'll be using during orientation for writing Python and building Django applications. Make sure you add the Python extension immediately after installation completes.
This project uses Python and its web framework Django.
If you are using a Mac, see the Python for Mac OS X page. MacOS 10.2 (Jaguar), 10.3 (Panther), 10.4 (Tiger) and 10.5 (Leopard) already include various versions of Python.
If you're running Windows: the most stable Windows downloads are available from the Python for Windows page.
Setup Virtual Environment
Enable a virtual environment at the level above your project.
Use the following commands in your terminal:
virtualenv env source env/bin/activate
Activate your vim and run
pip install -r requirements.txt
Django Project / Django App
Django is a Python Web framework. This project uses Django and requires Python to be installed. See above note on installing Python.
As of now, the database is going to be hosted on your local computer. There are a few things you need to make sure are in place before the database can be up and running.
Fork and clone the repo on to you local machine.
python manage.py makemigrations courses
python manage.py migrate
This will create all the migrations needed for Django Framework to post items to the database based on the models in the Models/ directory
- Add initial data
python manage.py loaddata db.json
This will load data from the project's json file to your local database
python manage.py runserver 8000
Ctrl+C to quit
Using the App
http://localhost:8000 is the domain you will use to access the app.
Once you access
http://localhost:8000 you will be directed to the main page where you will find a list of subjects.
If you are not logged in you will see a navigation bar with the following links: Treaducation(Home Page), Register, and Login
Once you login you will see a navigation bar as follows: Treaducation(Home Page), Student Courses, Instructor Courses, Log Out.