Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django - can't log in to after deploy to heroku
So I have a Django app that uses Wagtail and I'm trying to set up django's authentication to work in Heroku. Although I can create a super user via: heroku run python manage.py createsuperuser When I try to log in to the app via Heroku, I just get a password authentication error - however, the same procedure works locally! If anyone has any ideas or has come across this before, I can provide more details if this problem sounds familiar. -
How I can show the latest post at the top in Django template using example.example_set.all
I'm trying to present all the post information in the profile and I'm using this command below to do it in the template as a template tag {% for letter in user.letter_set.all %} Profiles view code in view.py class UserProfilePage(DetailView): template_name = 'profile.html' model = Profile def get_object(self): username = self.kwargs.get("username") if username is None: raise Http404 return get_object_or_404(User, username__iexact=username, is_active=True) It's working but I need to show the latest post at the top. Please tell me how I can do it. I think I have to make some changes to the template tag. TIA -
Search results in 'page not found' error in Django
I want to search for products in my app by their categories, retrieving data from firebase database but can't figure out the problem with my code. I'm new to Django so any help would be appreciated. this my 'search' form: <form class="form-inline my-2 my-lg-0" method="get" action="/postsign" id="s"> {% csrf_token %} <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" name="Search"> <button class="btn btn-outline-success my-2 my-sm-0" type="submit" onclick="location.href='/postsign'" form="s">Search</button> </form> and here's the views: def postsign(request): if request.method == 'GET' and 'csrfmiddlewaretoken' in request.GET: search = request.GET.get('Search') search = search.lower() timestamps = database.child("Products").shallow().get().val() pcategory = [] for i in timestamps: category = database.child("Products").child(i).child("category").get().val() category = str(category)+"$"+str(i) pcategory.append(category) matching =[str(string) for string in pcategory if search in string.lower()] s_category = [] s_id = [] for i in matching: category,id=i.split("$") s_category.append(category) s_id.append(id) data = services.get_products() return render(request, "Welcome.html",{'data':data, 'category':s_category}) -
Django Nested Admin returns 404 or doesn't inline models in django admin area
I'm trying to get django nested admin to work, but I'm having a few issues and I'm sure I'm just making a silly mistake. Here are the steps that I followed: Step 1: I did a pip install Step 2: I added it to the bottom of my Installed Apps in my settings.py Step 3: I added it to my URL array: Their Example: urlpatterns = patterns('', # ... url(r'^_nested_admin/', include('nested_admin.urls')), ) My implementation: urlpatterns = [ path('admin/', admin.site.urls), path('', include("estimate_maker.urls")), path('nested-admin', include('nested_admin.urls')), ] Step 4: I created a static folder in my settings.py Step 5: I ran the collectstatic command Step 6: I set up my admin.py in my project folder: from django.contrib import admin from .models import MoldInspection, MoldService import nested_admin class MoldServiceInline(nested_admin.NestedStackedInline): model = MoldService class MoldInspectionInline(nested_admin.NestedModelAdmin): model = MoldService sortable_field_name = "position" inlines = [MoldServiceInline] admin.site.register(MoldInspection) admin.site.register(MoldService) I do get a warning from pycharm saying the below that I'm not sure how to diagnose as I'm setting up the class as it is done in the guide. Cannot find reference 'NestedModelAdmin' in '__init__.py' Looking in the referenced __init__.py I see: # import mapping to objects in other modules all_by_module = { 'nested_admin.forms': ( 'SortableHiddenMixin'), 'nested_admin.formsets': ( … -
Cannot run make Django migrations when model uses AUTH_USER_MODEL as foreign key
I'm new to Django. I've created a model, where I'd like the entries in the model to be referenced to a Django user. from django.conf import settings # Allows User model to be foreign key ... class JournalEntry: user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT) TYPE = ( ('BP', 'Bank Payment'), ('YE', 'Year End'), ) type = models.CharField( max_length=2, choices=TYPE, blank=True, default='0' ) When I run makemigrations I get the following error: First parameter to ForeignKey must be either a model, a model name, or the string 'self' -
GET request appearing from nowhere
First of all, excuse me for the title but my problem is very specific and I could'nt find a better title. So I'm currently developing a website using Django and Bootstrap. Since I'm a beginner, I bought a design developed by someone else with bootstrap and I'm adapting it according to my needs. Here is the full code of the problematic HTML template : {% extends "base.html" %} {% block content %} {% load static %} <body class="bg-white"> <div class="container-fluid"> <div class="row no-gutter"> <div class="d-none d-md-flex col-md-4 col-lg-6 bg-image"> </div> <div class="col-md-8 col-lg-6"> <div class="login d-flex align-items-center py-5"> <div class="container"> <div class="row"> <div class="col-md-9 col-lg-8 mx-auto pl-5 pr-5"> <h3 class="login-heading mb-4">Bienvenue !</h3> <form> <div class="form-label-group"> <input type="email" id="inputEmail" class="form-control" placeholder="Email address"> <label for="inputEmail">Identifiant</label> </div> <div class="form-label-group"> <input type="password" id="inputPassword" class="form-control" placeholder="Password"> <label for="inputPassword">Mot de passe</label> </div> <div class="custom-control custom-checkbox mb-3"> <input type="checkbox" class="custom-control-input" id="customCheck1"> <label class="custom-control-label" for="customCheck1">Se souvenir de moi</label> </div> <a href="{% url 'home' %}" class="btn btn-lg btn-outline-primary btn-block btn-login text-uppercase font-weight-bold mb-2">Connexion</a> <div class="text-center pt-3"> Vous n'avez pas encore de compte ? <a class="font-weight-bold" href="{% url 'inscription' %}">Inscrivez-vous</a> </div> </form> </div> </div> </div> </div> </div> </div> </div> <!-- jQuery --> <script src="{% static 'vendor/jquery/jquery-3.3.1.slim.min.js' %}" type="text/javascript"></script> <!-- Bootstrap … -
Changing URL pattern in Django so it doesn't show app name
I've got a folder/app named "projects" and there I want to make a new project named, let's say, "cheese". In my urlpatterns in urls.py in projects folder I've got path('cheese/', views.cheese, name='cheese') but the whole URL looks like domain.co/projects/cheese I'd like to omit that projects in URL, so it could just be domain.co/cheese Those URL-things are kinda hard to understand for me and as I couldn't properly name my problem, I couldn't find a solution out there, though I believe there must be some. -
Django project set up with Nginx, Gunicorn and MySQL on Digital Ocean and some people can access it whilst others cant
I have a website, set up with Digital Ocean Droplet using mysql, Nginx and Gunicorn. When I access my website, www.fancyfetish.co.uk it shows up fine, and also perfectly fine when I access it from an incognito browser. I use Chrome. My partner and some other people access it using their devices and an error appears saying: FORBIDDEN you don't have permission to access this resource When these same people on their same devices access a certain part of the website such as: http://fancyfetish.co.uk/products/lingerie/ another error appears which states: NOT FOUND The requested URL cannot be found on this server My /etc/nginx/sites-available/fancyfetish file looks like this: server { listen 80; server_name www.fancyfetish.co.uk fancyfetish.co.uk 178.62.10.157; location = /favicon.ico { access_log off; log_not_found off; } location /static/ { root /home/carlie/django-apps; } location /media/ { root /home/carlie/django-apps; } location / { include proxy_params; proxy_pass http://unix:/home/carlie/django-apps/fancyfetish.sock; } } My /etc/nginx/sites-available/default file looks like this: # Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. … -
How to solve Heroku ERRORs
Help me please understand errors why my app is crashed. With what it can be connected and how to solve it?How to import Bootstrap? Logs: https://anotepad.com/notes/smypips -
KeyError 'request' in DRF
I am checking in serializer if product exists in cart or not and I am using this class ProductSerializer(serializers.ModelSerializer): in_cart = serializers.SerializerMethodField() class Meta: model = Product fields = ['id', 'in_cart'] def get_in_cart(self, obj): user = self.context['request'].user if user.is_authenticated: added_to_cart = Cart.objects.filter(user=user, product_id=obj.id).exists() return added_to_cart else: return False It works fine but I cannot add product to the cart because of that request my cart model like this class Cart(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) product = models.ForeignKey(Product, on_delete=models.CASCADE, null=True) quantity = models.PositiveIntegerField() def __str__(self): return f'{self.user} cart item' When I post product id to add cart it throws this error user = self.context['request'].user KeyError: 'request' I need to make both work but adding item to cart is being problem. How can I solve this? Thank you beforehand! -
How do I save a cover image from post's image-set using Pillow in Django
I have a function that accepts a post object and an image form-set (made with Django's modelformset_factory). I expect it to create a cover photo for the post using the first image in the image form-set (instead it points post.cover_image.path to the same path). It successfully saves the post images and post cover-image, but the problem is that it also makes the first image in the post's image set blurry as the cover-photo after saving. from PIL import Image as PIL_Image def handle_uploaded_post_images(post, post_image_formset): for index, form in enumerate(post_image_formset.cleaned_data): try: image = form['image'] post_image = Images(post=post, image=image) post_image.save() if index == 0 or not post.cover_image: post.cover_image = post_image.image post.save() cover_image = PIL_Image.open(post.cover_image.path) cover_image.thumbnail((480, 480)) cover_image.save(post.cover_image.path) except (KeyError, FileNotFoundError) as e: pass I just want to make a cover-photo without affecting the post's images. -
Django use private S3 storage only in production environment
I have set up my django REST API to use local storage when in DEBUG mode and S3 storage when in production environment. This works well for public files, because I override the DEFAULT_FILE_STORAGE like so: if IS_DEBUG: DEFAULT_FILE_STORAGE = 'api.storage_backends.PublicMediaStorage' and every FileField uses it automatically. Now I want to use private S3 storage the same way, but because I have to define the storage explicitly (FileField(storage=PrivateMediaStorage())), the S3 storage is always used. How can I use the local storage instead of S3 storage when in DEBUG mode? PS: I have already thought about changing the model to either use a FileField with or without an explicit storage depending on the DEBUG mode. This did not fully solve my problem, because my migrations are created in DEBUG mode and thus always contain the model without the private storage class. -
python manage.py runserver is not working
It is coming with the indentation error. Also, I was in the correct directory where manage.py file was there, but I don't see any issue in the file. Could anyone please help me get rid of this error. -
Ajax not working after clicking button in Django form
I have a login form that uses AJAX. I plan to call an API and get back tokens using JWT. However, when clicking the button, the AJAX call isn't working and I am still within the login page. This is what I had done so far: views.py: def login(request): return render(request, 'myapp/login.html') class LoginAPI(APIView): permission_classes = [AllowAny] def post(self, request, format = None): username = request.data['username'] password = request.data['password'] new_user = authenticate(username = username, password = password) if new_user is not None: url = 'http://localhost:8000/api/token/' values = { 'username' : username, 'password' : password } r = requests.post(url, data = values) token_data = r.json() return Response(token_data) else: return Response({"status" : "Denied"}, status=status.HTTP_400_BAD_REQUEST) login.html: {% extends 'users/base.html' %} {% load static %} {% load crispy_forms_tags %} {% block javascript %} <script src='{% static "myapp/js/main.js" %}'></script> {% endblock %} {% block content %} <div class="content-section"> <form method="POST"> {% csrf_token %} Usernam> <input id="username" type="text" name="username" value="" required=""> Password <input id="password" type="password" name="password" value="" required=""> <button id ='login_button' type="button" value="submit" > Login </button> </form> </div> {% endblock content %} main.js: $(document).ready(function() { $('#login_button').click(function () { var username = $('#username').val(); var password = $('#password').val(); $.ajax({ cache: false, method: 'POST', url: "/login_api/", data: {username:username, password: … -
Django database: how to apply .annotate() and .aggregate() across all columns?
Suppose I have the following model in django: class MyModel(models.Model): foo = models.CharField(max_length=100) bar = models.CharField(max_length=100) Now I want to find the length of the longest entries for each of the columns in the model. I can do this for a single field with the following command: MyModel.objects.annotate(length = Length('foo')).aggregate(Max('length')) How can I apply this command to all fields (columns) of the table at once in a single command? -
How to use Django Framework with Machine Learning
I have recently learned Machine Learning and Django and want to integrate a Linear Regression model in a web page. Does someone have any examples on using Linear Regression with Django? I searched a lot but most of them doesn't work -
How do I fetch data by left join 10 models that are connected with foreign key in the Django REST framework?
How do I fetch data by left join 10 models in the Django REST framework? -
How to edit user profile in django rest framework from two models and save the change
I am currently new to django rest framework and I am trying to create an endpoint to edit both the user model and custom profile model below. models.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) bio = models.TextField(max_length=500) location = models.CharField(max_length=50) image = models.ImageField(default='default.jpg', upload_to='profile') In the regular django I would do: views.py def edit_profile(request): if request.method == 'POST': form = EditProfileForm(request.POST, instance=request.user) extended_profile_form = ProfileForm(request.POST, request.FILES, instance=request.user.profile) if form.is_valid() and extended_profile_form.is_valid(): form.save() extended_profile_form.save() return redirect('accounts:profile') else: form = EditProfileForm(instance=request.user) extended_profile_form = ProfileForm(instance=request.user.profile) context = { 'form':form, 'extended_profile_form':extended_profile_form } return render(request, 'accounts/edit-profile.html', context) what is the equivalent for django rest framework? I have tried: views.py (Django Rest Framework) @api_view(['GET','PUT']) def profile(request): if request.method == 'GET': user = User.objects.filter(username=request.user) profile_user = Profile.objects.filter(user=request.user) serializer_user = UserSerializer(user, many=True) serializer_profile_user = ProfileSerializer(profile_user, many=True) result = {'serializer_user': serializer_user.data, 'serializer_profile_user': serializer_profile_user.data} return Response(result) elif request.method == 'PUT': user = User.objects.filter(username=request.user) profile_user = Profile.objects.filter(user=request.user) serializer_user = UserSerializer(user, data=request.data) serializer_profile_user = ProfileSerializer(profile_user, data=request.data) if serializer_user.is_valid() and serializer_profile_user.is_valid(): serializer_user.save() serializer_profile_user.save() result = {'serializer_user': serializer_user.data, 'serializer_profile_user': serializer_profile_user.data} return Response(result) result = {'serializer_user': serializer_user.data, 'serializer_profile_user': serializer_profile_user.data} return Response(result.errors, status=status.HTTP_400_BAD_REQUEST) When I am browsing the endpoint, it does display serializer_user and serializer_profile_user data but I am unable to edit any of those data … -
python manger.py runserver command passed but shows message as python not identified as internal file
I installed django application using pip install command my python version is 3.7.4 now using this i started a project and when i wanted project execution using python manage.py runserver it gave a statement that python is not identified as an internal or external command,operable or batch file. how to sort this out? -
Redirect to tenant domain after signup with django-tenants?
I'm using a django-tenants library where each tenant is a separate, isolated postgres schema. The django tenants module does a lot of the heavy lifting and I've got the following code that creates a new tenant each time someone registers. My concern is inside the schema_context function which (successfully) creates a user in the newly created schema, but my concern is how I can log that user in and redirect them to customname.my-domain.com as seen below: class SignupView(View): def get(self, request): form = RegistrationForm() return render(request, "accounts/signup.html", {"form": form}) def post(self, request, *args, **kwargs): form = RegistrationForm(request.POST) if form.is_valid(): instance = form.save(commit=False) tenant = Client(domain_url=company + ".my-domain.com", schema_name=company, name=company, paid_until="2019-05-10", on_trial=False) tenant.save() with schema_context(tenant.schema_name): instance.save() # login(request, instance) - how do I login this user # render.... and redirect them to the newly created domain e.g company.my-domain.com return render(request, "accounts/signup.html", {"form": form}) -
Django context in views.py
I have a simple(I think) question, about Django context rendering. I'll step right into it - I have a 2 models, in this case, one is a table called Locked, and another is OpportunityList. OpportunityList is a model which has all the objects, and I rendered that part good(no problems with that one). When a User presses a button, which is a form, an OpportunityList's object goes into Locked table. They are linked through the PK. Locked table has parameter 'is_locked'. And my idea is, when a object is inside the Locked table, a button shows next to it(inside the html table), with an locker icon(). But, my problem is, since in my views.py, my lock function is not returning exact html where I want to render that locker icon, instead, it returns another html, which needs to be like that. Is there any way, to render same context, on 2 html pages? Thank's. This is my code : def lock(request, pk): # Linking by pk. opp = get_object_or_404(OpportunityList, pk=pk) opp_locked = get_object_or_404(Locked, pk=pk) # Taking two parametters for 2 fields. eluid = Elementiur.objects.get(eluid=pk) user = User.objects.get(username=request.user) # Dont bother with this one! Just pulling one field value. field_name = … -
Django Load form with the data populated from models
I'm working on a project using Python(3.7) and Django(2.3) in which I have implemented multiple types of users by extending the Base user model, now I need to create a UserEdit page to allow the staff to edit a user. Here's my models: class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(max_length=254, unique=True) name = models.CharField(max_length=255) title = models.CharField(max_length=255, choices=TITLE, blank=False) user_type = models.CharField(max_length=255, choices=USER_TYPE, blank=False) gender = models.CharField(max_length=255, choices=CHOICES, blank=False) contenst = models.CharField(max_length=255, blank=True, null=True) is_staff = models.BooleanField(default=False) is_superuser = models.BooleanField(default=False) is_active = models.BooleanField(default=True) last_login = models.DateTimeField(null=True, blank=True) date_joined = models.DateTimeField(auto_now_add=True) email_status = models.CharField(max_length=50, default='nc') USERNAME_FIELD = 'email' EMAIL_FIELD = 'email' REQUIRED_FIELDS = ['password'] objects = UserManager() def get_absolute_url(self): return "/users/%i/" % (self.pk) def __str__(self): return str(self.email) class PersonalBelow18(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='profile') dob = models.DateField(blank=False) customer_id = models.IntegerField(blank=False, verbose_name='Connect other User') collection_use_personal_data = models.BooleanField(blank=False) reference_identities = models.ForeignKey(Identities, blank=False, on_delete=models.CASCADE, related_name='refs') def __str__(self): if self.user.email is None: return "ERROR-CUSTOMER NAME IS NULL" return str(self.user.email) GRAPPELLI_AUTOCOMPLETE_SEARCH_FIELDS = { "myapp": { "MyFile": ("user__email__icontains",) } } class PersonalAbove18(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) dob = models.DateField(blank=False) customer_id = models.IntegerField(blank=False, verbose_name='Connect other User') contact_email = models.EmailField(max_length=255, blank=False) reference_identities = models.ForeignKey(Identities, blank=False, on_delete=models.CASCADE) contact_no = PhoneNumberField(blank=True, null=True, max_length=13, help_text='Phone number must be entered in the' 'format: \'+999999999\'. … -
How do i create a category and subcategories
This is my Item Model, how do i create a Category and Subcategories like; Man-clothing-shirt and Woman-clothing-shirt. class Item(models.Model): title = models.CharField(max_length=250) company_name = models.CharField(max_length=50, blank=True) men_shirt_category = models.ForeignKey(MenShirtCategory, null=True, blank=True, on_delete=models.CASCADE) product_you_may_like = models.ForeignKey(ProductYouMayLike, null=True, blank=True, on_delete=models.CASCADE) image = models.ImageField(null=True) price = models.IntegerField() old_price = models.IntegerField(null=True, blank=True) shipping_amount = models.IntegerField() percentage_off = models.IntegerField(null=True, blank=True) description = models.TextField(null=True, blank=True) specification = models.TextField(null=True, blank=True) product_type = models.CharField(max_length=20, choices=PRODUCT_TYPE, null=True, blank=True) slug = AutoSlugField(populate_from='title', unique=True) timestamp = models.DateTimeField(auto_now_add=True) active = models.BooleanField(default=True) class Meta: ordering = ['-timestamp'] db_table = 'items' verbose_name_plural = 'Items' def __str__(self): return self.title -
Query in Postgres takes more time for later added data than earlier added data
I have an application where I have to filter a table and aggregate various values. Now the query performs fast if the data range filtered is part of earlier added rows and the query takes lot longer if the data range filtered is part of the later added rows. This is the first query, filtering data with date_int between 43719 and 43726 . This query takes only 669ms SELECT COUNT(*) FROM (SELECT DISTINCT "content_song"."title" AS Col1 FROM "tags_playlistentryviewership" INNER JOIN "content_playlistentry" ON ("tags_playlistentryviewership"."playlist_entry_id" = "content_playlistentry"."id") LEFT OUTER JOIN "content_song" ON ("content_playlistentry"."song_id" = "content_song"."id") WHERE (("tags_playlistentryviewership"."channel_id" = '1ddc96bc-2f77-4293-b774-0018bc541044'::uuid OR "tags_playlistentryviewership"."channel_id" = '25260324-e79d-4e0b-b08b-f7ac9419024d'::uuid OR "tags_playlistentryviewership"."channel_id" = '25c29a3b-635d-4afc-b0ac-5373132f7ed8'::uuid OR "tags_playlistentryviewership"."channel_id" = '3af60df1-7d19-48eb-971e-162504e33b24'::uuid OR "tags_playlistentryviewership"."channel_id" = '783dbae0-cca5-4272-b101-7e10d4ce1f17'::uuid OR "tags_playlistentryviewership"."channel_id" = 'b4f627c3-727b-40b6-bbe0-2501a8a30079'::uuid OR "tags_playlistentryviewership"."channel_id" = 'c5933372-af36-406e-89e3-49d3e30bfa61'::uuid OR "tags_playlistentryviewership"."channel_id" = 'c9a26012-f070-4637-a80f-947024856887'::uuid OR "tags_playlistentryviewership"."channel_id" = 'f53781f4-7248-4cdc-a0c8-30fe691b9248'::uuid OR "tags_playlistentryviewership"."channel_id" = 'fa2dfe7c-8218-4236-a70a-f76729e35f5e'::uuid) AND "tags_playlistentryviewership"."target_group_id" = '23f70629-ebb7-4f13-af5c-2ed26e0d0e31'::uuid AND "tags_playlistentryviewership"."region_id" IN (SELECT U0."id" AS Col1 FROM "content_region" U0 INNER JOIN "content_region_portal_map" U1 ON (U0."id" = U1."to_region_id") WHERE U1."from_region_id" = 'c8fd4db2-790a-4fa2-9a54-8f6cdf76da2f'::uuid) AND "tags_playlistentryviewership"."date_int" >= 43719 AND "tags_playlistentryviewership"."date_int" <= 43726)) subquery While with all other filters remaining same but now querying data with date_int between 43806 and 43812 is given below. This query takes 11100 ms. SELECT COUNT(*) FROM (SELECT DISTINCT "content_song"."title" AS … -
Updating custom user (AbstractUser) in Django
I created a custom user using CBV and i have succeeded in implementing signup view however i am finding difficult to implement the update view. I have implemented the update view using the following code: models.py class CustomUser(AbstractUser): state = models.CharField(choices=States, default ='abia', max_length=50 ) city = models.CharField(max_length=50) local_government = models.CharField(max_length=50) phone_number = models.CharField(max_length=50, blank= True) picture = models.ImageField(upload_to='user/photos', blank=False, null=False, validators= [clean_image]) forms.py class CustomUserCreationForm(UserCreationForm): class Meta: model = CustomUser fields = UserCreationForm.Meta.fields + ('state', 'city', 'local_government', 'phone_number', 'picture',) class CustomUserChangeForm(UserChangeForm): class Meta: model = CustomUser fields = UserCreationForm.Meta.fields + ('state', 'city', 'local_government', 'phone_number', 'picture',) admin.py class CustomUserAdmin(UserAdmin): add_form = CustomUserCreationForm form = CustomUserChangeForm model = CustomUser list_display = ['id', 'first_name', 'last_name', 'email','subscription_plan', 'state', 'city', 'local_government', 'phone_number', 'picture'] views.py (update): class UpdateUser( LoginRequiredMixin, UpdateView): model = CustomUser form_class = CustomUserChangeForm template_name = 'profile/profile-edit.html' login_url = 'login' The UpdateUser page just reload when i click to update profile without committing the update. Any help will be appreciated.