Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
aws boto3 s3bucket CreateMultipartUpload access denied overwriting
I am using s3bucket with django and it was worked very well. My client given access to his aws and i used in the application of my own credentials that he created for me. It was really working well for deleting, updating, creating, uploading for anything. But now Revoked the access of the user that created for me and he created another user for his another developer, so he updated the access key and the secret key of that newly created account in the script. Even now with the new updated key, everything working but it's not working once I/we try to overwrite a pdf file. It fires me/us this error: raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the CreateMultipartUpload operation: Access Denied Most of the file is being created with my access key and secret but as a client using another key and secret, the overwriting is failed for that file that it created by my access key. I am not getting what is the reason of this and how to solve this problem. I went through too much StackOverflow solution but no luck. We are using same bucket but with a different access key and … -
Reverse for 'topping' not found. 'topping' is not a valid view function or pattern name
When i try to run server i get the error "Reverse for 'topping' not found. 'topping' is not a valid view function or pattern name." Error at line 11 9 <a href="{% url 'pizza:index' %}"> Pizzeria</a>- 10 <a href="{% url 'pizza:pizzas' %}"> Pizzas </a>- 11 <a href="{% url 'pizza:topping' %}"> Toppings </a> views.py def topping(request, pizza_id): pizza = Pizza.objects.get(id=pizza_id) toppings = Pizza.topping_set.order_by('id') context = {'pizza': pizza, 'toppings' : toppings} return render(request, 'pizza/topping.html', context) app/urls.py urlpatterns = [ #homepage url(r'^$', views.index, name='index'), #pizzas page url(r'^pizzas/$', views.pizzas, name='pizzas'), # Detail page for a single pizza url(r'^pizza/(?P<pizza_id>\d+)/$', views.topping, name='pizza'), ] topping.html {%block content%} <p>Pizza : {{pizza}}</p> <p>Toppings:</p> <ul> {%for topping in toppings%} <li>{{topping}}</li> {%empty%} <li>no topping have been added yet.</li> {%endfor%} base.html <a href="{% url 'pizza:index' %}"> Pizzeria</a>- <a href="{% url 'pizza:pizzas' %}"> Pizzas </a>- <a href="{% url 'pizza:topping' %}"> Toppings </a> -
Django in-memory database
I am running a web application with a low latency requirement using Django. However, my MySQL server is currently being a bottleneck. I want to replace it with a completely in-memory database. However, the solutions I have looked at so far create an in-memory database that is local to a particular process. I am running multiple Django processes and need the database to be shared among them. Are there any such databases that can be integrated with Django? -
Django randomly stopped working post homebrew update
I installed gnu-prolog via homebrew, then homebrew updated itself. Now, django has stopped working entirely. I used a venv to install and run django - the path to that is desktop/tinker/thanos within that is my project folder - django_project Everything was working perfectly fine until this homebrew update. I have looked up countless stack overflow threads, yet each solution just pops up a new problem. Now I have the following problems - (thanos) django_project $python manage.py runserver File "manage.py", line 16 ) from exc ^ SyntaxError: invalid syntax on changing python to python3 - (thanos) django_project $python3 manage.py runserver Traceback (most recent call last): File "/Users/X/Desktop/tinker/thanos/django_project/manage.py", line 10, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/X/Desktop/tinker/thanos/django_project/manage.py", line 21, in <module> main() File "/Users/X/Desktop/tinker/thanos/django_project/manage.py", line 12, in main raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment? the virtual environment is activated. here is the manage.py file - #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', … -
How to break single migration file into multiple migration file in django
At the start of the Project, I was having 3 migrations files (as there were 3 model classes) but somehow my code was not working so I deleted all of them and executed migration code. But after executing the same, only 1 migration file got created and entry of all model classes are there. So can someone please let me know how to break this single file into 3 migration file in Django so that I can run my code again. Thanks in advance.. -
Generate an HTML page using Django
I am making a small website, I have a basic (working) inteface: Home, about us, login/register ... What I'd like to do now it to setup a page with a "form" page which would generate and save an HTML page containing the data of the form and make it accesible from the "home" page. I know how to make the form, but I don't know if it's possible to create a HTML page in django. Thanks in advance -
Related Name Issue in my Django Application
I am trying to change the Django default User Authentication and permissions classes. While trying to do that, I got issues related to the related name and when I added it to my codes it still continued giving me the same issue. Here is the error log django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues: ERRORS: auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'User.groups'. HINT: Add or change a related_name argument to the definition for 'User.groups' or 'User.groups'. auth.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'User.user_permissions'. HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'User.user_permissions'. core.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'User.groups'. HINT: Add or change a related_name argument to the definition for 'User.groups' or 'User.groups'. core.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'User.user_permissions'. HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'User.user_permissions'. System check identified 4 issues (0 silenced). Here is my models.py from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin from django.db import models from django.utils import timezone class UserManager(BaseUserManager): def _create_user(self, email, password, is_staff, is_superuser, **extra_fields): if not email: raise ValueError('Users must have … -
Initialize counter inside html django
Is there any way to initialize a counter and increase it during a for loop in django html? I have the following code that display a list of matrices as tables. {% if matrixs %} <h5 style="text-align: center;">Simple Gaussian Elimination </h5> {%for matrix in matrixs%} <table class="result" align="center" style="text-align:center;"> {% for row in matrix %} <tr> {% for element in row %} <td> {{ element }} </td> {%endfor %} </tr> <br> {%endfor %} </table> <br> {%endfor%} {% endif %} I want to be able to display the number of the iteration in top of the table like "matrix 1", "matrix 2", ... Thank you -
PostgreSQL JOIN query much slower via Django than on simple Python interpretor
here is a topic I have been struggling on for a small while now. For now, I decided to just limit the requests sizes, but I'd like to know why this happened. If you can take some time solving this problem, thank you. Context Here are the models: class Zone(Model): zone_id = BigAutoField(primary_key=True) type = CharField(max_length=6, choices=('TypeA', 'TYpeB', 'TypeC')) other_fields class User(Model): user_id = BigAutoField(primary_key=True) other_fields class Access(Model): access_id= BigAutoField(primary_key=True) zone_id = BigIntegerField(null=False, empty=False) user_id = BigIntegerField(null=False, empty=False) There are two databases. These models are on the one I do not own, I only have USAGE rights. That is why I did not add ForeignKeyField, fearing that Django would want to consider its own automatically generated indexes with this, while that's not how the database has been set. The database is using PostgreSQL. The table Zone has its indexes zone_access_id_idx and zone_user_id_idx set already, and that is why, I suppose, when I run the predictable JOIN sql query (detailed below) on psql console and even on simple python, independent script using psycop2, the result is instantaneous. (the size of zone table is like 100,000 in total, but I filter it to 100 in the query) (the nb of accesses I … -
Django: Passing argument via image to get a filtered view in next page
I am having a big confusion right now and can't any good answers online about my issue. What I am trying to do is, to let the users click on an image. I have 52 different images on my page and by clicking on the image i want to pass an int between 1-53 (52 is missing) in order to get a filtered view. What I have is models.py class CentroidCount(models.Model): id_centroid_count = models.AutoField(primary_key=True) id_observation = models.ForeignKey('Observation', models.DO_NOTHING, db_column='id_observation', blank=True, null=True) step = models.SmallIntegerField(blank=True, null=True) centroid = models.SmallIntegerField(blank=True, null=True) count = models.SmallIntegerField(blank=True, null=True) class Meta: managed = False db_table = 'centroid_count' ordering = ['id_observation', 'step', 'centroid'] def get_absolute_url(self): return reverse('centroid-detail', args=[str(self.id_centroid_count)]) def __str__(self): return 'Observation: %s' % (self.id_observation) urls.py urlpatterns = [ path('', views.index, name='index'), path('observations/', views.ObservationListView.as_view(), name='observations'), ] views.py class ObservationListView(generic.ListView): model = CentroidCount context_object_name = 'observation_list' queryset = CentroidCount.objects.filter(centroid__in=[]).order_by('id_observation').values_list('id_observation', flat=True).distinct() template_name = 'centroid_webapp/observation_list.html' def get_queryset(self): return CentroidCount.objects.filter(centroid__in=[2]).order_by('id_observation').values_list('id_observation', flat=True).distinct() and the image part of the html <div class="col-sm"> <img src="{% static 'images/1.png'%}" class='img-fluid' alt='Responsive image'> </div> What i still don't understand fully is how can be this done dynmaically. What i do have now is a static page that is filterint out all "id_observations" with the number 2. But … -
Django not serving static files and not stylizing anything
I downloaded a template in the form of a zip file on my machine. It has a file for a homepage, auth-login.html. If I load this on its own then it loads correctly, I see styling and I don't get any console errors. But it seems like I can't get this template to load its css and styling in my Django project via python manage.py runserver with DEBUG=true. I'm trying to just get this on a development server and I haven't really been able to get past step 1. When I try to go to my application's home page, I see unstylized times new roman text in my browser. No styling loads on the page at all. I'm not getting server/console errors either. My Django project is of the following structure lpbsproject/ project_root/ staticFiles/ (STATIC_ROOT, where collectstatic copies to) project_app/ settings.py urls.py wsgi.py, asgi.py, __init__.py... static/ (STATIC_URL, original location of static files) assets/ (this folder is copied/pasted from the template .zip) css/, js/, ... user_auth/ migrations views.py admin.py, models.py, apps.py, test.py ... templates/ manage.py Here's the <head> of my html file with all the <link> and <script> statements. These currently aren't generating errors. {% load static %} <!doctype html> <html … -
django.core.exceptions.ImproperlyConfigured: Cannot import 'educations'. Check that 'careers.apps.EducationsConfig.name' is correct
I can't import my apps. I think path is ok but don't know how to solve this problem. is there any problem in my code? carrers>apps.py from django.apps import AppConfig class CareersConfig(AppConfig): name = "careers" class EducationsConfig(AppConfig): name = "educations" django.core.exceptions.ImproperlyConfigured: Cannot import 'educations'. Check that 'careers.apps.EducationsConfig.name' is correct. settings.py > PROJECT_APPS = [ "cores.apps.CoresConfig", "users.apps.UsersConfig", "reviewers.apps.ReviewersConfig", "careers.apps.CareersConfig", "careers.apps.EducationsConfig", "conversations.apps.ConversationsConfig", "unions.apps.UnionsConfig", "posts.apps.PostsConfig", -
Default Language problem in django although Language_code is set
Default Language problem in django although Language_code is set.The problem is as follows: LANGUAGES = ( ('kmr', gettext_noop('Kurmanji')), ('ckb', gettext_noop('Sorani')), #('en', gettext_noop('English US')), ) LANGUAGE_CODE = 'kmr' if 'en' is in commented then default language works as required.But if I un-comment the 'en'then 'en' remains the default language in django app.whatever i tried it is always makes 'en' as default langues. -
Elastic Beanstalk Editing Files Online?
I deployed my Django website on AWS elastic beanstalk. I have deployed PHP websites previously on GoDaddy and some other hosting. As there is method to edit your PHP files over internet as I can login my account on another pc and edit the files. But until now I am unable to find a way to do so in elastic beanstalk to let me or some one else to edit the files online. Currently all my are on my laptop. It may be silly question but I just want to know. -
Django OSError [Errno 101]
when i test my project on my local machine it was work butt when i deploy my code on my host after submit form data i get this error and i don't receive email. settings.py: EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST_USER = 'vanguardteam99@gmail.com' EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_HOST_PASSWORD = "*********" views.py: send_mail( 'همکاری با ما', 'name: {}\n, age: {}\n, cell_phone: {}\n, email: {}\n, skills: {}\n, message: {}\n'.format( name, age, cell_phone, email, dev_skills_str, description), settings.EMAIL_HOST_USER, ['vangaurdteam99@gmail.com'] ) error massage: OSError at /vanguard_projects/project_request [Errno 101] Network is unreachable Request Method: POST Request URL: http://vanguard-group.ir/vanguard_projects/project_request Django Version: 3.1.3 Exception Type: OSError Exception Value: [Errno 101] Network is unreachable Exception Location: /opt/alt/python37/lib64/python3.7/socket.py, line 716, in create_connection Python Executable: /home/vanguard/virtualenv/vanguard_land/3.7/bin/python3.7_bin Python Version: 3.7.8 Python Path: ['/home/vanguard/vanguard_land', '/opt/passenger-5.3.7-9.el7.cloudlinux/src/helper-scripts', '/home/vanguard/virtualenv/vanguard_land/3.7/lib64/python37.zip', '/home/vanguard/virtualenv/vanguard_land/3.7/lib64/python3.7', '/home/vanguard/virtualenv/vanguard_land/3.7/lib64/python3.7/lib-dynload', '/opt/alt/python37/lib64/python3.7', '/opt/alt/python37/lib/python3.7', '/home/vanguard/virtualenv/vanguard_land/3.7/lib/python3.7/site-packages'] Server time: Tue, 24 Nov 2020 13:27:01 +0000 -
What's the best way to create a web mapping app with Django?
Should I use leaflet, vue-leaflet, folium, mapbox or other techno ? Thank you -
Django reverse foreignkey filter return multiple same objects
I have a favorite system. So I check that a user already liked the post. I've written this query. But there is a problem since I don't delete the favorite's records. I just change the status of favorite's record. So if the user deletes the favorite before, my queryset return 2 rows for each them. I use MySQL for the database. def is_favorite(self, user): if user.is_authenticated: return self.annotate(is_favorite=Case( When(Q(favorites__user=user, favorites__is_deleted=False), then=Value(True)), default=Value(False), output_field=BooleanField() ) ).prefetch_related("favorites") return self.annotate(is_favorite=Value(False, output_field=BooleanField())) My query Blog.objects.all().is_favorite(self.request.user).distinct() Queryset's return [ { "id" : 1, "title": "foo", "is_favorite" : false }, { "id" : 1, "title": "foo", "is_favorite" : true } ] -
I already have implementation of python-docx to download docx file in my django project, now i want to convert it into pdf
I already have an implementation of python-docx to download docx file in my django project, now i want to download pdf with same content and same format -
ModuleNotFoundError: No module named 'django' by Deploying on Azure
I'm trying to deploy a django web app to the Microsoft Azure and this is correctly deployed by the pipeline on DevOps Azure, but I get the error message (ModuleNotFoundError: No module named 'django) on portal Azure and cannot reach my app via the URL. The app also works properly locally Here is the whole error message: '''https://pastebin.com/mGHSS8kQ''' How can I solve this error? -
pylint_django raises import-errors when not specifying --init--hook option
my_project __init__.py app __init__.py settings.py manage.py core __init__.py common.py students __init__.py models.py views.py serializer.py teachers __init__.py models.py views.py serializer.py When I run pylint --load-plugins pylint_django students, I got these errors: E0611: No name 'common' in module 'core' (no-name-in-module) E0401: Unable to import 'teachers.serializer' (import-error) E0401: Unable to import 'teachers.models' (import-error) My students/serilizer.py: from rest_framework import serializers from students.models import Student from teachers.serializer import TeacherSerializer from teachers.models import Teacher from core.common import method class StudentSerializer(serializers.ModelSerializer): pass I don't get theses error when I import the models of the same app ! I don't get any error when I specify --init--hook option: pylint --load-plugins --init--hook "__import__('sys').path.insert(0, '.'); __import__('django').setup();" pylint_django students How can we overcome these errors without specifying the --init-hook?? -
Django ORM Query: How to get record that Not Exist in other table
How to achieve this Raw SQL query in Django ORM?: dbfiddle. So I have 2 table, Table user and payment, i need to get the user_id that not have a record in payment table (see expected result): User table: Payment table: Result Expected -
Cannot install psycopg2, django-heroku, grpcio on MacOS Catalina 10.15.7
I am trying to install requirements on a Django project but I get this error. I've tried almost everything I saw but still no luck. I have tried pip install -r requirements.txt, pip install psycopg2, pip install psycopg2-binary but none of them worked. My Python version is 3.9.0 and I've also tried it with 3.8.2 but still got the same error. Here is the stack trace: ... 1 warning generated. gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130001 -DHAVE_LO64=1 -I/Users/burakakyalcin/Projects/hakko_api/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/xid_type.c -o build/temp.macosx-10.9-x86_64-3.9/psycopg/xid_type.o gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_asis.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_binary.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_datetime.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_list.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pboolean.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pdecimal.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pfloat.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pint.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_qstring.o build/temp.macosx-10.9-x86_64-3.9/psycopg/aix_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/bytes_format.o build/temp.macosx-10.9-x86_64-3.9/psycopg/column_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/connection_int.o build/temp.macosx-10.9-x86_64-3.9/psycopg/connection_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/conninfo_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/cursor_int.o build/temp.macosx-10.9-x86_64-3.9/psycopg/cursor_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/diagnostics_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/error_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/green.o build/temp.macosx-10.9-x86_64-3.9/psycopg/libpq_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/lobject_int.o build/temp.macosx-10.9-x86_64-3.9/psycopg/lobject_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/microprotocols.o build/temp.macosx-10.9-x86_64-3.9/psycopg/microprotocols_proto.o build/temp.macosx-10.9-x86_64-3.9/psycopg/notify_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/pqpath.o build/temp.macosx-10.9-x86_64-3.9/psycopg/psycopgmodule.o build/temp.macosx-10.9-x86_64-3.9/psycopg/replication_connection_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/replication_cursor_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/replication_message_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/solaris_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/typecast.o build/temp.macosx-10.9-x86_64-3.9/psycopg/utils.o build/temp.macosx-10.9-x86_64-3.9/psycopg/win32_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/xid_type.o -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.9/psycopg2/_psycopg.cpython-39-darwin.so ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command '/usr/bin/gcc' failed with exit code 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /Users/burakakyalcin/Projects/hakko_api/venv/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lx/1m5zgk591xj0_fyybjhw1wm00000gn/T/pip-install-tiftlw89/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/lx/1m5zgk591xj0_fyybjhw1wm00000gn/T/pip-install-tiftlw89/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', … -
media Image url not opening in django template
Image from media not opening in template in my django app. below is urls or my project from django.urls import include, path from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('myroyalkennel', include('myroyalkennel.urls')), ] + static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) Below is my settings.py STATIC_URL = '/static/' MEDIA_ROOT = os.path.join(BASE_DIR,'media') MEDIA_URL = '/media/' below is my views.py* def store (request): items = products.objects.all return render(request, "myroyalkennel/store.html", {"itms":items}) below is my template: <body> <table> <tr> <th>image</th> <th>SERIAL NUMBER</th> <th>SERIAL NUMBER</th> <th>PRODUCT NAME</th> <th>VARIENT</th> <th>MRP</th> <th>DISCOUNTED PRICE</th> <th>DISCOUNT PERCENT</th> <th>IN STOCK</th> </tr> {%if itms %} {% for item in itms %} <tr> <td>{{item.image.url}}</td> <td>{{item.Serial_number}}</td> <td>{{item.product_name}}</td> <td>{{item.Varient}}</td> <td>{{item.MRP}}</td> <td>{{item.Discounted_price}}</td> <td>{{item.Discount_percent}}</td> <td>{{item.In_Stock}}</td> </tr> {% endfor %} {% endif %} </table> </body> below is my model * class products(models.Model): Serial_number = models.CharField(max_length=10) product_name = models.TextField() Varient = models.CharField(max_length=15) MRP = models.IntegerField() Discounted_price = models.IntegerField() Discount_percent = models.CharField(max_length=6) In_Stock = models.CharField(max_length=15) image = models.ImageField(upload_to="asset/image",default="") def __str__(self): return self.product_name When I am calling the image in template with {{ item.image.url}} it gives path /media/asset/image/rkci_logo.jpg but image does not open. -
Use Wordpress for authenticating Django users
I have a WordPress site with multiple users configured. I also have a Django-based site. I would like to have my Django site use the Wordpress site to authenticate users. Is it possible to have Wordpress serve as an authentication server for a Django site? If so, how? Thanks! -
I want to show customer coin but its only shwoing customer id
i am trying to show account balance system in my project.Like a customer has 1000$ when that customer log inhe will be shown his balance is 1000$.But whenever I try to fetch this data it only shows its id, but I want to show his amount not his id.How can I do this ??I am really confused about this part and got stuck here Here is my Customer Model: class Customer(models.Model): phone_number = models.CharField(max_length=100, default=1) email = models.EmailField( default=1) password = models.CharField(max_length=100) coin = models.FloatField(null=True, blank=True) How can I only show his amount when he is logged in ?? Please help me asap