Skip to content

chore: Improve Makefile#381

Merged
C4ptainCrunch merged 4 commits into
DocHub-ULB:mainfrom
mnietona:chore/improve-makefile
May 17, 2026
Merged

chore: Improve Makefile#381
C4ptainCrunch merged 4 commits into
DocHub-ULB:mainfrom
mnietona:chore/improve-makefile

Conversation

@mnietona

Copy link
Copy Markdown
Contributor

Small DevEx improvements for local setup:

  • Added make run to quickly start the dev server.
  • Added make clean to wipe db.sqlite and __pycache__ folders.
  • The setup now creates 2 explicit accounts for testing: an admin/superuser (${USER}) and a classic user (blabevue).
  • Added login credentials output at the end of make database.

@C4ptainCrunch

C4ptainCrunch commented May 16, 2026

Copy link
Copy Markdown
Contributor

The setup now creates 2 explicit accounts for testing: an admin/superuser (${USER}) and a classic user (blabevue).

Was that not already the case ?

@mnietona

Copy link
Copy Markdown
Contributor Author

True, but previously ${USER} was just a moderator. I changed it to superuser because the Django admin panel is for admins only. I also added the final message to show the credentials directly so new devs don't have to check the code.

Last :

@echo "Creating user ${USER} with password 'test'"
@echo "from users.models import User; u, _ = User.objects.get_or_create(netid='${USER}', defaults={'first_name': 'Gaston', 'last_name': 'Lagaffe', 'email': '${USER}@fake.ulb.ac.be'}); u.set_password('test'); u.is_moderator=True; u.save()" | $(PY) manage.py shell > /dev/null

Now :

@echo "Creating user $(CURRENT_USER) with password 'test' (Super Admin & Staff)"
@echo "from users.models import User; u, _ = User.objects.get_or_create(netid='$(CURRENT_USER)', defaults={'first_name': 'Gaston', 'last_name': 'Lagaffe', 'email': '$(CURRENT_USER)@fake.ulb.ac.be'}); u.set_password('test'); u.is_staff=True; u.is_superuser=True; u.save()" | $(PY) manage.py shell > /dev/null

@C4ptainCrunch C4ptainCrunch merged commit 03c3800 into DocHub-ULB:main May 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants