Django User Profile

Free Django samples that allows registered users to edit their profile outside of the admin module.

Django Sample project that allows registered users to edit their profile outside of the admin module. Django User Profile is provided on top of Django Volt.

Features:

  • UI Kit: Volt Bootstrap 5 by Themesberg

  • UI-Ready App, SQLite Database, Django Native ORM

  • Session-Based Authentication, Forms validation

  • Editable user profile: Name, Surname, Email, Phone, and address

  • User Profile Page: settings.html

Links

Django User Profile - Free Sample.

How to use the app

To compile and execute the project in a local environment the workstation must have a few software tools already installed:

  • GIT - command line versioning tool used to clone the sources

  • Python3 - the language used to code the project

Check GIT is installed

Check Python is installed

Once we have this minimal toolchain properly installed and accessible via a terminal window we can move forward and compile the code.

Step #1 - Clone/download sources from the public repository

Step #2 - Install modules using a Virtual Environment

Step #3 - Create SQLite Database and tables

Codebase Structure

The bootstrap flow

  • Django bootstrapper manage.py uses core/settings.py as the main configuration file

  • core/settings.py loads the app magic from .env file

  • Redirect the guest users to Login page

  • Unlock the pages served by app node for authenticated users

User Profile Feature

This section describes the coding process for this feature that allows authenticated users to update their profiles. By accessing the settings.html page, registered users can update their own profile: name, surname, phone number, city name, ZIP code, ..etc.

The customers app:

This module will manage the user profile information by defining a new model, form, and view. Authenticated users can also upload their avatar.

The Profile model:

customers/models.py:

The Profile form

Create a related form to show inputs & store data. The ProfileForm will be defined in the customers/forms.py using a definition as below:

The Profile routing

Activate the routing for customers app by edit the customers/urls.py file with the following code:

Update core/urls to include customers urls:

Last updated

Was this helpful?