<s>[INST] from django import forms
from .models import *
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm

class UserRegisterForm(UserCreationForm):
    email = forms.EmailField()

    class Meta:
        model = User
        fields = ['username', 'email', 'password1', 'password2']

forms.CharField(label='Username', max_length=100)
forms.EmailField(label='Email')

class ProfileUpdateForm(forms.ModelForm):
    email = forms.EmailField()

    class Meta:
        model = Profile
        fields = ['email', 'first_name', 'last_name', 'address', 'mobile_number', 'bio', 'profile_pic']

# views.py
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm, ProfileUpdateForm
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import *

def register(request):
    if request.method == 'POST':
        form = UserRegisterForm(request.POST)
        if form.is_valid():
            form.save()
            username = form.cleaned_data.get('username')
            messages.success(request, f'Your account has been created! You are now able to login')
            return redirect('login')
    else:
        form = UserRegisterForm()
    return render(request, 'register.html', {'form': form})

@login_required
def profile(request):
    if request.method == 'POST':
        u_form = UserRegisterForm(request.POST, instance=request.user)
        p_form = ProfileUpdateForm(request.POST, request.FILES, instance=request.user.profile)
        if u_form.is_valid() and p_form.is_valid():
            u_form.save()
            p_form.save()
            messages.success(request, f'Your profile has been updated!')
            return redirect('profile')
    else:
        u_form = UserRegisterForm(instance=request.user)
        p_form = ProfileUpdateForm(instance=request.user.profile)
    return render(request, 'profile.html', {'u_form': u_form, 'p_form': p_form})

# models.py
from django.db import models
from django.contrib.auth.models import User

class Profile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    first_name = models.CharField(max_length=100, blank=True)
    last_name = models.CharField(max_length=100, blank=True)
    address = models.CharField(max_length=200, blank=True)
    mobile_number = models.CharField(max_length=10, blank=True)
    bio = models.TextField(blank=True)
    profile_pic = models.ImageField(upload_to='profile_pics', blank=True)

# admin.py
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User

class ProfileAdmin(admin.ModelAdmin):
    list_display = ['user', 'first_name', 'last_name', 'address', 'mobile_number', 'bio', 'profile_pic']

admin.site.register(Profile, ProfileAdmin)
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
```

I am trying to create a profile update form for users that have already created an account. The update form should include fields from the User model (username, email, password) and fields from the Profile model (first_name, last_name, address, mobile_number, bio, profile_pic).

Below is the code for the view and the forms. The problem with the current code is that the password fields are not visible when a user tries to update their profile.

I am using Django's built-in User model and a custom Profile model with a OneToOne relationship with the User model.

When I try to update the profile, the password fields are not visible. I understand that this is because the UserRegisterForm is meant for registration, not for updating profiles. 

I can remove the passwords from the ProfileUpdateForm and have two separate forms, one for updating the user info and one for updating the profile info. But I want the user to be able to update all their info (both user info and profile info) in one form.

How can I achieve this?[/INST]