Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
What are the best frameworks for form-intensive applications?
At work, we primarily build websites that utilize lots of forms and data input. We are currently using Laravel and realized it's not best suited for form building especially form validations as we had do write a lot of our own custom validation even for simple stuff like checkboxes. And we are having a discussion about moving to a different framework even if it's not based on PHP. And so far, Django has been our top choice. -
Social Media Publishing for Django (Django CMS)
How can I post the messages from Django or Django CMS to Multiple Social Networks? -
Django: Prepopulate fields from other model or add manually
I can't find how to achieve the following: Say you have two models: Candidates (first_name, last_name, brith_date) Developers (first_name, last_name, birth_date, team_name, salary, ...) Candidates are recruited by an external company. Each morning they refresh a csv-file listing the data of all active candidates. There also is a cron job to sync the csv-file to the Django Candidates model. Now, when an admin wants to add a new Developer to a team, he should be able to: Select a Candidate from the Candidate model and 'copy' the personal data into the Developer table. Team_name, salary and other fields are added manually When a developer is recruited not via the external recruiting company, the Admin should be able to add the personal info manually. I could reference Candidate one-on-one in the Developers model, but this has the disadvantage that the Candidate list also has the active developers in it, and therefore can not be synced to the recruiters csv file. I would prefer just to optionally copy the personal data from the Candidates model to the Developers model, or add them manually. Any ideas on how to do this would be greatly appreciated! -
Python - generate PDF with many pages per sheet
I'm developing an application using python and django. There is a need to print a PDF report. Each page is basically a list of a sale products. I'm generating PDF with reportlab, after this, I use pdfnup to put many pages together. But pdfnup allows to put 2, 4, 6 ... pages per sheet. Now, I need to put 3 pages 9x21cm together in each A4 landscape page. That is, need divide A4 page in 3 Example: Original page Desired layout Is there a lib to do that? Any suggestion? Thank you all in advance. -
Django make form field iterable
Having trouble getting my view to assign a role to a user. I'm using django-roles-permissions and everything works correctly in the shell, but when I try to use forms and views I get multiple errors. I think mostly figured it out, and I'm down to one error of: 'CharField' object is not iterable. I tried using .split(',') but it said it has no split attribute. Here is my code: forms.py: ROLES = [[g.id, g.name] for g in Group.objects.all().order_by('name')] class UserForm(forms.ModelForm): first_name = forms.CharField(widget=forms.TextInput(attrs={ 'class': 'form-control', 'id': 'first_name', 'tabindex': '1', })) last_name = forms.CharField(widget=forms.TextInput(attrs={ 'class': 'form-control', 'id': 'last_name', 'tabindex': '2' })) password = forms.CharField(widget=forms.PasswordInput(attrs={ 'class': 'form-control', 'tabindex': '4' })) confirm_password = forms.CharField(widget=forms.PasswordInput(attrs={ 'class': 'form-control', 'tabindex': '5' })) username = forms.CharField(widget=forms.TextInput(attrs={ 'class': 'form-control', 'id': 'username', 'tabindex': '-1', 'placeholder': 'Automatically generated suggestion...' })) email = forms.CharField(widget=forms.EmailInput(attrs={ 'class': 'form-control', 'tabindex': '3' })) roles = forms.CharField(widget=forms.SelectMultiple(choices=ROLES, attrs={ 'class': 'form-control select2', 'style': 'width:100%;', 'multiple': 'multiple', 'placeholder': 'Click on me to add a role' })) class Meta: model = User fields = ('username', 'email', 'password', 'confirm_password', 'first_name', 'last_name', 'roles') views.py: @login_required def create_employee(request): registered = False if request.method == 'POST': # Get info from "both" forms # It appears as one form to the user on the … -
Django REST Framework, working with list of objects after get_queryset
in my views.py there is ViewSet: class ProductViewSet(viewsets.ModelViewSet): queryset = Product.objects.all() serializer_class = ProductSerializer filter_class = OrderFilter filter_backends = ( OrderingFilter, DjangoFilterBackend, ) def get_queryset(self): ...some query... return products # return QuerySet object with all products in db. Where and how can I manipulate with Project objects after filtering? With ability to take data from request. For example: for product in products: # after pagination, filtering, etc. product.price = product.price*self.request.user.discount Thank you! -
makemigrations or migrate while server is runnig
I'm wondering how we can handle database migration in django while the site in production as while developing we stop the server then make changes in database then rerun the server I think it may be stupid question but I am learning by myself and can't figure it out thanks in advance. -
Getting error while inserting into DB using Django and Python
I am one error while saving data into DB using Django and Python. Error is given below. Error : Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/lampp/htdocs/d30/carClinic_vulnerable/bookingservice/views.py", line 153, in signsave passw.save() File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 806, in save force_update=force_update, update_fields=update_fields) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 836, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 922, in _save_table result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 961, in _do_insert using=using, raw=raw) File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 1063, in _insert return query.get_compiler(using=using).execute_sql(return_id) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 1099, in execute_sql cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 84, in execute sql = self.db.ops.last_executed_query(self.cursor, sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/operations.py", line 135, in last_executed_query params = self._quote_params_for_last_executed_query(params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/operations.py", line 124, in _quote_params_for_last_executed_query return cursor.execute(sql, params).fetchone() ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings. I am explaining my model file … -
csrf token not showing input fields - Django
I am new to django. am using django==1.11 am trying to create a form which inputs details of users. my views.py from django.shortcuts import render, render_to_response, redirect from django.template import loader, Template, Context, RequestContext from forms import UserForm from django.http import HttpResponse, HttpResponseRedirect from django.views.decorators import csrf ` def action(request): if request.POST: form = UserForm(data = request.POST) if form.is_valid(): form.save(commit = False) return HTTPResponseRedirect('/rfid/index') else: form = UserForm() args = {} args.update(csrf(request)) args['form'] = form return render_to_response('reg.html', args) ` forms.py `from django import forms from models import UserDetails class UserForm(forms.ModelForm): class Meta: model = UserDetails fields = '__all__' ` reg.html `{% extends "rfid/header.html" %} {% block content %} <div class="container"> <form action = "/" method="post">{% csrf_token %} <ul> {{ form.as_ul }} </ul> <input type="submit" name="submit" class="btn btn-default" value="Add User"> </form> </div> {% include "rfid/includes/htmlsnippet.html" %} {% endblock %} ` models.py `from django.db import models # Create your models here. class UserDetails(models.Model): GENDER_CHOICES = (('M', 'Male'), ('F', 'Female')) user_id = models.IntegerField(primary_key = True) name = models.TextField(max_length = 50) gender = models.CharField(max_length = 1, choices = GENDER_CHOICES) dob = models.DateTimeField() address = models.TextField(max_length = 200) phone = models.IntegerField() email = models.EmailField(max_length=254) photo_url = models.CharField(max_length = 200) def __str__(self): return self.name ` But … -
How to efficiently display large DataTables with Django?
Currently I'm trying to make a 'press it and leave it' type of application where the users enters some kind of text and is given out a linguistic analysis from it in the forms of DataTables using Django as the middleman, the only problem is that when bigger texts are inserted (100k+ words) rendering the tables in HTML becomes quite the bottleneck. I've thought about using server-side processing but setting it up with Django seems difficult since I don't actually save any data inside a database (necessary for libraries like ezTables or DataTables-view) or .txt file to get with ajax, I simply process the data and return a list into the template which is then printed out as table data one by one. (Which is what makes it slow) Using the current way, the HTML ends up with 250 000 rows of data which isnt necessary to be rendered out all at once. Is there a better way? Context User sends some text with a form. Form data is intercepted with Django and the text inside the POST is send directly into the language processor which is then made to return the resulting data in the form of pandas DataFrame, … -
Getting ValueError: while using encrypt and decrypt using Danjo and python
I am getting the following error while trying to encrypt my string type value. Error: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/lampp/htdocs/d30/carClinic_vulnerable/bookingservice/views.py", line 141, in signsave obj = AES.new('this is a carkey123', AES.MODE_CBC, 'This is an IV456') File "/usr/lib/python2.7/dist-packages/Crypto/Cipher/AES.py", line 94, in new return AESCipher(key, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/Crypto/Cipher/AES.py", line 59, in __init__ blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__ self._cipher = factory.new(key, *args, **kwargs) ValueError: AES key must be either 16, 24, or 32 bytes long I am explaining my code below. name = request.POST.get('uname') obj = AES.new('this is a carkey123', AES.MODE_CBC, 'This is an IV456') enpass = obj.encrypt(name) Please help me to resolve this error. -
Display PDF in my HTML Template with Django
I'm trying to display PDF document in my HTML Template but I get an issue. All seems to work fine, but my PDF is gray as you can see in the screenshot : I have my function which looks like : @login_required def Identity_Consultation_PDF(request) : query_id_ID = request.GET.get('q1idID') if query_id_ID : personne = get_object_or_404(Individu, pk = query_id_ID ) institution = InformationsInstitution.objects.last() data = {"personne" :personne, "institution" : institution} template = get_template('Identity_Individu_raw.html') # A modifier : template pdf généré html = template.render(Context(data)) result = StringIO.StringIO() filename = str(personne.Nom) + "_" + str(personne.Prenom) + "_" + str(personne.NumeroIdentification) path = Global_variables.Individu_path.path + filename + ".pdf" with open(path, "w+b") as file : pdf = pisa.pisaDocument(StringIO.StringIO(html.encode("utf-8")), file, link_callback=link_callback) if not pdf.err: return HttpResponse(result.getvalue(), content_type='application/pdf') return HttpResponse('We had some errors<pre>%s</pre>' % escape(html)) file.close() else : query_id_ID = Individu.objects.none() # == [] context = { "query_id_ID" : query_id_ID } return render(request, 'Identity_Consultation_PDF.html', context) And my HTML file : {% extends 'Base_Identity.html' %} {% load staticfiles %} {% load static %} {% load variables %} {% block content %} <div class="resume"> <h4> <b> <span class="glyphicon glyphicon-user"></span> Consulter la fiche d'identification d'un individu </b></h4> <form autocomplete="off" method="GET" action=""> <input type="text" name="q1idID" placeholder="N° ID" value="{{ request.GET.q1idID }}"> <input class="button" type="submit" … -
Directory is not created inside virtual environment folder
I am creating a django project but when I create a directory it is not created inside my current directory. I first installed virtualenv and after that I created a virtual environment by virtualenv env_mysite. Then I activated it by env_mysite\scripts\activate. Then I installed django by pip install django==1.11.2 . After that I tested and django was installed successfully. I activated the environment again and tried to create a directory by typing "django-admin startproject mysite". However the mysite directory was created inside Users\reza but not inside env_mysite folder. Could you please explain what is wrong here? why directory is not created inside env_mysite which is my virtual environment? Thank you -
Django Rest Framework ParentRelatedField metadata choices
Hello Everyone! I have latest django-rest-framework and I'm trying to make serializer show possible choices for each field on OPTIONS request. Here's part of my model # models.py class Task(models.Model): parent = models.ForeignKey('self', blank=True, null=True, related_name='child_tasks') title = models.CharField(max_length=128) status = models.CharField(max_length=16, choices=STATUS_CHOISES, default='new') priority = models.CharField(max_length=16, choices=PRIORITY_CHOISES, default='1') chief = models.ForeignKey('users.SystemUser', related_name='tasks', blank=True, null=True) And here's serializer # serializers.py class ParentRelatedField(serializers.PrimaryKeyRelatedField): def get_queryset(self): obj = self.context['view'].get_object() return Task.objects.exclude(pk=obj.pk) def get_user_choices(): return tuple([(i.id, i.system_name) for i in SystemUser.objects.all()]) class TaskDetailSerializer(serializers.Serializer): title = serializers.CharField() parent = ParentRelatedField( required=False, allow_null=True ) status = serializers.ChoiceField(choices=STATUS_CHOISES) priority = serializers.ChoiceField(choices=PRIORITY_CHOISES) chief = serializers.ChoiceField(choices=get_user_choices(), required=False) I achieved that for chief field using get_user_choices function, so i get: "chief": { "type": "choice", "required": false, "read_only": false, "label": "Chief", "choices": [ { "value": 1, "display_name": "First User Name" } ] } ParentRelatedField works great for validation, but not for metadata: "parent": { "type": "field", "required": false, "read_only": false, "label": "Parent" } I can't use ChoiceField with function (like in chief) for that because parent choice must exclude current Task object. -
Django-- Case insensitive username
Before anybody marks it as duplicate, I know there are tons of similar or exactly same question, but none of the solution seemed to work for me and I am clueless. As usual I want my User model from django.contrib.auth.models to have case insensitive username. I have tried both methods described here. Unfortunately none of those worked for me. Do I also need to edit my views.py after going through one the method described in the link? what should I do to achieve case insensitiveness? Here is my view def login_page(request): if(request.method == 'POST'): name = request.POST['user'] if not User.objects.filter(username=name).exists(): return render(request, 'login.html', {'error_user': 'user does not exist'}) pwd = request.POST['pwd'] user = authenticate(username=name, password=pwd) if user is not None: login(request, user) return redirect('index') else: return render(request, 'login.html', {'error_pwd': name}) else: return render(request, 'login.html') If i create a user with username "User" and try to login with username "user", it gives "user doesn't exist" error. -
find_element_by_class_name for multiple classes
Selenium in the API for Python / Django has the function driver.find_element_by_class_name (), but it is not written whether it can be used for several classes If possible, how? -
Django - When user clicks link have file location open
I am trying to add a link to an excel document for user to be able to open and edit. Currently the best I could do was to have the link on the webpage but when the user clicks on it it downloads a copy of the file instead of opening the file location. Is there a way to tell have the file open instead of downloading a copy? -
How to use external python script in django views?
If suppose I have a file full of functions in python naming basics.py which does not have a class inside it. and there's no __init__() function too. Now if I want to access the functions of basics.py inside the views.py . How can I do that? -
User can login from Android, but he cannot use functions that require authorization (using Django as backaend)
I am using Django build in authenticate functions. The android user is successfully logging in, but he cannot use the functions(Ex. on /events the logged in user needs to get some content, but he does not get it, even though he logged in) Any help ? - Quick notice. When i log in from web it is working fine( i can use all the functions ). -
I am trying to connect my Django app with Mysql database but when I tried to migrate loads of error started to pop up in the terminal.
I tried various ways (every solution mentioned in the stackoverflow) to solve the problem but still the problems continues. When I run : "python manage.py migrate" the following error is shown Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/core/management/base.py", line 305, in run_from_argv self.execute(*args, **cmd_options) File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/core/management/base.py", line 353, in execute self.check() File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/core/management/base.py", line 385, in check include_deployment_checks=include_deployment_checks, File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 61, in _run_checks issues = run_checks(tags=[Tags.database]) File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks new_errors = check(app_configs=app_configs) File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/core/checks/database.py", line 9, in check_database_backends for conn in connections.all(): File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/db/utils.py", line 226, in all return [self[alias] for alias in self] File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/db/utils.py", line 211, in __getitem__ backend = load_backend(db['ENGINE']) File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/db/utils.py", line 115, in load_backend return import_module('%s.base' % backend_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/Manish/Projects/Websites/SanirTVNetwork/SanirTV/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 28, in <module> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb Then I tried: "pip install mysql-python" as per the suggestions in the stackoverflow similar questions. I got the following error Collecting mysql-python Using cached MySQL-python-1.2.5.zip Complete output from command python setup.py egg_info: … -
Django Can't connect to MySQL server after 20-30 minutes?
In my django , It will cause "OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)")" after I don't use my website for 20-30 minutes. In django normal operation , mysql connect works well. Is it this issue is mysql connection timeout? Anyone knows what happen? Error log: 2017-06-26 09:01:00+00:00) [2017-06-26 09:01:00,018]: DEBUG : Next wakeup is due at 2017-06-27 09:01:00+00:00 (in 86399.995752 seconds) [2017-06-26 09:03:49,586]: ERROR : Job "job (trigger: cron[day_of_week='0-5', hour='9', minute='1'], next run at: 2017-06-27 09:01:00 UTC)" raised an exception Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/apscheduler/executors/base.py", line 125, in run_job retval = job.func(*job.args, **job.kwargs) File "/home/ubuntu/aws/StrategyCeleryWebsite_mysql/strategyceleryapp/views.py", line 403, in job if not strategy_output.exists(): File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 660, in exists return self.query.has_results(using=self.db) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 494, in has_results return compiler.has_results() File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 806, in has_results return bool(self.execute_sql(SINGLE)) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 824, in execute_sql sql, params = self.as_sql() File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 376, in as_sql where, w_params = self.compile(self.where) if self.where is not None else ("", []) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 353, in compile sql, params = node.as_sql(self, self.connection) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/where.py", line 79, in as_sql sql, params = compiler.compile(child) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 353, in compile sql, params = node.as_sql(self, self.connection) File "/usr/local/lib/python2.7/dist-packages/django/db/models/lookups.py", line 155, in as_sql lhs_sql, params … -
Python Django - django-filters app - autogenerate searchfield based on model
Alright, First time I'm asking a question over here, i did search for similar question but haven't found my answer yet.. I'm working on a simple delivery app with Django, it shows an overview of customers checkin in and out and some details on the delivery. I have a view called "CheckInsListView" and "CheckOutListView" and i would like to filter these lists on a user given date, based on the django-filters app. I tried following this link: https://simpleisbetterthancomplex.com/tutorial/2016/11/28/how-to-filter-querysets-dynamically.html The problem now is, the searchform is not automatically created. It does show the submit button but the formfield isn't generated. It doesn't come up with any errors either. Can somebody point out what I'm missing here? Thanks in advance, Kevin #filters.py from .models import Delivery import django_filters class DeliveryFilter(django_filters.FilterSet): class Meta: model = Delivery fields = ['arrival_date'] Adding the view: #views.py """ Create a search view to sort deliveries on date, django-filter app is used """ from django.shortcuts import render from .models import Delivery from .filters import DeliveryFilter def search(request): delivery_list = Delivery.objects.all() delivery_filter = DeliveryFilter(request.GET, queryset=delivery_list) return render(request, 'all_deliveries.html', {'filter': delivery_filter}) And urls #urls.py from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^search/$', views.search, … -
How to match and get count of record using Django and Python
I need to help. I need to match record as per input value using Django and Python. I am explaining my code below. models.py: class User(models.Model): """docstring for User""" uname = models.CharField(max_length=200) password = models.CharField(max_length=200) date = models.DateTimeField(default=datetime.now, blank=True) Views.py: def loginsave(): if request.method == 'POST': name = request.POST.get('uname') password = request.POST.get('pass') Here I need to match the record as per user name and passord. If any record present it will return 1 otherwise 0. Please help. -
Best Django practise - when to use views and when to use tags
I'm in the process of delving into Django into a little more depth - and I now have certain blocks around my website which are recycled, but not necessarily suited to a being placed in base.html and then sprinkled with {% extends /root/to/base.html %}. So, I have a bespoke widget I have created which is utilised on certain pages but in different configurations, is it best to register and inclusion tag and reference the template you want to accompany those stored variables and arrays/lists/dictionaries etc.. For me it seems easier to define tags and then dot these around where I need them and just make edits to the template that is registered with that tag method? But is this the accepted Django standard? -
Error when using execute_script
I'm trying to collect sponsored posts from facebook, using Python (django) + Selenium. Please do not talk about the Facebook API, I know about it, but the API does not have the required functionality. I go to the page without problems, but when I use first_post = driver.find_element_by_id("pagelet_ego_pane") driver.execute_script(\ 'var child = document.querySelector("%s");\ child.parentNode.parentNode.removeChild(child.parentNode);'\ % first_post) I'm trying to use explicit wait and see that this item is already on the page. But after I get this error message [https://i.stack.imgur.com/U6riq.png]