DEV Community

@rinnah
@rinnah

Posted on • Edited on

πŸš€ I Built a Django User Management System in One Day

πŸš€ I Built a Django User Management System in One Day (And Here's What I Learned)

From zero to fully functional β€” registration, login, profile, verification, and even testing β€” all before 6PM!

Hi Devs!
I recently had to build a User Management System using Django β€” with a tight deadline. The task? Build a complete project with registration, login, mock verification, profile management, an admin panel, and even write unit tests β€” all in a single day. πŸ˜…

So I brewed some strong tea β˜•, opened Pycharm, and dove in.

Here's how it went down (and what you can learn from it too).


πŸ› οΈ The Tech Stack

  • Python 3.11+
  • Django 5.x
  • SQLite (default for development)
  • HTML + Bootstrap via Django Crispy Forms
  • Git + GitHub (with a 10-commit rule!)
  • Console email backend for mocking verification

πŸ“Œ Features I Implemented

  • βœ… User Registration
  • βœ… Login / Logout
  • βœ… Email Verification (mocked in console)
  • βœ… Profile View / Edit
  • βœ… Change Password
  • βœ… Admin Panel for managing users
  • βœ… Tests for models and views

And yes β€” everything works πŸ₯³


πŸ“ Project Structure

My Django project followed this structure:

user_mgt/
β”œβ”€β”€ accounts/           # Custom user app
β”‚   β”œβ”€β”€ models.py       # Extended User if needed
β”‚   β”œβ”€β”€ views.py        # Auth + profile views
β”‚   β”œβ”€β”€ forms.py        # Crispy-powered forms
β”‚   └── tests.py        # Unit tests
β”œβ”€β”€ user_mgt/
β”‚   └── settings.py     # Configured apps, email, templates
β”œβ”€β”€ templates/
β”‚   └── registration/   # login.html, register.html, etc.
β”œβ”€β”€ static/             # CSS, images, etc.
β”œβ”€β”€ manage.py
└── README.md
Enter fullscreen mode Exit fullscreen mode

I didn’t use any fancy custom user model yet, but made the app scalable to add it later.


🧱 Step-by-Step Breakdown

1. Project Setup 🧰

django-admin startproject user_mgt
cd user_mgt
python manage.py startapp accounts
Enter fullscreen mode Exit fullscreen mode

I added accounts, crispy_forms, and set up templates and static directories in settings.py.


2. User Registration πŸ”

I created a RegisterForm that extended UserCreationForm, then used a class-based view to render it. Thanks to crispy-forms, it looked great with minimal CSS.

class RegisterView(View):
    def get(self, request):
        form = RegisterForm()
        return render(request, 'registration/register.html', {'form': form})

    def post(self, request):
        form = RegisterForm(request.POST)
        if form.is_valid():
            user = form.save()
            # send email here (mocked)
            return redirect('login')
        return render(request, 'registration/register.html', {'form': form})
Enter fullscreen mode Exit fullscreen mode

3. Email Verification (Mocked) πŸ“¬

I used Django's built-in console backend:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
Enter fullscreen mode Exit fullscreen mode

So when a user signs up, it "sends" a verification link in the console β€” simple, elegant, and demo-ready.


4. Profile Management πŸ‘€

  • Profile View: Display user details
  • Profile Edit: Allow users to update name, email, etc.
  • Password Change: Using Django’s built-in views

Each normal user could only view and edit their profile β€” nothing more. Security first. πŸ”


5. Admin Panel πŸ› οΈ

Django’s admin is magic πŸͺ„. I just registered my User model, customized the display, and boom β€” I could view and edit all users easily.


6. Unit Testing πŸ§ͺ

I wrote simple tests for:

  • βœ… Model creation
  • βœ… View rendering for login and registration
class UserTestCase(TestCase):
    def test_user_creation(self):
        user = User.objects.create_user(username="dee", password="123asd45")
        self.assertEqual(user.username, "dee")
Enter fullscreen mode Exit fullscreen mode

Small but mighty!



🀯 Lessons Learned

  • Django does a LOT for you. From auth to admin to email, it's a full-stack powerhouse.
  • Crispy Forms = πŸ”₯ Makes your forms look instantly professional.
  • You don't need to reinvent everything β€” use built-in tools first, then customize.
  • Console email is your friend during development.
  • Writing tests early makes you more confident β€” even if they're simple.

βœ… Final Deliverables

  • βœ”οΈ GitHub repo with <10 commits
  • βœ”οΈ README with setup + screenshots
  • βœ”οΈ Working registration, login, profile, and admin
  • βœ”οΈ Tests added

πŸ“¦ What’s Next?

I’m planning to:

  • Deploy this on Render or Railway
  • Add a Docker setup for easier deployment
  • Maybe write a Part 2: Advanced User Roles + Permissions!

πŸ”— Check Out the Code

πŸ‘‰ GitHub Repository


🧠 Final Words

This project pushed me to:

  • Think fast 🧠
  • Code clean 🧹
  • Write meaningful commits πŸ“
  • And learn a LOT about Django authentication in just one day

I hope this walkthrough helps you if you're learning Django, or rushing to finish your own project like I was πŸ˜….


πŸ’¬ Questions? Suggestions?

Drop them below or ping me on GitHub β€” happy to connect and grow together as devs! πŸ™Œ


Top comments (0)