Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Timeout when reading response headers from daemon process 'swpdoc': /var/www/swpdoc/swpdoc/wsgi.py
I am getting this error radomaly (not always) Timeout when reading response headers from daemon process 'swpdoc': /var/www/swpdoc/swpdoc/wsgi.py Here is my httpd.conf WSGIScriptAlias / /var/www/swpdoc/swpdoc/wsgi.py WSGIApplicationGroup %{GLOBAL} <Directory /var/www/swpdoc/swpdoc> <Files wsgi.py> Require all granted </Files> </Directory> WSGIDaemonProcess swpdoc python-home=/var/www/swpdoc/venswpdoc python- path=/var/www/swpdoc WSGIProcessGroup swpdoc Any help. Loading the index page taking so long and sometime i get timeout errors. I am also using whoosh -
AttributeError: 'property' object has no attribute 'copy' - while trying to get object list in Django Rest
To practice my Django skills i try to make simple module that should work more or less like Admin site in Django. It should gather all Models from Application, list them and show every object from each Model. i try to do is using Django Rest Framework. Here is my views.py. I have 2 views. The api_root listens all models but it also sends params-models_names to another view 'model_view'. The ModelViewSet should list all objects from particular model. class ModelsViewSet(viewsets.ModelViewSet): def get_serializer(self, *args, **kwargs): serializer_name = '{model_name}Serializer'.format( model_name=self.kwargs.get('name').split(".")[1] ) return getattr(serializers, serializer_name) def get_model(self): """methods return model based on name kwargs :return: """ return apps.get_model(self.kwargs.get('name')) def get_queryset(self): return self.get_model().objects.all() def get_object(self): return self.get_model().objects.get(pk=self.kwargs.get('pk')) @api_view(['GET']) def api_root(request, format=None): return Response([reverse( viewname='model_view', kwargs={'name': i._meta.label}) for i in apps.get_models()]) Here is my serializers.py. In this file serializers classes are dynamically build. Each class is built on the basis of the model from django.apps. from django.apps import apps from rest_framework import serializers from admin_site import serializers as m from . import models app_models = apps.get_models() for item in app_models: name = "{}Serializer".format(item.__name__) class Meta(type): model = item fields = '__all__' m.__dict__[name] = type(name, (serializers.ModelSerializer,), {}) m.__dict__[name].__metaclass__ = Meta And finally here is my my_app.urls.py … -
Multi DB test - Create a dynamic ChoiceField for admin interface?
I am testing a multi-database setup and need to populate a ChoiceField in the admin interface. I need a pull down for the movie_title field in movies.MovieEvent populated from the title field of calendar_app.Event via the foreign key in calendar_app.EventOccurence. With a foreign key in play I can't make movie_title a foreign key to the EventOccurence model so I'm attempting to pull the records and then create a tuple to populate the pull down. Here's what I have, this throws ValueError, not enough values to unpack (expected 2, got 1): These models are routed to database #1: # calendar_app/models.py class Event(models.Model): title = models.CharField(max_length=100) tags = models.ManyToManyField(Tag) ... class EventOccurence(models.Model): event = models.ForeignKey(Event, related_name='event') event_date = models.DateField() ... This Model is routed to database #2: #movies/models.py class MovieEvent(models.Model): movie_title = models.CharField(max_length=80) ... Admin: #admin.py from calendar_app.models import EventOccurrence ... class MovieEventAdminForm(forms.ModelForm): movie_events = EventOccurrence.objects.filter(Q(event__tags__slug__exact='movie')).distinct() y = ", (".join(str("'" + x.event.title + "', '" + x.event.title + "')") for x in movie_events) movie_choices = str("(" + "(" + y + ")") movie_title = forms.ChoiceField(choices=movie_choices) class Meta: model = MovieEvent fields = ( ... 'movie_title', ... ) class MovieEventAdmin(admin.ModelAdmin): form = MovieEventAdminForm The above throws the ValueError but when test my tuple … -
Django - new style middleware process_response
I'm using the new style middleware in Django, and for some reason, it never gets to the 'process_response' part. If I understand correctly, it should occur after the response = self.get_response(request) in __call__ function. But it never gets to the code beyond that line. What could be the reason? This is how my middleware is defined: class GlobalThreadVarMiddleware(object): _threadmap = {} def __init__(self, get_response): self.get_response = get_response def __call__(self, request): # Code to be executed for each request before # the view (and later middleware) are called. self._threadmap[_thread.get_ident()] = {} self._threadmap[_thread.get_ident()]['data_manager'] = DataManager() response = self.get_response(request) # Code to be executed for each request/response after # the view is called. current_data_manager = self.get_current_data_manager() current_data_manager.trigger_events() del self._threadmap[_thread.get_ident()]['data_manager'] return response @classmethod def get_current_data_manager(cls): return cls._threadmap[_thread.get_ident()]['data_manager'] -
Django Backblaze B2 Storage how to automaticly upload files
I'm deploying django and for static files deployment I used Backblaze B2 Storage service. I used a custom file storage wich integrate with b2. But, I need to upload every file manually to the cloud, and I'm wondering if exists a way, at the time to do python manage.py collectstatic, to upload every file processed by collecstatic command, and this way, always be in sync with cloud. -
Inner Join in Django
I have two tables front_employee (Employee model in Django) +-----------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | order | int(11) | NO | | NULL | | | name | varchar(100) | YES | | NULL | | | position | varchar(100) | YES | | NULL | | | description | longtext | YES | | NULL | | | employee_img_id | int(11) | NO | MUL | NULL | | | language_id | int(11) | NO | MUL | NULL | | +-----------------+--------------+------+-----+---------+----------------+ And front_employeepicture (EmployeePicture in Django) +-------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | order | int(11) | NO | | NULL | | | img | varchar(100) | YES | | NULL | | +-------+--------------+------+-----+---------+----------------+ I would like to perform this query: SELECT a.id, a.name, b.img FROM front_employee a INNER JOIN front_employeepicture b ON a.employee_img_id = b.id For now I have context['employee'] = Employee.objects.all().order_by('order') And I tried something like context['employee'] = Employee.objects.select_related('EmployeePicture') Without … -
how to access database model fields of parent model linked as e.g. Class->School->User?
I am fairly new to programming languages, django and database models. So my question is simple I have 3 models in models.py as class UserProfileInfo(models.Model): # create relationship with built-in user in admin user = models.OneToOneField(User) portfolio_site = models.URLField(blank=True) class School(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) name = models.CharField(max_length=256) principal = models.CharField(max_length=256) location = models.CharField(max_length=256) class Classroom(models.Model): school = models.ForeignKey(School, on_delete=models.CASCADE) class_name = models.CharField(max_length=256) desc = models.CharField(max_length=256) And I want to access 'id' from User model. I have tried using def ClassroomView(request): classroom_list = Classroom.objects\ .filter(school__id=request.session.get('user_id','0'))\ .filter(user__id=1).values() class_dict = {'class_records': classroom_list} return render(request, 'basic_app/classroom_list.html', context=class_dict) And it gives the following error: FieldError at /basic_app/class/ Cannot resolve keyword 'user' into field. Choices are: class_name, desc, id, school, school_id Is there any way that i can access the fields of User model from Classroom model since it is linked by foreign key as Classroom->School->User Please tell me if I am doing something wrong here any insights and solutions are appreciated!! -
Creating a vulnerable Django search bar
I want to create a vulnerable search bar and have done everything but unfortunately, the search function doesn't show any result when I press submit. But terminal shows successful, "POST /injection/ HTTP/1.1" 200 596 views.py @csrf_exempt def search_form(request): if 'searchField' in request.POST: query= "SELECT * FROM injection_search WHERE injection_search.name LIKE '%searchField%'" print(query) item = search.objects.raw(query) else: item = search.objects.all() return render(request, 'home.html', {'item' : item}) template/home.html {% load static %} <link href="{% static 'css/style.css' %}" rel="stylesheet"></link> <h1 class="page-header">INJECTION</h1> <form action="" method="POST"> <input type="text" name="searchField" id="searchField" placeholder="search trainers.."> <button type="submit">Find</button> </form> <h1> Search Page </h1> <h3> Injection demo</h3> <div class="shopping-container"> <table border="3" cellspacing="0" cellpadding="10"> <tbody> <tr> <th>Title</th> <th>Description</th> <th>Quantity</th> </tr> <!--{% for search in item %}--> <tr> <td>{{ search.name}}</td> <td>{{ search.description }}</td> <td>{{ search.price}}</td> </tr> <!--{%endfor%}--> </tbody> </table> </div> model.py app_name = 'injection' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^injection/$', views.search_form, name='search_form'), ] -
Get reverse model foreign key object for inherited object
I have the following model with a reference an object and an object it inherits from: class Employee(models.Model): user = models.OneToOneField(User, blank=True, null=True) entity = models.ForeignKey('companies.Entity', blank=True, null=True) brand = models.OneToOneField('companies.Brand', related_name='brand', blank=True, null=True) class Entity(models.Model): name = models.CharField('Name', max_length=255, db_index=True) class Brand(Entity): company_name = models.CharField(max_length=128, blank=True, null=True) The problem is when I try to reference the inverse relationship, I can't access the Brand only the Entity. I want to get the employee associated with a brand. I tried this: brands = Brand.objects.filter(pk=2) for b in brands: print b.employee_set.all().query It outputs: SELECT * FROM `employee` WHERE `employee`.`entity_id` = 2 I want it to output: SELECT * FROM `employee` WHERE `employee`.`brand_id` = 2 -
No Reverse Match error in Django
New to Django and stuck on this error. My template was rendering correctly. The only change I made was adding a '1/0' in my views.py file to simulate a breakpoint. And now the template will not render when I remove it. urls.py from django.conf.urls import url from django.shortcuts import redirect from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.views import login, logout from app.views import send_morsel, start_hunt, MorselList, MorselDetailView,\ register, create_morsel, HomePageView, FAQPageView, AboutPageView,\ newsletter_signup, edit_morsel app_name = 'app' urlpatterns = [ url(r'^$', HomePageView.as_view(), name='home'), url(r'^morsels/$', MorselList.as_view(), name='morsel_list'), url(r'^morsels/send/$', send_morsel, name='morsel_send'), url(r'^morsels/(?P<morsel_id>[0-9])/start_hunt/$', start_hunt, name='start_hunt'), url(r'^register/', register, name='register'), url(r'^faq/$', FAQPageView.as_view(), name='faq'), url(r'^about/$', AboutPageView.as_view(), name='about'), url(r'^morsels/create/$', create_morsel, name="create_morsel"), url(r'^morsels/(?P<morsel_id>[0-9])/edit/$', edit_morsel, name='edit_morsel'), url(r'^morsels/(?P<pk>[0-9])/display/$', MorselDetailView.as_view(), name='morsel_detail'), url(r'^newsletter_signup/$', newsletter_signup, name='newsletter_signup') ] morsel_list.html {% extends "app/base.html" %} {% load bootstrap3 %} {% bootstrap_css %} {% bootstrap_javascript %} {% bootstrap_messages %} {% block content %} <h2>Morsels</h2> {% if user.is_authenticated %} <p>hello</p> <p>welcome {{ user.username }}</p> <p><a href="/logout">Logout</a></p> {% else %} <p><a href="/login">Login</a></p> <p><a href="/app/register">Register</a></p> {% endif %} <ul> {% for morsel in object_list %} <li>{{ morsel.name }} <a href="{%url 'app:morsel_detail' morsel.id%}">View</a> <a href="{%url 'app:edit_morsel' morsel.id %}">Edit</a> <a href="{%url 'app:start_hunt' morsel.id%}">Send! </a> </li> {% endfor %} </ul> {% if messages %} {% for msg in messages %} {% bootstrap_alert msg.message alert_type=msg.level_tag … -
Django - allowing specified user to modify certain fields
I need to allow a certain user, who is specified in the model, to modify a few of the model's fields. I know I need to create a permission class, which will control the whole process, but I have no idea how to do that. Here's the code sample: class Task(models.Model): creator = models.ForeignKey('auth.User', related_name='created_tasks', on_delete=models.CASCADE) target = models.ForeignKey(User, related_name='assigned_tasks', on_delete=models.CASCADE) title = models.CharField(max_length=100) description = models.TextField() created = models.DateTimeField(auto_now_add=True) deadline = models.DateTimeField() priority = models.CharField(max_length=50, choices=PRIORITY_CHOICES, default='NORMAL') progress = models.CharField(max_length=50, choices=PROGRESS_CHOICES, default='ASSIGNED') is_finished = models.BooleanField(default=False) So I want to allow the target, to modify only progress and is_finished fields. I am using DjangoRestFramework, not sure if that will help. Should I create a method, which will check if user == target, and ignore all the other changes or is it possible to create a permission which will do that. -
How to import rest_framework to public Django project?
i just wanted to publish my Django project but have the following problem: ImportError at / No module named rest_framework.views Request Method: GET Request URL: http://165.227.154.0/ Django Version: 1.8.7 Exception Type: ImportError Exception Value: No module named rest_framework.views Exception Location: /usr/lib/python2.7/dist-packages/gevent/builtins.py in __import__, line 93 Python Executable: /usr/bin/python Python Version: 2.7.12 Python Path: ['/home/django/django_project', '/home/django/django_project', '/usr/bin', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages'] Server time: Thu, 16 Nov 2017 19:30:11 +0000 If i run the project locally everything works. Now i have signed up at Digital Ocean and created a one click app. Started their server and uploaded all my files properly via FileZilla into the server directory. When I enter the IP adress into my browser I also get the reply: It worked! Congratulations on your first Django-powered page. But after I uploaded my files, installed the new apps and added the urls, I receive the Error from above. Apparently, the rest_framework module can not be imported and I don't know how to fix it. Is here someone who can help me? Thanks and kind regards Marcel -
Forward and Reverse Field Relationships in Django
The context is: I have a Match model where I want to store data for a football match. There are some fields are going to be common to all matches (not the value I mean the field name), such as season, local_team, away_team... But the stats of the match are going to differ (one match can have 2 goals and another one 0). My approach to building a common abstract (Django model) of Match is creating the class Stats (to store the actions) and the Class Action. So: Action will have fields --> minute, player, action(goal, red card...) Stats will have fields --> actions (Many to many field to store several actions) Match will have fields --> local, away, ref, stadium, stats (so all matches have 1 common field which is stats). The big question comes now, when I would like to give a proper name to actions and stats. Because a lot of actions and stats from different matches are going to be stored together, when de MatchAdminForm ask me for the stats of the game I want to know quickly which one corresponds, same when the StatsAdminForm ask me for the actions. The ideal for stats would be … -
Django fixture with all possible combinations?
I am trying to test a statistics function, which counts what type of objects I have in my database. For this I would like to create at least one instance of each possible combination of model fields. Random test data requires a lot of test objects to make sure all possible combinations are met. Here is a shortened example from one of my models: class Member(models.Model) is_active = models.BooleanField() name = models.CharField() balance = models.IntegerField() division = models.ForeignKey(Division, on_delete=models.CASCADE) Class Division(models.Model) name = models.CharField() This is how I'm doing it right now using django_dynamic_fixture: from django.test import TestCase from django_dynamic_fixture import G from members.models import Member class StatisticsTestCase(TestCase): def setUp(self): for is_active in [True, False]: for balance in [-100, 0, 100]: for division in Division.objects.all() G(Member, is_active=is_active, balance=balance, division=division) But this looks pretty bad and is hard to read. Is there a simpler way with better to read code to create all possible combinations of properties of an object? I'm open to different test data generators as long as they work nicely with Python 3 and Django. -
How to structure functional testing for a Django project
I would like to create functional tests to cover my Django project. It is a multipage form that accepts input on each page. The input on previous pages changes the content/options for the current pages. The testing is currently set up with Splinter and PhantomJS. I see two main ways to set this up. For each page, create an instance of that page using stored data and point Splinter towards that. Benefits Allows random access testing of any page in the app Can reuse unit test definitions to populate these synthetic pages Downsides Needs some kind of back end to be set up that Splinter can point to (At this point I have no idea how this would work, but it seems time consuming) Structure the testing so that it is done in order, with the test content of page 1 passed to page 2 Benefits Seems like it should just work out of the box Downsides Does not allow the tests to be run in an arbitrary order/only one at a time Would probably take longer to run Errors on earlier pages will affect later pages I've found many tutorials on how to do functional testing on a small … -
Login redirect to main domain using django-subdomains
My project is using django-subdomains and django-allauth to handle subdomains and auth system. It has a couple of subdomains: company1.project.com, company2.project.com Some of views are using @login_required decorator that redirects user to LOGIN_URL = '/login/' at settings.py Ex: user is at company1.project.com and calls view which redirects him to company1.project.com/login/ I need to redirect users to the project.com/login/ django-subdomains have tool reverse('login') which returns project.com/login/ if I do not pass subdomain argument, but I cannot use it in settings for LOGIN_URL because django apps are not loaded yet. -
How can I make a Wagtail Streamfield not required?
In the model below I want to make the bottom_content field in its entirety not required. How can I do this? class ServicePage(Page): top_content = StreamField(default_blocks + [ ('two_columns', TwoColumnBlock()), ('three_columns', ThreeColumnBlock()), ]) bottom_content = StreamField(default_blocks + [ ('two_columns', TwoColumnBlock()), ('three_columns', ThreeColumnBlock()), ]) search_fields = Page.search_fields + [ index.SearchField('top_content'), index.SearchField('bottom_content'), ] content_panels = Page.content_panels + [ StreamFieldPanel('top_content'), StreamFieldPanel('bottom_content'), InlinePanel('service_package', label='Packages') ] -
firstname and lastname not showing in django form
i'm trying to create a registration form with following information (firstname, lastname, email, password, password_confirm), however i do not get firstname and lastname. so far i only get username, password and password confirmation. what am i doing wrong in order to add the missing fields? forms.py class SignUpForm(UserCreationForm): first_name = forms.CharField(max_length=30, required=False, label='Fornavn', help_text='Optional.') last_name = forms.CharField(max_length=30, required=False, label='Efternavn', help_text='Optional.') email = forms.EmailField(max_length=254, label='Email', help_text='Required. Inform a valid email address.') class Meta: model = User fields = ('username', 'first_name', 'last_name', 'email') register.html {% for field in form %} <div class="form-group"> <label>{{ field.label }}</label> {% render_field field class="form-control" placeholder=field.help_text %} </div> {% endfor %} views.py def register(request): if request.user.is_authenticated(): return redirect('/account/') context = {} if request.method == "POST": form = SignUpForm(request.POST) if form.is_valid(): form.save() username = form.cleaned_data.get('username') raw_password = form.cleaned_data.get('password1') user = authenticate(username=username, password=raw_password) login(request, user) return redirect('/account/') else: form = UserCreationForm() return render(request, 'register.html', {'form': form}) urls urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^register/$', views.register, name='register') ] -
unsupported operand types in django
I am trying to get time delta between two objects obtained from "models.DateTimeField" gave the time in format "15:38:53:.000784" and "datetime.datetime.now" gave the time in format "15:38:53" . But when I tried to subtract the two values.I got an error saying "UNSUPPORTED OPERAND TYPES" Is there any suggestion I can follow to overcome the situation -
DjangoREST json parsing id instead of name
im new to Django (and to the DjangoREST framework)and and I've been struggling for a while with the following: I want for "especies" (apologies for the portuguese..) to be a vector with the names of the model Especies(scroll down pls) and instead this is giving me the id corresponding to the Especie. "especies": [ 13, 14 ] I want, for example: "especies": [ Z1, Z2 ] Thanks in advance! The JSON parsed: { "count": 1, "next": null, "previous": null, "results": [ { "codigo": "Z3", "area": "Z_tres", "especies": [ 13, 14 ], "id": 17 } ] } FROM THE DJANGO REST APP: views.py from django.shortcuts import render from species.models import Especie, Zona, EspecieZona from rest_framework import viewsets from rest.serializers import ZonaSerializer class ZonaViewSet(viewsets.ModelViewSet): queryset = Zona.objects.all() serializer_class = ZonaSerializer serializers.py from species.models import Zona from rest_framework import serializers class ZonaSerializer(serializers.ModelSerializer): class Meta: model = Zona fields = ('codigo', 'area', 'especies', 'id') The models.py on this app is empty. FROM THE MAIN APP models.py from django.db import models class Zona(models.Model): codigo = models.CharField(max_length=120) area = models.CharField(max_length=120) especies = models.ManyToManyField("Especie", blank=True) def __str__(self): return self.codigo class Especie(models.Model): nome = models.CharField(max_length=120) nome_latino = models.CharField(max_length=120) data_insercao = models.DateTimeField(auto_now_add=True) actualizacao = models.DateTimeField(auto_now=True) zonas = models.ManyToManyField("Zona",blank=True ) … -
Using comma-formatted numbers for DecimalField in Wagtail page admin
I have a request from a client to have page admin fields that they can add/read numbers into with commas such as 1,000,000. The Django model field to store the value would be a django.db.models.fields.DecimalField instance. From looking at the Django docs, this is something that’s supported by the django.forms.fields.DecimalField localized property, but I can’t find a way of enforcing it in the Wagtail admin, even when subclassing the Wagtail BaseFieldPanel __init__ function with self.bound_field.field.localize = True. -
Django - code won't enter 'process_request' in custom middleware
I'm using this example to create custom middleware, though I changed it a little bit. When debugging I see that the code enters that class, and get to the function definition, but it doesn't enter inside the function. I'm using django 1.10. This is my middleware class class GlobalThreadVarMiddleware(object): _threadmap = {} @classmethod def get_current_data_manager(cls): return cls._threadmap[_thread.get_ident()]['data_manager'] def process_request(self, request): self._threadmap[_thread.get_ident()] = {} self._threadmap[_thread.get_ident()]['data_manager'] = DataManager() def process_exception(self, request, exception): try: del self._threadmap[_thread.get_ident()] except KeyError: pass def process_response(self, request, response): try: del self._threadmap[_thread.get_ident()]['data_manager'] except KeyError: pass return response -
How do you display divs only on certain pages in Django?
I have a header that's being used as the base of all 3 of my pages, and loaded in like this; {% extends "base.html" %} {% load static %} {% block container %} ... {% endblock %} However, I only want to display certain menu options on one of the pages. Those are contained in a div, so my header looks somewhat like this: <header> <navbar> navbar items </navbar> <div> additional menu options </div> </header> Basically, I want the header/navbar to be displayed on every page, whereas I want the additional options div to appear on just one. Is there a way to make a conditional statement that tests what page I'm on, and only inserts the extra options if it's the right page? -
Getting 404 not found in application urls Django
I was just checking out django, and was trying a view to list the books by passing id as an argument to the URL books/urls.py. But getting 404 page not found error. I'm not getting whats wrong in the url when I typed this url in the browser: http://192.168.0.106:8000/books/list/21/ bookstore/urls.py urlpatterns = [ path('admin/', admin.site.urls), path('books/', include("books.urls")) ] settings.py INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'books' ] ... ... ... ROOT_URLCONF = 'bookstore.urls' books/urls.py urlpatterns = [ path('home/', create), path('list/(?P<id>\d+)', list_view), ] books/views.py def create(request): form = CreateForm(request.POST or None, request.FILES or None) if form.is_valid(): instance = form.save(commit=False) instance.save() messages.success(request, "Book Created") return redirect('/books/list', kwargs={id:instance.id}) return render(request, "home.html", {"form":form}) def list_view(request, id=None): books = Book.objects.filter(id=id) return render(request, "list.html", {"books": books}) Project Structure: ├── books │ ├── admin.py │ ├── forms.py │ ├── __init__.py │ ├── models.py │ ├── urls.py │ └── views.py ├── bookstore │ ├── __init__.py │ ├── settings.py │ ├── urls.py Here is the screenshot - EDIT - As addressed in the comments - Tried by appending \ in the books.urls but no luck :( -
twilio Record entire incoming call with gather
I am conducting a survey using Voice with Twilio. Part of that survey is to let the user give a voice feedback so i used Record at first. That was exactly what i needed since i could get the mp3 + the transcription. Problem is : i can't set the language to French so my transcription come in french, instead it is recorded and transcribed as english even though i speak french. So i decided to switch and use the Gather with the speech option which works quite well, the text comes back in french, but using that option, i can't get the mp3. So i decided that i would record the entire call, and use Gather which would have solved my problem, except you only get to set the record parameter to true when you initiate the call (outgoing call). My survey will be taken by incoming call 95% of the time.. I there any way to achieve this without having to use Record and use another API to do the transcription ?