Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django, get sum of amount for the last day?
class Point(models.Model): user = models.ForeignKey(User) expire_date = models.DateField() amount = models.IntegerField() I want to know sum of amount for the last expire_date for a given user There could be multiple points for a user and with same expire_date I could do two query to get first last expire_date and aggregate on those. but wanna know if there's better way. -
I have errors with Django is.authenticated() built in function, showing "inconsistent use of tabs and spaces in indentation"
I have been woking in django 2.2.4 in vscode. Whenever I try to run the code, error in powershell says that, "inconsistent use of tabs and spaces in indentation"(into the is_authenticated() line. I have this code: def login_page(request): form = LoginForm(request.POST or None) print(request.user.is_authenticated) if form.is_valid(): print(form.cleaned_data) return render(request, "auth/login.html", {}) For LoginForm() is imported by my file forms.py from django import forms class ContactForm(forms.Form): fullname = forms.CharField( widget=forms.TextInput( attrs={ "class": "form-control", "placeholder": "Your Full Name" } ) ) email = forms.EmailField( widget=forms.EmailInput( attrs={ 'class': 'form-control', "placeholder": "Your email" } ) ) content = forms.CharField( widget=forms.Textarea( attrs={ 'class': 'form-control', "placeholder": "Your message" } ) ) def clean_email(self): email = self.cleaned_data.get("email") if not "gmail.com" in email: raise forms.ValidationError("email has to be gmail.com") return email class LoginForm(forms.Form): username = forms.CharField() password = forms.CharField() -
The session variable is lost, in Django
In a system that should be multi-company, I use context_processors.py to load company options, by selecting from the sidebar. The user can change companies at any time. When the user selects a company, the option is recorded in a session variable. It happens that when the user changes pages, the information of the session variable is lost. What am I doing wrong or failing to do? Is there a better way to do this? Relevant code snippets follow: context_processors.py from apps.client.models import Client def units (request): # Dictionary with business options clients = Client.objects.values ( "client_id", "company_id__name", ) clients_list = [] for client in clients: clients_list.append ( { 'client_id': client ['client_id'], 'name': client ['company_id__name'] } ) return {'clients_list': clients_list} base.html # System base page. # Displays the list of business options. <select class = "form-control select2"> <option value = "{{request.session.unit_id}}"> {{request.session.unit_id}} </option> {% for client in clients_list%} <option value = "{{client.client_id}}" {% if request.session.unit_id == client.client_id%} selected {% endif%}> {{client.client_id}} </option> {% endfor%} </select> ... # Whenever a company is selected ... <script> $ ("# select_unit"). click (function () { var option_id = $ (this) .val (); var url = "{% url 'home: set_unit'%}"; $ .ajax ({ type: "GET", url: … -
How to pass data in a GET request in django-rest-framework?
I need to send data in a GET request. I don't like passing the parameters in the URL, so this way I need to modify the URL every time I want to insert a new parameter I need in the view. To do this I send an object with the parameters. This is my URL: path(r'acounts_api/', views.AcountsAPI.as_view(), name='accounts_api') This is my view: class AccountsAPI(APIView): def get(self, request): id_account = request.GET.get('id_account', None) if (id_account): try: account = Accounts.objects.get(id=id_account) account_serializer = AccountsSerializer(account) except Accounts.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) else: account = Accounts.objects.all() account_serializer = AccountsSerializer(account, many=True) return Response(account_serializer.data, status=200) And this is my javascript: function get_conta_receita(id_to_get) { var myData = { "id_account": id_to_get, }; const defaults = { 'method': 'GET', 'credentials': 'include', 'headers': new Headers({ 'X-CSRFToken': csrf_token, 'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest' }), }; merged = {defaults, myData}; fetch(accounts_api, merged) .then(function(response) { return response; }).then(function(data) { console.log("Data is ok", data); }).catch(function(ex) { console.log("parsing failed", ex); }); }; With jquery ajax this worked: $.ajax({ type: "get", headers: { "X-CSRFToken": csrf_token, }, data: { "id_account": id_to_get, }, url: acounts_api, dataType: 'json', success: function (dados) { return dados; } }) How can I use the same process with the fetch method? -
Profile data are not saved for custom user model
I'm new to python and I'm trying to make user registration that is extend from user creation model, I created profile model with the fields I want and saved the profile object with signal when user is saved, the profile is created successfully and linked with the user but profile data is not saved (in this example: jobtitle, company, phone)are empty in model.py class profile (models.Model): user = models.OneToOneField(User, on_delete = models.CASCADE) company = models.CharField(max_length=100) jobTitle = models.CharField(max_length = 100,default ='') phonenumber = PhoneNumberField(null=False, blank=False, unique=True, help_text='Contact phone number', default ='') @receiver(post_save, sender = User) def create_user_profile( sender, instance, created, **kwargs): if created: profile.objects.create(user = instance) instance.profile.save() @receiver(post_save, sender=User) def save_profile(sender, instance, **kwargs): instance.profile.save() in forms.py class UserRegisterForm(UserCreationForm): email = forms.EmailField(required= True) company = forms.CharField(required = True) phonenumber = PhoneNumberField(widget=forms.TextInput(attrs={'placeholder': ('Phone')}), label=("Phone number"), required=True) first_name = forms.CharField(required = True) jobTitle = forms.CharField(required = True) class Meta: model = User fields = [ 'username', 'first_name', 'last_name', 'email', 'password1', 'password2', 'company', 'jobTitle' ] def save(self, commit=True): user = super(UserRegisterForm, self).save(commit=False) user.first_name = self.cleaned_data['first_name'] user.last_name = self.cleaned_data['last_name'] user.email = self.cleaned_data['email'] if commit: user.save() return user in views.py #User register def signup(request): if request.method == 'POST': form = UserRegisterForm(request.POST) if form.is_valid(): user = form.save() … -
Processing a file while its being uploaded in django
My Application requires client to upload a Huge file through a Form . Currently , django stores the file in temp folder and my view function gets hit only after the whole file is uploaded where i can access the file. My requirement is to be able to get uploaded chunks as soon as they arrive at the server so that i can start the processing . I checked , there is streaming HTTP response but nothing for HTTP request (POST from client) Thanks -
Render a form that shows list values as the checkbox values. [each entry in the list represent a checkbox field]
Is it possible to render a form from a list data? For example let Cont = ['Brazil' ,'India', 'USA', 'Aus', 'UAE', 'Russia', 'China'] I want to present a form to user that shows the entries in the form as checkbox which I can save into a result list called Result= []. How is it possible? -
Django ORM group by a custom Func
I'm working with Django and I need to group a model by a custom function. Okay so the query I want is: SELECT date_trunc('week',"model_table"."date") AS "date" FROM "model_table" GROUP BY "date" Then what I've tried is the following: class DateTrunc(Aggregate): function = 'date_trunc' template = "%(function)s('%(date_type)s',%(expressions)s)" date_types = ['microsecond', 'millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year', 'decade', 'century', 'millenium'] def __init__(self, date_type, expression, group_by=False, **extra): self.must_group_by = group_by # Name "group_by" is already used. if date_type not in self.date_types: raise AttributeError('The specified "date_type" is not correct.') super().__init__(expression, date_type=date_type, **extra) def get_group_by_cols(self): if self.must_group_by: return [self] return super().get_group_by_cols() In [3]: HotelRating.objects.annotate(date=DateTrunc('week','crawled_at',True)).values('date').query.__str__() Out[3]: 'SELECT date_trunc(\'week\',"metrics_hotelrating"."crawled_at") AS "date" FROM "metrics_hotelrating" GROUP BY "metrics_hotelrating"."id", date_trunc(\'week\',"metrics_hotelrating"."crawled_at")' Which works find except for the fact that the GROUP BY clause also inserts the table unique id. This implies the final result is not grouped at all. I've been checking the Django code and in the Query class there's a function set_group_by that is the one that mess it all but i don't really know how to hack it. Anyway I think the correct way to proceed would be to inherit from Func class instead of Aggregate but then I can't get Djangot to insert the … -
how to automate connecting to SSH using python in ubuntu?
What I normally do is that I open a terminal in ubuntu and type this: ssh -p 2200 mydomain@ssd4.rackset.com then I enter the password I then activate my virtual environment: source /home/myproject/virtualenv/myproject/3.5/bin/activate then I change the working directory: cd myproject I then go to django shell and do some stuff python manage.py shell I then exit from django shell exit() and exit from ssh exit What I want to do is automate all of these. How can I do all these using Python? I see that there some libraries to connect to ssh but I did not see entering password in non of them -
How to put the problem of html code in database
I was trying to include a hyperlink between the text which loads dynamically from database, similar to the one in wikipedia. The text somehow looks like this - "Some Text some text <a href="#">Hyperlink</a>Remaining text" But is doesn't gives me a hyperlink, instead it shows the same text as i have written in the database. When i checked the source code it look like this: "Some Text &lt;a href="#"&gt;Hyperlink&lt;/a&gt; Remaining Text" I expect the ouput as as - "Some Text Hyperlink Remaining Text" Please help me to solve the problem. -
How to keep urlpatterns neat
Django==2.2.3 I have a rather big list in urlpatterns. I use namespaces, but urlpatterns are all the same big. Example: urlpatterns = [ path('semantics', SemanticsList.as_view(), name="semantics"), path('common_negative_phrases', CommonNegativePhrasesList.as_view(), name="common_negative_phrases"), path('semantics_level3_minus_phrases/<int:level>/', SemanticsLevel3MinusPhrasesList.as_view(), name="semantics_level3_minus_phrases"), path('semantics_level2_minus_phrases/<int:level>/', SemanticsLevel2MinusPhrasesList.as_view(), name="semantics_level2_minus_phrases"), path('comparative_phrases_list', ComparativePhrasesList.as_view(), name="comparative_phrases_list"), path('transactional_phrases_list', TransactionalPhrasesList.as_view(), name="transactional_phrases_list"), path('info_phrases_list', InfoPhrasesList.as_view(), name="info_phrases_list"), ] I'd like to keep them more neat. Maybe sort them alphabetically. Any other ideas? As for alphabetic sorting. I wouldn't like to sort them by myself. Maybe there is an online service or something for this purpose? -
Is there any solution on using id as url in django?
I was doing some blog related site and wished for a blog to appear when its id is provided in the URL. Overall the code seems fine but it keeps on saying page not found. Can anyone help me with the problem? I tried searching in the internet but couldn't get any specific solution. It works when id is not given but says page not found when id is given. url script for blog: urlpatterns = [ path('', views.allblogs, name ='allblogs'), path('<int:blog_id>/',views.details, name='detail') ] views script for blog: def details(request,blog_id): detailblog = get_object_or_404(Blog, pk = blog_id) return render(request, 'blog/details.html', {'blog': detailblog}) -
Django Template: Use translation in default_if_none
How can I use a translated string inside a template for default_if_none? Usually you would use something like this: {% trans 'TRANSLATED STRING' %} Example {{ value|default_if_none:'TRANSLATED STRING' }} -
cannot link ondrop div element to ajax
I m working on a project to create drag and drop quiz using django framework , I m able to drag and drop but the ondrop div element is not responsive to ajax i tried using ajax and to link it up to django views and urls, but it doesnt work Drop Here function allowDrop(ev){ ev.preventDefault();} function drag(ev){ ev.dataTransfer.setData("text",ev.target.id);} function drop(id,ev){ev.preventDefault();var ans=ev.dataTransfer.getData("text");ev.target.appendChild(document.getElementById(ans));alert(ans);$.ajax({url:"{% url 'test_dd' %}",type:"POST",data:{ans:ans},success:function(){alert("ajax works");return true}});return false;} im unable to type the indentation for the code part as this site is not allowing me to do so.. so this is one more question. I worked for about oneday to ask this question in this site. https://imgur.com/LZU9YjZ alert is working for function but not in ajax -
JSON Response output is not updated on single click event
I am trying to build a java online compiler web app using django. but every time i submit my code through AJAX call the new code is posted successfully to view.py but the Jsenter code hereon response object is still the previous one. def code1(request): response_data={} **codet=request.POST.get("code","")** # getting the code text from Ajax req **output=code(codet)** #sending code for execution response_data['result']="Successful" #storing in response response_data['message']=output **return HttpResponse(json.dumps(response_data), content_type="application/json")** def code(code_text): return execute(code_text) def execute(code_text): filename_code=open('Main.java','w+') #creating file filename_code.flush() f1 = code_text.split("\n") # splitting code line by line for i in f1: filename_code.write(i+"\n") #writing code line by line filename_code.close() #closing file time.sleep(2) #giving wait **compile_java(filename_code)** #compiling file (Note: I am not using the file passed in compile_java) **return execute_java(filename_code,input**) #running java file def compile_java(java_file): proc = subprocess.Popen('javac Main.java', shell=True) def execute_java(java_file, stdin): #java_class,ext = os.path.splitext(java_file) cmd = ['java ', 'Main'] proc = subprocess.Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT) stdout,stderr = proc.communicate(stdin) stdoutstr= str(stdout,'utf-8') ** 1. return stdoutstr ** Actually the previous json response is being sent for current code(codet) -
How to implement class methods with attributes of another class?
I have three models, BoletoConfig(BilletConfig),Tickets and CategoryTicket, one ticket has a CategoryTicket and CategoryTicket has a BilletConfig, BilletConfig has an attribute with the days for the billet due, I want to create a method in the tickets class to calculate the due date. I have doubts if I use the decorator @property or @classmethod, which would be the best choice and why? and how would i get the value of days_to_become_due from my BoletoConfig class in tickets? This my /billets/models.BoletoConfig class BoletoConfig(models.Model): base_amount = models.DecimalField( db_column='valor_base', max_digits=10, decimal_places=2, verbose_name='valor base do boleto', ) check_specialization_for_amount = models.BooleanField( default=False, db_column='especializacao_protocolo', verbose_name='especialização do protocolo', ) days_to_become_due = models.IntegerField( db_column='dias_vencimento', verbose_name='dias até vencimento', ) class Meta: db_table = 'boletos_boleto_configuracao' verbose_name = 'boletos_configuração' def __str__(self): return self.base_amount This my /tickets/models.tickets class Ticket(TimestampedModel, permissions.TicketPermission): """A ticket requested by someone to address a situation""" requested_by = models.ForeignKey( settings.AUTH_USER_MODEL, models.PROTECT, db_column='requerido_por', related_name='+', ) show_ticket_for_request_user = models.BooleanField( default=True, db_column='mostrar_ticket_para_requerente', ) message = models.CharField( max_length=4000, blank=True, null=True, db_column='mensagem', ) status = models.ForeignKey( Status, models.PROTECT, ) category = models.ForeignKey( Category, models.PROTECT, ) files = models.CharField(max_length=4000, blank=True, null=True) boleto_id = models.UUIDField( db_column='boleto_id', verbose_name='Uuid Boleto', null=True, blank=True, ) @property def get_boleto_duo_date(self): return self.ticket.created_at + timedelta(days=days_to_become_due) This my /tickets/models.CategoryTicket class Category(TimestampedModel): """ Represents what … -
Using docker for Celery Task +Rabbitmq not working on python 3.7
I am using Docker to setup periodic task with Celery+RabbitMQ in DJANGO Project. Using new versions of packages: Python: 3.7 Celery: 4.4.0rc1 Django: 2.2.5 Getting below error: Traceback (most recent call last): worker_1 | File "/usr/local/lib/python3.7/site-packages/celery/app/utils.py", line 241, in find_app worker_1 | found = sym.app worker_1 | AttributeError: module 'modulename' has no attribute 'app' worker_1 | worker_1 | During handling of the above exception, another exception occurred: worker_1 | worker_1 | Traceback (most recent call last): worker_1 | File "/usr/local/bin/celery", line 10, in <module> worker_1 | sys.exit(main()) worker_1 | File "/usr/local/lib/python3.7/site-packages/celery/__main__.py", line 30, in main worker_1 | main() worker_1 | File "/usr/local/lib/python3.7/site-packages/celery/bin/celery.py", line 81, in main worker_1 | cmd.execute_from_commandline(argv) worker_1 | File "/usr/local/lib/python3.7/site-packages/celery/bin/celery.py", line 793, in execute_from_commandline worker_1 | super(CeleryCommand, self).execute_from_commandline(argv))) worker_1 | File "/usr/local/lib/python3.7/site-packages/celery/bin/base.py", line 309, in execute_from_commandline worker_1 | argv = self.setup_app_from_commandline(argv) worker_1 | File "/usr/local/lib/python3.7/site-packages/celery/bin/base.py", line 469, in setup_app_from_commandline worker_1 | self.app = self.find_app(app) worker_1 | File "/usr/local/lib/python3.7/site-packages/celery/bin/base.py", line 489, in find_app worker_1 | return find_app(app, symbol_by_name=self.symbol_by_name) worker_1 | File "/usr/local/lib/python3.7/site-packages/celery/app/utils.py", line 246, in find_app worker_1 | found = sym.celery worker_1 | AttributeError: module 'modulename' has no attribute 'celery' I am stuck how to use Celery, celery-beat, RabbitMQ, Docker along with Django Project for my asynchronous task … -
django.db.utils.IntegrityError: duplicate key value violates unique constraint "core_user_pkey" DETAIL: Key (id)=(23) already exists
i'm working on project using python 3.7 , django 2.2.4 , docker and postgresql and when i want to create super user i get this error i do it for 23 times(that's why the id equal to 23). here is my model : class UserManager(BaseUserManager): def create_user(self, email, username, name, password=None): """ create and save new user""" if not email: raise ValueError('User must have an email address') user = self.model(email=self.normalize_email(email), name=name, username=username) user.set_password(password) user.save(using=self._db) return user def create_superuser(self, email, username, name, password): """create and save new super user""" user = self.create_user(email, username, name, password) user.is_staff = True user.is_superuser = True user.save(self._db) return user class User(AbstractBaseUser, PermissionsMixin): """custom user model that using username in username field""" email = models.EmailField(max_length=70, unique=True) username = models.CharField(max_length=50, unique=True) name = models.CharField(max_length=50) gender = models.PositiveIntegerField(validators= [MaxValueValidator(3)], null=True) # 1 for men 2 for woman 0 for not mention bio = models.TextField(null=True) lives_in = models.CharField(max_length=70, null=True) phone_number = models.PositiveIntegerField(validators= [MaxValueValidator(99999999999)], null=True) is_active = models.BooleanField(default=True) is_staff = models.BooleanField(default=False) objects = UserManager() USERNAME_FIELD = 'username' REQUIRED_FIELDS = ['email', 'name'] here is my migration code: class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0011_update_proxy_permissions'), ] operations = [ migrations.CreateModel( name='User', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('password', models.CharField(max_length=128, verbose_name='password')), … -
ERR_ABORTED 404 - Django - Static Files
I get the following error in my web site: https://www.mywebsite.com/project/static/js/stylish-portfolio.min.js net::ERR_ABORTED 404 I don't understand why, because all my static files are in chmod 775. May be it's due to my setting file, but i don't see the issue. :/ My setting file: BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) GPAAS_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), ) STATIC_URL = '/project/static/' STATIC_ROOT = os.path.join(GPAAS_DIR, 'static') MEDIA_ROOT = os.path.join(GPAAS_DIR, 'media') MEDIA_URL = '/project/media/' I use: Apache 2.4.35 Python 3.6.5 Django 2.2.4 Has anyone ever had this issue, or may be some advice to solve this problem? Could you help me please? -
django template url issue
I have set up dynamic linking from a ListView which worked fine, but now that I am filtering the ListView any links from the template are appending the current url. Here is my urls.py: urlpatterns = [ path('list/<area>/', ProjectListView.as_view(), name='project-list'), path('project-create/', ProjectCreateView.as_view(), name='project-create'), path('<slug:slug>/update/', project_update_view, name='project-update'), path('search/', search, name='search'), ] in the template my link looks like this: <h3><a href="{{ project.slug }}/update">{{ project.title }}</a></h3> and I was hoping it would look here: http://127.0.0.1:8000/si/ but instead it is looking here: http://127.0.0.1:8000/si/list/All/ of which "list" was added to prevent other urls matching wrongly, which I can just add if necessary, and "All" which comes from a dynamic variable from the filter and will be one of 8 different strings. How can I get this url to look at where I specified in the urls.py and not just append the current url? -
Get data from one model to another in form of check buttons and then save the checked buttons in different model
I am working on a problem that requires to add choices. User will enter the things they Like one by one. I'll use formset for that. My Like model is like this class Likee(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) ans = models.CharField(max_length=1024) Let's suppose User has entered 10 things here. What I want to do is to present a form that has Checkbuttons against the entries provided by user. These will define all the things that the user Need. I want user to select/descelect from all the entries and once he presses Next button, I want to save all the in the DB in a Need model. How can this be achieved? What will the Need model,form,view be like? I am out of ideas here. -
Django form template doesn't show form-field
My form: <form id="myform2" method="get" > {{ filter.form}} </form> I need to custom django-filter form template like this: <form id="myform2" method="get" > <div class='myClass'> <label>Label: </label> {{ filter.age_filter}} </div> </form> But html page doesn't show {{ filter.age_filter}} and I don't understand why. Can somebody help me please? My filter.py: class EventFilter(django_filters.FilterSet): AGE_CHOICES = ( ('18+', '18+'), ('19+', '19+'), ('21+', '21+'), ) age_filter = django_filters.ChoiceFilter(label='🔞', choices=AGE_CHOICES, method='filter_by_age') class Meta: model = Event fields = [] def filter_by_age(self, queryset, name, value): return queryset.filter(age_limit=value) -
Cannot convert Django Queryset to a List [duplicate]
This question already has an answer here: Django values_list vs values 3 answers at first I want to mention that I have already searched in stackoverflow for an answer. However the answers I found did not solve my problem (and one answer was too complicated to understand and therefore did't work). My problem is: I created the following query: my_books = Book.objects.values('title') print(my_books) The output is: <QuerySet [{'title': 'It do go down'}, {'title': 'Second Post'}, {'title': 'Tesla - A New Generation'}]> Now I want to change the QuerySet to give me back a list which should look like this: ['It do go down', 'Second Post', 'Tesla - A New Generation'] What do I have to do in order to get the result above? Best regards Lambrini PS: What I tried was an answer to a related question: print(list(my_books)) which showed the following: [{'title': 'It do go down'}, {'title': 'Second Post'}, {'title': 'Tesla - A New Generation'}] Furthermore I tried an iteration, which didn't work at all. -
Role Based Access Control for different API methods in Django REST Framework
I am creating REST API for Product, which has following Permission, (create_product, view_product, edit_product). In my Project I am having various users with different roles (Ex: Producer, Retailer, Consumer,...etc). I am assigning permission to individual Roles. Example: The "Producer" role has "create_product" and "view_product" permission. The "Retailer" role has "edit_product" permission. The "Consumer" role has no permission. I want to restrict the Access based on the permission code. I need a generic approach to solve this. I want to use the same approach for different views with different permission codes. In my view.py, class Product(viewsets.ModelViewSet): serializer_class = ProductSerializer queryset = Product.objects.all() In settings.py, I have added following code. REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ), 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', 'rest_framework.authentication.BasicAuthentication', 'rest_framework.authentication.SessionAuthentication', ), } Thanks in advance. -
How to run waitress on Django app deployed on Heroku with specified port on windows
I am trying to host my django app using heroku and waitress package in windows environment. I have defined the procfile for running wsgi application . Where do we need to define the correct port and run the heroku app? This is for a new windows server running django app and heroku. In the past, I have tried on defining various port numbers on procfile to run the app,but it not worked and shows error on permission. Procfile: web: waitress-serve --port=80 ACE:wsgi.application I expect the django app to run on heroku inn browser, using command -heroku local web The output which I got is: [OKAY] Loaded ENV .env File as KEY=VALUE Format 16:15:41 web.1 | Traceback (most recent call last): 16:15:41 web.1 | File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main 16:15:41 web.1 | "main", mod_spec) 16:15:41 web.1 | File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in _run_code 16:15:41 web.1 | exec(code, run_globals) 16:15:41 web.1 | File "C:\Users\ramakrishnan_k\AppData\Local\Programs\Python\Python36-32\Scripts\waitress-serve.exe__main__.py", line 9, in 16:15:41 web.1 | File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\site-packages\waitress\runner.py", line 279, in run 16:15:41 web.1 | _serve(app, **kw) 16:15:41 web.1 | File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\site-packages\waitress__init__.py", line 11, in serve 16:15:41 web.1 | server = _server(app, **kw) 16:15:41 web.1 | File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\site-packages\waitress\server.py", line 85, in create_server 16:15:41 web.1 | sockinfo=sockinfo) 16:15:41 …