These are the source files for the internal website that I use to teach my course OTIS. It is pretty standard Django, so you should be able to spin up a local server on a standard Unix environment.
Video tutorial: https://youtu.be/W27XcqeXp20
-
Fork the repository first if you're planning on submitting a pull request later.
-
Install the following standard tools:
python(version 3.10),pip,git. (For each tool, search "[name of thing to install] [your OS]" on the web.) -
Clone this repository:
git clone https://github.com/USERNAME/otis-web. ReplaceUSERNAMEwith your username if you're forking; otherwise, replace withvEnhance. -
Run
git submodule update --init --recursivein order to pull theevans_django_toolssubmodule. -
Install Poetry. This enables you to use the
poetrycommand; verify this by checkingpoetry --helpproduces a help message. -
Once you have
poetry, hitpoetry install. This will automatically create a Python virtual environment and install stuff inside it.(If you are an expert familiar with Python virtual environments and want to use your own rather than Poetry's auto-created one, then you can do so by activating an environment before running
poetry install.) -
If it isn't already activated, activate the Python virtual environment that was created in the previous step. The easiest way to do so is to run
poetry shell.(Note: you have to do this step every time you start working on the project. That is, always run
poetry shellbefore doing any work, or for experts, activate the virtual environment using your preferred method.) -
If everything is working,
python manage.py checkshould run with no errors. -
Run
python manage.py migrateto create the local database. -
Run
python manage.py createsuperuserto create an admin user. -
Run
python manage.py runserver. The command will spin up a continuously running server. -
Point your browser to
http://127.0.0.1:8000. You should be able to log in with the user you defined in step 9. -
The website is functional now, but it is a bit bare-bones. To populate it with some test data, use
http://127.0.0.1:8000/admin.
Optional steps:
- If you need to set up environment variables,
copy
envto.envand uncomment the relevant lines. - If you want to test the Stripe stuff, a few more steps are needed.
Briefly: install the Stripe CLI.
Create some API keys and
stripe login. Add these API keys to.env(the threeSTRIPE_*variables). Then runstripe listen --forward-to localhost:8000/payments/webhook/.
Submit an issue on GitHub.
For OTIS students: pull requests welcome! If you think the website can be improved in some way, feel free to implement it. See contributing guidelines. It's OK if you don't have much code experience; I'm willing to guide you along.
526561645265616452656164