Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Error 415 on angular although the headers are up
I'm getting error 415 on angular api request but http header are set: login.service.ts: var httpHeaders = new HttpHeaders(); httpHeaders.set('Content-Type', 'application/json'); httpHeaders.set('Access-Control-Allow-Origin', '*'); return this.httpClient.post<any>(requestUrl, params, { headers: httpHeaders }) As backend i used django rest framework Any idea ? Thans in advance. -
Multiple concurrent requests in Django async views
From version 3.1 Django supports async views. I have a Django app running on uvicorn. I'm trying to write an async view, which can handle multiple requests to itself concurrently, but have no success. Common examples, I've seen, include making multiple slow I/O operations from inside the view: async def slow_io(n, result): await asyncio.sleep(n) return result async def my_view(request, *args, **kwargs): task_1 = asyncio.create_task(slow_io(3, 'Hello')) task_2 = asyncio.create_task(slow_io(5, 'World')) result = await task_1 + await task_2 return HttpResponse(result) This will yield us "HelloWorld" after 5 seconds instead of 8 because requests are run concurently. What I want - is to handle multiple requests to my_view concurrently. async def slow_io(n, result): await asyncio.sleep(n) return result async def my_view(request, *args, **kwargs): result = await slow_io(5, 'result') return HttpResponse(result) I expect this code to handle 2 simultaneous requests in 5 seconds, but it happens in 10. What am I missing? Is it possible in Django? -
Django background task like FastAPI
I have a requirement that I need to calculate hash of some images in background after the data inserted on DB tables. I saw FastAPI Vs Django implementation of background task and it seems very easy and feasible solution for background task implementation in FastAPI comparing to Django. So I need to know is there similar kind of implementation on Django available or not? because it's seems too much on Django for a simple background task. OR It would be better to use simple multiprocessing.Process For Django: I need to do these steps for achieve background task Installation I like [pipenv][1] so: > cd [my-django-project root directory] > pipenv install django-background-tasks Now add 'background_task' to INSTALLED_APPS in settings.py: INSTALLED_APPS = ( # ... 'background_task', # ... ) and perform database migrations to ensure the django-background-tasks schema is in place: > pipenv shell (my-django-project) bash-3.2$ python manage.py migrate Creating and registering a Task Any Python function can be a task, we simply need to apply the @background annotation to register it as such: from background_task import background @background(schedule=10) def do_something(s1: str, s1: str) -> None: """ Does something that takes a long time :param p1: first parameter :param p2: second parameter … -
How to run only the tests that are affected by the latest changes in a Django project?
We are running Django tests on a bitbucket pipeline and it takes a bit long. What I want to do is, get the diff between the current branch and the main branch and run the tests that are affected by this diff. How can I do that? -
what is the correct way to filter data from db in monthly and yearly basis for analytics?
I am making an analytics section for my client, where I need to display data in graphical form. For this I am using chart js. Now I have a model to store visitors of the website. Now I want to filter the data in monthly and yearly basis to put it in chart js and display it graphically. Now what I am doing is this monthly_visitor = VisitorCount.objects.all().filter(date_of_record__month = today.month).count() yearly_visitor = VisitorCount.objects.all().filter(date_of_record__year = today.year).count() Here, I am able to get the count for my current month and year. But making variables for each month and year is not the right to do it. So please suggest me what is the correct procedure to filter the data so that I can make the analytics. I have never before done this, so I do no the correct approach, please suggest me. Also the chart js code looks like this, which also perhaps no the correct way to do make the analytics const vismonth = document.getElementById('visitorMonthly').getContext('2d'); const visitorMonthly = new Chart(vismonth, { type: 'bar', data: { labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], datasets: [{ label: 'Visitors Monthly', data: [12, 19, 3, 5, 2, 3], backgroundColor: … -
How to update page in django without page refresh?
So.I have prices in database django,when I change it,prices on website dont change and I have to restart django server.So..How Can I refresh page in django without restart django server? -
django.db.utils.ConnectionDoesNotExist: The connection prueba doesn't exist
I want migrate Django database to MongoDB with Djongo but i have this error. Traceback (most recent call last): File "/home/alexsaca/python3EnvDec/lib/python3.8/site-packages/django/db/utils.py", line 167, in ensure_defaults conn = self.databases[alias] KeyError: 'prueba' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/alexsaca/python3EnvDec/lib/python3.8/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line utility.execute() File "/home/alexsaca/python3EnvDec/lib/python3.8/site-packages/django/core/management/__init__.py", line 365, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/alexsaca/python3EnvDec/lib/python3.8/site-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **cmd_options) File "/home/alexsaca/python3EnvDec/lib/python3.8/site-packages/django/core/management/base.py", line 335, in execute output = self.handle(*args, **options) File "/home/alexsaca/python3EnvDec/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 74, in handle connection = connections[db] File "/home/alexsaca/python3EnvDec/lib/python3.8/site-packages/django/db/utils.py", line 199, in __getitem__ self.ensure_defaults(alias) File "/home/alexsaca/python3EnvDec/lib/python3.8/site-packages/django/db/utils.py", line 169, in ensure_defaults raise ConnectionDoesNotExist("The connection %s doesn't exist" % alias) django.db.utils.ConnectionDoesNotExist: The connection prueba doesn't exist My settings.py looks like this DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'postgres', 'USER': 'decide', 'PASSWORD': 'decide', 'HOST': '127.0.0.1', 'PORT': '5432', }, 'prueba': { 'ENGINE': 'djongo', 'NAME': 'egc-sierrezuela-2', 'ENFORCE_SCHEMA': False, 'CLIENT': { 'HOST': 'mongodb+srv://usuario:password@egc-sierrezuela-2.fxrpl.mongodb.net/egc-sierrezuela-2?retryWrites=true&w=majority' } } } I am using Django=2.0 and djongo=1.2.38 I have tried with many djongo versions and but the errors still arises. Also, upgrading django to the latest version is not possible as I'm using an old project. Any idea? -
Django's static() function to retrieve static file gives no such file -error
I'm doing a project with Django with the following structure: /project /cv /static /configuration configuration.json So a project with one app in it and a config.json file in the static folder. My settings.py (the most important settings for this): INSTALLED_APPS = [ "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", "cv", ] STATIC_URL = "/static/" BASE_DIR = os.path.dirname(os.path.abspath(__file__)) STATIC_ROOT = os.path.join(BASE_DIR, "cv/static") In my view I use the static() function to retrieve the static file def index(request): file_path = static("configuration/configuration.json") with open(file_path) as f: configuration = json.loads(f.read()) return render(request, "index.html", configuration) But when It keeps giving me the error: No such file or directory: '/static/configuration/configuration.json' I can fix it by explicitly parsing the path string to the index function: "./cv/static/configuration/configuration.json" But how do I do it with the static() function? The static() function uses the static_url variable, but no matter how I adjust it, it keeps giving me a similar error. Anyone an idea what I'm doing wrong here? -
Integration Pycharm, Docker Compose and Django Debbuger getting error: /usr/local/bin/python: can't find '__main__' module. in ''
I'm having a problem using Pycharm to run a Docker container to debug a Django project on MacOs. The Pycharm setup is working fine to run the Django project inside a Docker container. But when I try to do a debugger I'm having the following issue: /usr/local/bin/docker-compose -f /Users/claudius/Studies/Pycharm/test-api/docker-compose.yaml -f /Users/claudius/Library/Caches/JetBrains/PyCharm2021.2/tmp/docker-compose.override.1494.yml up --exit-code-from web --abort-on-container-exit web Docker Compose is now in the Docker CLI, try `docker compose up` mongo is up-to-date postgres is up-to-date Recreating test-api_web_1 ... Attaching to test-api_web_1 Connected to pydev debugger (build 212.4746.96) web_1 | /usr/local/bin/python: can't find '__main__' module in '' test-api_web_1 exited with code 1 Aborting on container exit... ERROR: 1 Process finished with exit code 1 To set up the Pycharm I did: Add a Python interpreter with docker-compose and the container of the web application (Django). Add a Django config for the project. Add a Run/Debugger config. Does someone have any suggestions? -
Django: How do I access a related object max value in html template
I am attempting to display a list of items for auction. For each item, I am wanting to also display the current bid price. The current bid price should be the max value or last added to the Bids class for each individual listing. How do I render in my HTML the max Bid.bid_price for each item in my Listing.objects.all() collection? Below are my models, views, and HTML. Models: class Listing(models.Model): title = models.CharField(max_length=65, default="") description = models.CharField(max_length=200, default="") category = models.CharField(max_length=65, default="") image = models.ImageField(blank=True, null=True, upload_to='images/') listed_by = models.ForeignKey(User, on_delete=models.CASCADE, default="") created_dt_tm = models.DateTimeField(auto_now_add=False, default=timezone.now()) class Bids(models.Model): bidder = models.ForeignKey(User, on_delete=models.CASCADE, default="") listing = models.ForeignKey(Listing, on_delete=models.CASCADE, default="", related_name="bids") bid_price = models.IntegerField(default=0) created_dt_tm = models.DateTimeField(auto_now_add=False, default=timezone.now()) Views: def index(request): return render(request, "auctions/index.html", { "listings": Listing.objects.all() }) HTML: {% for listing in listings %} <div style=display:flex;margin:30px;border:lightseagreen;border-style:solid;height:150px;border-width:1px;width:40%> <div style=width:25%;display:flex;> {% if listing.image %} <img src="{{listing.image.url}}" alt="Cannot display image" height="100px" style="margin-left:50px;"> {% endif %} </div> <div style=width:15%></div> <div style=width:30%> <div><a href="{% url 'listing' listing.title %}">{{listing.title}}</a></div> <div style=font-size:10pt;>Description: {{listing.description}}</div> <div style=font-size:10pt;>Category: {{listing.category}}</div> **<div style=font-size:10pt;>Current Price: ${{ listing.bids_object.bid_price }}</div>** <div style=font-size:10pt;>Created by:<br>{{listing.listed_by}}</div> </div> <div style=width:30%> <div style=margin:10px;> </div> </div> </div> {% endfor %} {% endblock %} -
Django How to insert into model with dynamic key value pairs?
I am obtaining Model instance from my applabel and modelname by the below mentioned format. target_model = django.apps.apps.get_model(app_label=appname, model_name=modelname) And Obtaining model instance like this model = target_model() Need to insert the row in db using this model. I am having key value pairs in variable I have tried below mentioning two ways. key = "model_id" value = "some_value" model[key] = value model.save() and setattr(model, key, value) model.save() Both are not working for me. Any Django (python) Engineers helps me to move further? -
first and last methods used excluded items
i used last() to get last item of queryset after exclude some items as below: holidays = HolidayModel.objects.all().values_list('date', flat=True) result = BorseExchangeLog.objects.exclude( hint_time__date__in=holidays ) # output 1 print(list(result.valuse_list('hint_time__date',flat=True).distinct('hint_time__date'))) #output2 print(result.last().hint_time.date()) but in output2 print item that not exists in output1 i test that by first() and problem was there too what is problem? my code is wrong or bug from django orm? using django2.2 and postgresql -
Django ORM query to update reverse many to many field
Models look like: class Book(models.Model): name = models.TextField(verbose_name='Book Name') class Author(models.Model): name = models.TextField(verbose_name='Author Name') Books = models.ManyToManyField(Book) Book can have many authors and Author can have written many books Now, There is a list like: [ {Book_id1:[Author_id1, Author_id2]}, {Book_id2:[Author_id2, Author_id3]}, ] This information is required to be updated in the DB. How can this be done in an efficient way using ORM? (Currently the DB may have Book_id1 linked with [Author_id1,Author_id3] so the update should be able to add author_id2 and delete author_id3 as well) -
Is there a way to convert HTML div to a video format (MP4 or any other) in Python/Django?
I am trying to render a HTML page and use a specific inside it to convert it to video format. Explanation: I know HTML is static content but it is necessary for me to convert it to a video format (it is a requirement). I need to know if there is a way which can render a page and export it to a video format. It can either be a direct HTML to MP4 conversion or capture rendered div (Not record canvas) as an Image and then convert that image to the video format. Technology Stack: Django Django templates HTML JAVASCRIPT Any help would be appreciated. -
Django and reactjs: How to create notification feature
I have django backend and reactjs frontend. I am running some tasks in celery on the backend. Now when the tasks are completed, I want to inform the user in real time, when the webapplication is open I have done the frontend in reactjs. I heard this can be done using polling or webhooks. I want to use webhooks. How to do this. What should i do on the backend side and also on the frontend side -
django: simulate a flags Field using BInaryField
So I'm trying to simulate a flags field in Django (4.0 and Python3) the same way I could do in C or C++. It would look like this: typedef enum{ flagA = 0, flagB, flagC } myFlags; Having a uint8 that by default is 00000000 and then depending on if the flags are on or off I'd do some bitwise operations to turn the three least significant bits to 1 or 0. Now, I could do that in my model by simply declaring a PositiveSmallIntegerField or BinaryField and just creating some helper functions to manage all this logic. Note that I DO NOT NEED to be able to query by this field. I just want to be able to store it in the DB and very occasionally modify it. Since it's possible to extend the Fields, I was wondering if it would be cleaner to encapsulate all this logic inside a custom Field inheriting from BinaryField. But I'm not really sure how can I manipulate the Field value from my custom class. class CustomBinaryField(models.BinaryField): description = "whatever" def __init__(self, *args, **kwargs): kwargs['max_length'] = 1 super().__init__(*args, **kwargs) For instance, if I wanted to create a method inside CustomBinaryField, like the following, … -
Interpolate Django model
I have a Django model with data with a Date and a numerical value. Sometimes some dates are missing. Is there a way to automatically interpolate the data? For instance: 2021-Dec-20: 10 2021-Dec-19: 8 2021-Dec-15: 4 would become: 2021-Dec-20: 10 2021-Dec-19: 8 2021-Dec-18: 7 2021-Dec-17: 6 2021-Dec-16: 5 2021-Dec-15: 4 I have written some code to do this manually triggered with Django Background Tasks but I was wondering if there is a more standard approach to do this? -
How do I replace MemcachedCache with PyMemcacheCache in Django?
I'm running my website on Django 3.2. I read in Django’s cache framework that MemcachedCache and python-memcached are deprecated. I installed pymemcache==3.5.0 on my staging server and changed to CACHE_URL=pymemcache://127.0.0.1:11211 in env.ini. But if I uninstall python-memcached with pip I receive an error message, that indicates that MemcachedCache is still used by my code, and it fails on import memcache. My code uses the following imports: from django.core.cache import cache from django.core.cache.backends.base import DEFAULT_TIMEOUT How do I replace MemcachedCache with PyMemcacheCache so that MemcachedCache will not be used in my code? -
Django: OR search with the field value of the model and the m2m field value of that model is slow
Django: It takes a long time to filter the m2m model from the m2m-connected model by specifying the field values of the m2m model This question is similar to this one, but when I do a filter using the m2m field from a model that is tied to m2m, the query is very slow. How can I reduce the number of useless INNER JOIN as shown in the answer to the question above? Video.filter(Q(title__icontains='word') | Q(tags__name__icontains='word')).order_by('-published_at') Query issued SELECT "videos_video"."id" FROM "videos_video" LEFT OUTER JOIN "videos_video_tags" ON ("videos_video"."id" = "videos_video_tags"."video_id") LEFT OUTER JOIN "videos_tag" ON ("videos_video_tags"."tag_id" = "videos_tag"."id") WHERE (UPPER("videos_video"."title"::text) LIKE UPPER('%word%') OR UPPER("videos_tag"."name"::text) LIKE UPPER('%word%')) ORDER BY "videos_video"."published_at" DESC; EXPLAIN(ANALYZE, VERBOSE, BUFFERS) QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Gather Merge (cost=51955.59..52038.90 rows=714 width=24) (actual time=1209.450..1305.089 rows=335972 loops=1) Output: videos_video.id, videos_video.published_at Workers Planned: 2 Workers Launched: 2 Buffers: shared hit=1617 read=19577, temp read=14576 written=14846 -> Sort (cost=50955.57..50956.46 rows=357 width=24) (actual time=1194.858..1209.600 rows=111991 loops=3) Output: videos_video.id, videos_video.published_at Sort Key: videos_video.published_at DESC Sort Method: external merge Disk: 3712kB Buffers: shared hit=1617 read=19577, temp read=14576 written=14846 Worker 0: actual time=1187.952..1202.470 rows=110827 loops=1 Sort Method: external merge Disk: 3696kB Buffers: shared hit=556 read=6211, temp read=5020 written=4740 Worker 1: actual time=1189.482..1203.544 rows=113757 loops=1 Sort Method: external merge Disk: … -
Django/Pillow - Image resize only if image is uploaded
I'm able to upload an image and resize it, but if I submit the form without images I get this error The 'report_image' attribute has no file associated with it. What should I do if no image is uploaded? This is my models.py class Report(models.Model): options = ( ('active', 'Active'), ('archived', 'Archived'), ) category = models.ForeignKey(Category, on_delete=models.PROTECT) description = models.TextField() address = models.CharField(max_length=500) reporter_first_name = models.CharField(max_length=250) reporter_last_name = models.CharField(max_length=250) reporter_email = models.CharField(max_length=250) reporter_phone = models.CharField(max_length=250) report_image = models.ImageField(_("Image"), upload_to=upload_to, null=True, blank=True) date = models.DateTimeField(default=timezone.now) state = models.CharField(max_length=10, choices=options, default='active') class Meta: ordering = ('-date',) def save(self, *args, **kwargs): super().save(*args, **kwargs) img = Image.open(self.report_image.path) if img.height > 1080 or img.width > 1920: new_height = 720 new_width = int(new_height / img.height * img.width) img = img.resize((new_width, new_height)) img.save(self.report_image.path) def __str__(self): return self.description -
ckeditor5 error "toolbarview-item-unavailable" on Vuejs3 and Django
I am using CkEditor5 on my Vuejs3 and Django project, it works fine but I cannot use additional features, gives me error toolbarview-item-unavailable. What should I do to upload pictures to my django app? Features I got Features I want to get <script> import ClassicEditor from '@ckeditor/ckeditor5-build-classic'; export default { data() { return { editor: ClassicEditor, editorData: '<p>Asosiy malumotlar</p>', editorConfig: { // The configuration of the editor. toolbar: { items: [ 'heading', '|', 'alignment', '|', 'bold', 'italic', 'strikethrough', 'underline', 'subscript', 'superscript', '|', 'link', '|', 'bulletedList', 'numberedList', 'todoList', 'fontfamily', 'fontsize', 'fontColor', 'fontBackgroundColor', '|', 'code', 'codeBlock', '|', 'insertTable', '|', 'outdent', 'indent', '|', 'uploadImage', 'blockQuote', '|', 'undo', 'redo' ], } } } }, } </script> -
Guidance question: Dockerized Django backend, and React front end Intranet application authentication question
This is more of a guidance question for a situation where we're stuck. Basically we've to deploy an Intranet application on client's Windows based network. Our API backend is written in Django which serves React based frontend, during offline development phase we used DRF - AuthUsers, Django Rest Framework and Simple JWT tokens, and deployed using Linux Docker Images. We've to deploy these in client's environment for which we've to implement Single Sign-On, Windows active directory authentication. Ideal target is Kubernetes but for first cut we can use plain old Docker containers. After some research, and input from client's IT dept, we've to use Apache2 Webserver docker container, set Kerberos config, keytab and deploy in same domain as that of Active Directory. We've few blockers: 1) Should we create 2 separate Apache2 based docker images, one to host Django backend and other for React frontend? 2) Where should we implement AD Authentication? i.e. frontend or backend? 3) If AD authentication needs to be impelemented, what are the required npm packages that we can try out? Most of articles/blogs for this scenario are referring to MSAL.js but our AD is on premises, not Azure based. We're using Axios for calling Django … -
Assertion Error - calling an function method inside another function in Django
I have created two API's ("startshift", "endshift") when they click on the "startshift" and "endshift" button, an another API "UserShiftDetailsAPI" will be called which return the response based on "UserStartShift" and "UserStopShift".These API are working correctly I have created a conditional statement in "UserShiftDetailsAPI" for both "UserStartShift" and "UserStopShift" but its giving as assertion error. I don't know how to call the both API method inside the function. Here, What I have tried views.py: startshift @api_view(['POST', 'GET']) def UserStartShift(request): if request.method == 'GET': users = tblUserShiftDetails.objects.all() serializer = UserShiftStartSerializers(users, many=True) return Response(serializer.data) if request.method == 'POST': UserId = request.data.get('UserId') Ip = request.data.get('Ip') PortNumber = request.data.get('PortNumber') cursor = connection.cursor() r=cursor.execute('EXEC [dbo].[Usp_StartShift] @UserId=%s, @IP=%s, @Port=%s', (UserId, Ip, PortNumber,)) return Response(True, status=status.HTTP_200_OK) endshift @api_view(['GET', 'POST']) def UserStopShift(request, UserId): if request.method == 'GET': cursor = connection.cursor() cursor.execute('EXEC [dbo].[USP_StopShift] @UserId=%s',(UserId,)) return Response(True) elif request.method == 'POST': serializer = UserShiftEndSerializers(data=request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) In GET method I have applied the condition but its showing an error. It should return the response based on the "UserStartShift and "UserStopShift" method UserShiftDetails @api_view(['GET']) def UserShiftDetailsView(request, userid): try: users = tblUserShiftDetails.objects.filter(UserId=userid) except tblUserShiftDetails.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) if request.method == 'GET': if UserStartShift == True: cursor … -
Django HTTP Error 404: Not Found: Using a config.json file in my views
I have 3 apps and one is called 'cv' but for this app I use a config.json file but it keeps giving me a 404-error when loading the page. My project is called "project_1" and my urls.py is defined as: urlpatterns = [ path("", include("cv.urls")), path("admin/", admin.site.urls), path("projects/", include("projects.urls")), path("blog/", include("blog.urls")), ] http://127.0.0.1:8000/admin http://127.0.0.1:8000/projects and http://127.0.0.1:8000/blog can be reached, but when I open http://127.0.0.1:8000 It gives me the error. In the cv-directory, I have my urls.py defined as: urlpatterns = [ path("", views.index, name="cv_index"), ] And my cv/views.py as: def index(request): BASEURL = request.build_absolute_uri() url = BASEURL + "/static/configuration/configuration.json" response = urllib.request.urlopen(url) configuration = json.loads(response.read()) return render(request, "index.html", configuration) Where my json configuration is located in the cv directory under static>configuration>configuration.json When I change my index function in cv/views.py to just render the request and give back my index.html file, it goes fine. So I expect it has something to do with this piece of code: BASEURL = request.build_absolute_uri() url = BASEURL + "/static/configuration/configuration.json" response = urllib.request.urlopen(url) configuration = json.loads(response.read()) My traceback looks like this: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 3.2.6 Python Version: 3.9.9 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'projects', 'blog', 'cv'] Installed … -
cant get hello world in django
I have python version 3.10.1 and django version 4.0 url in project( name = home)` from django.contrib import admin from django.urls import path,include urlpatterns = [ path('',include('hello.urls')), path('admin/', admin.site.urls), ] url in app (name = hello) from django.contrib import admin from django.urls import path,include urlpatterns = [ path('',include('hello.urls')), path('admin/', admin.site.urls), ] views in app from django.http import HttpResponse # Create your views here. def index(request): return HttpResponse("Hello World") I tried running server with and without adding 'hello' in setting.py still i get only default page. stuck from 3 days