Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Is there a way to parse the AST from GraphQLString using Graphene/GraphQL
I'm looking to write a custom middleware for my GraphQL endpoint using PyJWT. The problem is that I don't want to protect my login mutation. So I'm trying to write the Middleware to exclude the login mutation. This was easy to do by writing a GraphQL middleware because the arguments passed to the Middleware provided me with the ability to check the name of the query. class JWTMiddleware(object): def resolve(self, next, root, info, **args): if info.field_name == 'login': return next(root, info, **args # rest of auth logic But because GraphQL always returns 200, I can't use the status code as my auth failure check on my client. And would have to check the errors array to see if the message is Unauthorized or something. Example Error Response: { errors: [ { message: 'Unauthorized: JWT invalid', ..., }, ... ], data: null } This is fine but I would prefer to use the status code of the response as my check so I decided to wrap the GraphQL view with a custom decorator. def jwt_required(fn): def wrapper(request): # no access to query name, just the GraphQLString # need function to parse the AST of a GraphQLString graphql_string = request.body.decode('utf-8') query_name = … -
Django - Too slow database record read
I have a database with about 1500 records about one class. I'm also using jQuery Datatables to list the records. But, it is very very slow. Even reducing the number of records to 100 it takes about 20~45 seconds to fully load a page. Doing the same select to find all 1500 records directly on database takes only 1 second. As I am using jQuery DataTables to paginate and search the values, is there a way to improve this loading table time? -
How to fetch data greater than a particular key value using pyrebase in firebase databse?
I am developing a web service and is new to pyrebase.. I only want to fetch data from database having key greater than the particular value. enter image description here suppose I want to fetch data with key value greater than 154711668000 what should I write?? -
Catch Django admin page errors
I want to handle django admin page errors inside the admin page and not let django redirect me to an error page like this. In django version 1.11.5 In the django admin page. If I enter a wrong value for a field (DataBase Error), the admin page redirects me to an error page. I want to redirect the user on the same admin page, but with a text message around the field. Error page -
error while starting a python worker : RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version
I have an error when trying to start my python worker. I found similar issues But it didn't help me solve my problem. When I try to restart my python worker I have a dependency errors I tried $ sudo pip uninstall requests $ sudo pip install requests $ sudo pip uninstall docopt $ sudo pip install docopt But when I execute : docker-compose restart worker I got this error worker_1 | wait-for-it.sh: django:8000 is available after 0 seconds worker_1 | /usr/local/lib/python3.6/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version! worker_1 | RequestsDependencyWarning) worker_1 | [2019-03-25 12:45:03] INFO Using /tmp/tmpxhd93lmq as temp directory to store data django_1 | [2019-03-25 12:45:03] INFO "GET /media/evaluation_scripts/386eca3d-6446-4944-bdbf-c97c43c785f4.zip HTTP/1.1" 200 1164 django_1 | [2019-03-25 12:45:03] INFO "GET /media/test_annotations/e694dd8f-0cb8-4de8-aa8e-8d07a5273229.txt HTTP/1.1" 200 21 django_1 | [2019-03-25 12:45:03] INFO "GET /media/test_annotations/3924d4fe-689a-4bf1-81e8-5180d2b290d1.txt HTTP/1.1" 200 21 django_1 | [2019-03-25 12:45:03] INFO "GET /media/evaluation_scripts/4010d7f2-7b3f-48e7-bd7b-03bb15efeebf.zip HTTP/1.1" 200 1179 django_1 | [2019-03-25 12:45:03] INFO "GET /media/test_annotations/d7aca11d-b81e-4602-abc5-b02227f11849.json HTTP/1.1" 200 17 django_1 | [2019-03-25 12:45:03] INFO "GET /media/test_annotations/b36c8940-a360-4035-b841-b78d3d7beb9d.json HTTP/1.1" 200 17 worker_1 | [2019-03-25 12:45:03] ERROR Exception raised while creating Python module for challenge_id: 2 worker_1 | Traceback (most recent call last): worker_1 | File "/code/scripts/workers/submission_worker.py", line 216, in extract_challenge_data worker_1 | … -
How to Return Error Message for Every Instance in Bulk (Array of JSON Objects) POST Request?
I am working on Restaurant Ordering Application. Order of items will be created as an Array of JSON object will be POSTed to orderdetail models, but when the stock of any of the item is not sufficient it will raise Exception. But I only can give an error for one item not all the items. For example: Current Stock Apple 5pcs Mango 10pcs When I make an order of Apple 10pcs and Mango 20pcs. I want to get an Error Message saying that "Apple and Mango stock is not sufficient". But currently, I only get "Apple stock is not sufficient" because I put apple as the first object in the array. If I put mango as the first object, I will get "Mango stock is not sufficient". For full of the code, you can check the repo link: here. My Models: class Menu(models.Model): image = models.ImageField(upload_to=path_and_rename) name = models.CharField(max_length=100) price = models.IntegerField() category = models.IntegerField() availability = models.BooleanField(default=False) qty = models.IntegerField(default=100) sellerID = models.ForeignKey(Seller, on_delete=models.PROTECT) class OrderDetail(models.Model): orderID = models.ForeignKey(Order, on_delete=models.PROTECT) menuID = models.ForeignKey(Menu, on_delete=models.PROTECT) price = models.IntegerField() qty = models.IntegerField() tableNumber = models.IntegerField() done = models.BooleanField(default=False) # orderTime = models.DateTimeField(auto_now_add=True) # finishTime = models.DateTimeField(auto_now=True) finishTime = models.DateTimeField(null=True, blank=True) sellerID … -
How to style username and password fields in allauth form
i have a style problem on my django project. i want to style my username and password fields in the allauth form i've tried the attr filter an error raised up it say that there is no attr filter. {{ form.username|attr:"class:input100"|attr:"placeholder:Username"|attr:"ty pe:text" }} -
How to update primary key field using Django Rest Framework
I have set field called cus_id into primary key field which is not AutoField. I need to change pk alon to keep other relevant data for same id should be in same index instead pk alone need to be change. if i gave request via PATCH/PUT it creates new record instead of updating PK so i have gone through django docs which says, The primary key field is read-only. If you change the value of the primary key on an existing object and then save it, a new object will be created alongside the old one. but i am using Django Rest Framework for my API generation.. I can achieve it through overriding DRF GET methods. but i want to do without overridden. is there any django way to update PK using DRF without overriding get method? My view: class ModelViewSet(ModelCustomViewSet): model = Model queryset = Model.objects.all() serializer_class = ModelSerializer filter_fields = model._meta.get_all_field_names() filter_backends = [DjangoFilterBackendExt, ] Serializer: class ModelSerializer(RequiredMixin): class Meta: model = Model update_lookup_field = "cus_id" -
I am not able to install mysqlclient in my Django project
i am trying to install mysqlclient in my Django project but it give error I am trying pip install mysqlclient but it it give error i am past error in below please refer please help. thankyou. code pip install mysqlclient error Failed building wheel for mysqlclient Running setup.py clean for mysqlclient Failed to build mysqlclient Installing collected packages: mysqlclient Running setup.py install for mysqlclient ... error Complete output from command c:\users\rawat.306498\envs\exampletest\scripts\ python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Rawat.306498\ \AppData\\Local\\Temp\\2\\pip-install-c604ee_k\\mysqlclient\\setup.py';f=getattr (tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close() ;exec(compile(code, __file__, 'exec'))" install --record C:\Users\Rawat.306498\A ppData\Local\Temp\2\pip-record-s24hlzc1\install-record.txt --single-version-exte rnally-managed --compile --install-headers c:\users\rawat.306498\envs\exampletes t\include\site\python3.7\mysqlclient: running install running build running build_py creating build creating build\lib.win32-3.7 copying _mysql_exceptions.py -> build\lib.win32-3.7 creating build\lib.win32-3.7\MySQLdb copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb copying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdb copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb creating build\lib.win32-3.7\MySQLdb\constants copying MySQLdb\constants\__init__.py -> build\lib.win32-3.7\MySQLdb\constan ts copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\const ants copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.7\MySQLdb\constants copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.7\MySQLdb\constant s copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants running build_ext building '_mysql' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/ -
How to set ForeignKey in the model depending on a slug?
I have a registration form for an event. Since this registration form displays as a modal when clicking the 'Register' button on the event page, I know what event it is that the user want to register to. But Django doesn't, since I don't know how to implement this in code. I have two models: Participant and Event. Each instance of Participant refers to an Event instance by means of ForeignKey. How do I set that ForeignKey depending on the slug of the event page? This is my code example: models.py: from django.db import models class Event(models.Model): name = models.CharField(max_length=50) description = models.CharField(max_length=500) #<...> slug = models.SlugField() class Participant(models.Model): name = models.CharField(max_length=200) email = models.EmailField() event = models.ForeignKey(Event, on_delete=models.CASCADE) forms.py: from django.forms import ModelForm from .models import Participant class ParticipantForm(ModelForm): class Meta: model = Participant fields = ['name', 'email'] views.py: from django.template.loader import render_to_string from django.views import generic from .models import * from .forms import * class RegistrationView(generic.FormView): template_name = 'me/registration.html' form_class = ParticipantForm def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['event'] = Event.objects.get(slug=self.args[0]) return context def form_valid(self, form): form.save() return HttpResponse(render_to_string('me/registration-complete.html', {'event': Event.objects.get(reference_name=self.args[0])})) -
Why using bulk_create on Django to insert data with foreign keys returns "property object is not callable"?
I'm using Django 2.17 with a SQLite 3.26 database and trying to insert data from a csv file. I was using the get_or_create method, but it was too slow. So I start to try to insert using bulk_create. I have the following fields of Models being used: class SENSOR_TEMPERATURA(models.Model): ID_Sensor_Temperatura = models.AutoField(primary_key = True) class VALOR_TEMPERATURA(models.Model): ID_Valor_Temperatura = models.AutoField(primary_key = True) ID_Sensor_Temperatura = models.ForeignKey(SENSOR_TEMPERATURA, on_delete = models.PROTECT, null = False, db_column = 'VATE_CD_ID_Sensor_Temperatura') Data_De_Medição = models.DateTimeField(default = datetime.now(), null = False) Valor = models.DecimalField(default = 0, null = False, max_digits = 30, decimal_places = 15) The code that I'm trying to run is: print (datetime.datetime.now()) reader = csv.reader(f) insert_CSV = [] count = 1 for row in reader: insert_CSV.append([ VALOR_TEMPERATURA.pk(ID_Valor_Temperatura = count), VALOR_TEMPERATURA(Data_De_Medição = datetime.datetime.strptime(row[0] + " UTC-0300",'%d/%m/%Y %H:%M:%S %Z%z')), VALOR_TEMPERATURA(Valor = float(row[1])), VALOR_TEMPERATURA(ID_Sensor_Temperatura = SENSOR_TEMPERATURA.objects.get(ID_Sensor_Temperatura = 4)) ]) count = count + 1 print (datetime.datetime.now()) VALOR_TEMPERATURA.objects.bulk_create(insert_CSV) print (datetime.datetime.now()) The part that I think is put me in trouble is "ID_Sensor_Temperatura = SENSOR_TEMPERATURA.objects.get(ID_Sensor_Temperatura = 4))", but it is exactly how I defined the Foreign Key when using get_or_create, so I can't figure out what is the problem. I'm getting the following error: 6 for row in reader: 7 insert_CSV.append([ 8 … -
Return HttpResponse object and render page from Django views.py
I'm new to Django and have been learning by modifying some existing code. The original code, in the views.py file, had a method that returned an HTTP Response object (lets call this resp) to the browser, on the click of a button. I want to be able to open a new page on a click of that button (which I am doing using the render() function) as well as pass resp to it (this is because the 3rd party API that I am using needs this HttpResponse object in order to work). Is there anyway I can do this? I thought of passing resp as part of the context parameter in the render() function, but I don't understand how I can collect back the value from this context dictionary and then return it to the browser. -
My Django form is not rendering when I use Bootstrap's modal
I have some trouble with rendering a Django form in a modal. I suspect it is because I need some Ajax to get the url in the browser but I don't know how. Form: class TrackedWebsitesForm(forms.ModelForm): class Meta: model = TrackedWebsites fields = "__all__" View: def web(request): if request.method == 'POST': form = TrackedWebsitesForm(request.POST) if form.is_valid(): try: form.save() return redirect('/websites') except: pass else: form = TrackedWebsitesForm() return render(request,'dashboard/create_website.html',{'form':form}) Urls: urlpatterns = [ path('web', views.web), create_website.html: <div id="addEmployeeModal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <form method="POST" class="post-form" action="/web"> {% csrf_token %} <div class="modal-header"> <h4 class="modal-title">Add website</h4> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> </div> <div class="modal-body"> <div class="form-group"> {{ form.as_p }} </div> <div class="modal-footer"> <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"> <input type="submit" class="btn btn-success" value="Add"> </div> </form> </div> </div> </div> Can somebody help me out? I render the form fields manually but I just cut it with form.as_p otherwise the question would not validate because there was too much code. -
Required Field to False for ManyToManyField DRF
I am trying to add required=False field for ManyToManyField (user_groups). But i don't know how to do it because it is manytomanyfield. user_groups is many to many field. Even i want to change name user_groups to groups so that i can use it to create and update APIView class EmployeeProfileSerializerUpdate(serializers.ModelSerializer): employee_id = serializers.CharField(source='user_employee_id', required=False) payroll_id = serializers.CharField(source='user_payroll_id', required=False) phone = serializers.CharField(source='user_phone', required=False) hire_date = serializers.DateField(source='user_hire_date', required=False) pay_rate = serializers.IntegerField(source='user_pay_rate', required=False) salaried = serializers.CharField(source='user_salaried', required=False) excempt = serializers.CharField(source='user_excempt', required=False) state = serializers.CharField(source='user_state', required=False) city = serializers.CharField(source='user_city', required=False) zipcode = serializers.IntegerField(source='user_zipcode', required=False) status = serializers.CharField(source='user_status', required=False) class Meta: model = UserProfile fields = [ 'employee_id', 'phone', 'payroll_id', 'hire_date', 'pay_rate', 'salaried', 'excempt', 'state', 'city', 'zipcode', 'status', 'user_groups', ] -
Load multiple keras weight files in Django
I have a Django web app which I need to integrate with two Keras models. I have the weight files(.hdf5) files and I build my baseline model and then load the weights as shown below. I get an feed a value to Tensor whenever I try to use it for predicting. I've attached the error along as a screenshot I've tried various solutions with different graphs and sessions logic but none of them worked. The current one I'm trying, I get the error def build_model(): model = tf.keras.models.Sequential() model.add(tf.keras.layers.Flatten(input_shape=(28,28,))) model.add(tf.keras.layers.Dense(32, activation="relu")) model.add(tf.keras.layers.Dense(10, activation="sigmoid")) return model def build_model_1(): model = tf.keras.models.Sequential() model.add(tf.keras.layers.Flatten(input_shape=(256,256,))) model.add(tf.keras.layers.Dense(32, activation="relu")) model.add(tf.keras.layers.Dense(32, activation="relu")) model.add(tf.keras.layers.Dense(10, activation="sigmoid")) return model graph1 = Graph() with graph1.as_default(): model = build_model() model.load_weights('model_weights.hdf5') model.compile(optimizer.....) model._make_predict_function() graph2 = Graph() with graph2.as_default(): model_1 = build_model_1() model_1.load_weights('model_weights_1.hdf5') model_1.compile(optimizer.....) model_1._make_predict_function() Error image -
Django-Cookiecutter cannot start the default project
I am trying to start a fresh project with django-cookiectter, it build fine but when i am trying to docker-compose -f local.yml up it gives me this error on django's service: django_1 | No migrations to apply. django_1 | * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit) django_1 | * Restarting with stat ': No such file or directorycute 'python -
Using Django's full text Postgresql search to match phrases
I'm using Django's full text search successfully. However, I would like to match quoted phrases and can't see how to do this. For example, I have a model: from django.contrib.postgres.indexes import GinIndex from django.contrib.postgres.search import SearchVectorField from django.db import models class Article(models.Model): title = models.CharField(max_length=100) body = models.TextField() search_document = SearchVectorField(null=True) class Meta: indexes = [ GinIndex(fields=['search_document']) ] And I've done this: from django.contrib.postgres.search import SearchVector Article.objects.update( search_document=( SearchVector('title', weight='A') \ + SearchVector('body', weight='B') ) ) But, if I do a search for: "tasty apples" fish like this: from django.contrib.postgres.search import SearchQuery qs = Article( search_document=SearchQuery('"tasty apples" fish')) then the results are the same as if I search for: tasty apples fish i.e, articles that contain those three words, rather than articles that contain the phrase "tasty apples" and the word "fish". Is it possible to search for phrases like this? -
How to Change ManyToManyField Name in Serializer
I want to change ManyToManyField Name. user_groups is manytomanyfield. I tried to use ManyToManyRelatedField and also PrimaryKeyRelatedField but it is giving error. How can i change or with data type should i give like for character field i am giving CharField class EmployeeProfileSerializer(serializers.ModelSerializer): employee_id = serializers.CharField(source='user_employee_id') payroll_id = serializers.CharField(source='user_payroll_id') phone = serializers.CharField(source='user_phone') hire_date = serializers.DateField(source='user_hire_date') pay_rate = serializers.IntegerField(source='user_pay_rate') salaried = serializers.CharField(source='user_salaried') excempt = serializers.CharField(source='user_excempt') state = serializers.CharField(source='user_state') city = serializers.CharField(source='user_city') zipcode = serializers.IntegerField(source='user_zipcode') status = serializers.CharField(source='user_status') class Meta: model = UserProfile fields = [ 'employee_id', 'phone', 'payroll_id', 'hire_date', 'pay_rate', 'salaried', 'excempt', 'state', 'city', 'zipcode', 'status', 'user_groups', ] -
Add fields of another model in Django's built-in LoginView for Login
I want to make a login system, in this i want to use "Company Name" "User name" and "Password" for login, can i customize it with Django built-in LoginView? "Company name" is Company model field. Here is my Company Model: from django.db import models class Company(models.Model): company_id = models.AutoField(primary_key=True) company_name = models.CharField(max_length = 100) pin_code = models.CharField(max_length = 100) is_active = models.BooleanField(default = True) -
Why do we to put templates in <app>/templates/<app>/blah.html, even though the default path is <app>/templtes/
According to the latest Django Documentation for templates namaspace, we should put our templates in the order. app/templates/app/template_files But the default location it looks for templates is app/templates/, why not simply create a template file in templates sub-folder ? Template namespacing Now we might be able to get away with putting our templates directly in polls/templates (rather than creating another polls subdirectory), but it would actually be a bad idea. Django will choose the first template it finds whose name matches, and if you had a template with the same name in a different application, Django would be unable to distinguish between them. We need to be able to point Django at the right one, and the easiest way to ensure this is by namespacing them. That is, by putting those templates inside another directory named for the application itself. According to the explanation give in the documentation my approach would lead to ambiguity. so let's say we have two apps viz. app1 & app2 and they have index.html in app/templates/ path, why can't django distinguish between two different path - /app1/templates/index.html & /app2/templates/index.html ? -
Need guidance with creating Django based dashboard
I'm a beginner at Django, and as a practice project I would like to create a webpage with a dashboard to track investments in a particular p2p platform. They do not have a nice dashboard (but provide excel file with all data). As I see it, main steps that I need to do in this project are as follow: Create login so that users would have account where they upload their excel files. Make it possible to import excel file to a database Manipulate/calculate data for it to be later used in dashboard Create dashboard. Host webpage. After some struggle I have implemented point no. 2, and will deal with 1 and 5 later. But number 3 is my biggest issue now. I'm completely unsure what I need to do, and google did not help. I need to calculate data before I can make dashboard from it. Union two of the tables, and then join them together with a third table, creating some additional needed calculated fields. Do I create a view in the database and somehow fetch this data to Django? Or do I need to create some rules so that new table would be created at the time … -
How to fix "SyntaxError: 'return' outside function" [on hold]
I am getting this error from python: SyntaxError: 'return' outside function All existing queries in stackoverflow on this subject point to an error in indentation which I cannot see in my code. I am using Atom editor. I tried converting tabs to whitespaces several times. Note: If line 5, new_rec = ... looks wrapped in your page it has been done by stackoverflow. It is one line in my code. class AddArticleView(request): if request.method == "POST": form = AddArticleForm(request.POST) if form.is_valid(): new_rec = Article(title=request.POST['title'], text=request.POST['text'], author=request.user.id) new_rec.save() return redirect('home') elif request.method == "GET": form = AddArticleForm() context = {'form': form} return render(request, 'add.html', context) -
Update tasks in Celery with RabbitMQ
I'm using Celery in my django project to create tasks to send email at a specific time in the future. User can create a Notification instance with notify_on datetime field. Then I pass value of notify_on as a eta. class Notification(models.Model): ... notify_on = models.DateTimeField() def notification_post_save(instance, *args, **kwargs): send_notification.apply_async((instance,), eta=instance.notify_on) signals.post_save.connect(notification_post_save, sender=Notification) The problem with that approach is that if notify_on will be chanhed by the user, he will get two(or more) notifications instead of one. The question is how do I update the task associated with a specific notification, or somehow delete the old one and create new. -
Authorization Problem with Django Authentication framework
I want to make an authentication system using the Django authentication framework. But I get 2 different errors from login and logout, which are attached below. Django Version: 2.1.4 When switching to account/login/: TypeError at /account/login/ login() missing 1 required positional argument: 'user' When switching to account/logout/: ValueError at /account/logout/ The view django.contrib.auth.logout didn't return an HttpResponse object. It returned None instead. Some code: Views.py def user_login(request): if request.method == "POST": form = LoginForm(request.POST) if form.is_valid(): cd = form.cleaned_data user = authenticate(username=cd['username'], password=cd['password']) if user is not None: if user.is_active: login(request, user) return HttpResponse('Authenticated successfully') else: return HttpResponse('Disabled account') else: return HttpResponse('Invalid login') else: return HttpResponse('Form is not valid') else: form = LoginForm() return render(request, 'account/log-in.html', {'form': form}) urls.py from django.contrib.auth.views import auth_login, auth_logout, logout_then_login from django.conf.urls import url from . import views urlpatterns = [ url(r'^login/$', auth_login, name='login'), url(r'^logout/$', auth_logout, name='logout'), url(r'^logout_then_login/$', logout_then_login, name='logout_then_login'), url(r'^$', views.dashboard, name='dashboard'), ] base.html <div id="header"> <span class="logo">Bookmarks</span> {% if request.user.is_authenticated %} <ul class="menu"> <li {% if section == 'dashboard' %}class="selected"{% endif %}> <a href="{% url 'dashboard' %}">My dashboard</a> </li> <li {% if section == 'images' %}class="selected"{% endif %}> <a href="#">Images</a> </li> <li {% if section == 'people' %}class="selected"{% endif %}> <a href="#">People</a> </li> … -
Unable to parse json string indices must be integers
unable to parse data I just printed data = json.loads(somepostmessage) output of data {'number': 'INC0010021', 'title': 'ghjghjgh', 'description': 'test creating sericenow tickets through post', 'state': 'New', 'priority': 'Planning', 'assigned_to': '', 'caller_id': ''} I was trying to parse through it data['number'] Error: String indices must be integers