Skip to content

schmave/demschooltools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DemSchoolTools

DemSchoolTools is a database that excels at managing Judicial Committee records for Sudbury-inspired schools. In addition, it does a satisfactory job of tracking people (students, parents, donors, and others), student attendance, and the management manual.

Documentation for users

See the wiki for more information.

Running the site locally for development

Installation

  1. Download and install Oracle JDK version 11.x. Set the JAVA_HOME environment variable to be the location that you installed it, meaning that $JAVA_HOME/bin/java (or $JAVA_HOME/bin/java.exe on Windows) should be the path to the java binary.

  2. Install sbt 1.x. If you use a Mac, I recommend using homebrew to install it.

  3. Download and install PostgreSQL. If you use a Mac, I recommend installing the "Postgres" app instead.

  4. Download and install Node v22. If you use Mac or Linux or Windows WSL, I recommend using nvm to download and install it instead of the Node website.

  5. Download the source code, or clone the git repository. cd into the root level of the source code.

  6. Run npm install to install the Javascript libraries.

  7. Start the PostgreSQL server and create a database named "school_crm". You'll also need to set the password for the user named "postgres" to "123", or change the database username and password in conf/base.conf and django/demschooltools/settings.py.

  8. Install uv. Once you run it, you'll need to close your terminal window and reopen it before continuing.

  9. Run:

    cd django
    uv run manage.py migrate
    uv run manage.py setup_initial_data
    cd ..
    

    If you see errors when running manage.py migrate, read below for troubleshooting info.

Running the site

You'll need to run two separate programs for each of the parts of the site.

(1 of 2) Play Framework code

Run ./sbt.sh, then execute the eclipse and run command in the sbt console:

[DemSchoolTools] $ eclipse
[info] About to create Eclipse project files for your project(s).
[info] Successfully created Eclipse project files for project(s):
[info] DemSchoolTools
[info] authLibrary
[info] modelsLibrary
[DemSchoolTools] $ run

(2 of 2) Django code

Run:

cd django
uv run honcho start

Opening the site

Once you have all two servers running, you can:

  1. Navigate to http://localhost:9000 in your browser and wait while DemSchoolTools is compiled.

  2. Login with Email admin@asdf.com and password nopassword.

Dealing with "InconsistentMigrationHistory"

If you first set up your local development environment before November 2025, you will see this error when you run uv run manage.py migrate:

django.db.migrations.exceptions.InconsistentMigrationHistory:
    Migration admin.0001_initial is applied before its
    dependency dst.0001_initial on database 'default'.

If you're willing to discard your local data, then the easiest way to fix this is to delete your entire school_crm database and start fresh with the migrate and setup_initial_data installation step above. If you want to keep your data, read on.

Upgrading your DB

  1. Apply all Play schema changes that existed before they were deleted and replaced with Django ones.

    Run git fetch; git checkout cadf15b7, then run the Play server as described in "1 of 2" above, go to http://localhost:9000 and click "Apply this script now.".

    Then quit Play and sbt.

  2. Tell Django that the initial Django migrations have already been applied.

    Connect to the school_crm database and run this SQL statement:

    INSERT INTO django_migrations(app, name, applied) VALUES
        ('dst', '0001_initial', clock_timestamp()),
        ('custodia', '0003_swipe_person_swipe_day_empty_out_unique', clock_timestamp());
  3. That's it! You can go back to whatever branch you were working on before. uv run manage.py migrate should now work properly.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6