Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
django cache manager method (with arguments)
So I have a few models and a manager like this. class Member(BaseModel): objects = models.Manager() permissions = api_managers.PermissionManager() box = models.ForeignKey('api_backend.Box', on_delete=models.CASCADE) roles = models.ManyToManyField('api_backend.Role', through='api_backend.MemberRole') REQUIRED_FIELDS = [box, user] class Role(BaseModel): objects = models.Manager() positions = api_managers.PositionalManager() name = models.CharField(default='new role', max_length=100, validators=[MinLengthValidator(2)]) permissions = BitField(flags=permission_flags, default=default_perm_flags, db_index=True) is_default = models.BooleanField(default=False, db_index=True) position = models.PositiveSmallIntegerField(db_index=True, default=0) box = models.ForeignKey('api_backend.Box', on_delete=models.CASCADE) REQUIRED_FIELDS = [name, box] class MemberRole(BaseModel): objects = models.Manager() member = models.ForeignKey('api_backend.Member', on_delete=models.CASCADE) role = models.ForeignKey('api_backend.Role', on_delete=models.CASCADE) REQUIRED_FIELDS = [member, role] class Overwrite(BaseModel): objects = models.Manager() allow = BitField(flags=permission_flags, null=True, blank=True, db_index=True) deny = BitField(flags=permission_flags, null=True, blank=True, db_index=True) channel = models.ForeignKey('api_backend.Channel', on_delete=models.CASCADE, editable=False) box = models.ForeignKey('api_backend.Box', on_delete=models.CASCADE, editable=False) role = models.OneToOneField('api_backend.Role', on_delete=models.CASCADE, db_index=True) REQUIRED_FIELDS = [role, channel, box] from memoize import memoize class PermissionManager(models.Manager): def __init__(self): super().__init__() @transaction.atomic @memoize(timeout=3600) def get_overwrites(self, channel): assert channel.box == self.model.box, 'invalid channel given' permissions = self.get_base_permissions if channel.box.owner == self.model.user: return permissions try: # get the default everyone role's overwrite default_role = self.model.box.roles.get(is_default=True) default_overwrite = default_role.overwrite_set.get(channel=channel) except ObjectDoesNotExist: pass else: permissions &= set(~default_overwrite.deny) permissions |= set(default_overwrite.allow) member_role_ids = [role.id for role in self.model.roles.all()] overwrite_roles = channel.overwrites.filter(role__id__in=member_role_ids) deny, allow = None, None for overwrite in overwrite_roles: deny |= set(overwrite.deny) allow |= set(overwrite.allow) permissions … -
TemplateSyntaxError at / Invalid block tag on line 57: 'logout_url', expected 'endif'. Did you forget to register or load this tag?
I am building an app in Django. I dont' understand why I am getting TemplateSyntaxError at /login/ Invalid block tag on line 57: 'logout_url', expected 'endif'. Did you forget to register or load this tag? highlighting this line: <a class="nav-link" href="{% logout_url %}">Logout</a> Here is my code, In my urls.py: urlpatterns = [ path("logout/", LogoutView.as_view(), name="logout"), ] In my template: {% url 'logout' as logout_url %} {% if not request.user.is_authenticated %} <li class="nav-item {% if request.path == login_url %}active{% endif %}"> <a class="nav-link" href="{% url 'login' %}">Login</a> </li> <li class="nav-item {% if request.path == register_url %}active{% endif %}"> <a class="nav-link" href="{% url 'register' %}">Register</a> </li> {% else %} <li class="nav-item {% if request.path == admin_url %}active{% endif %}"> <a class="nav-link" href="{% url 'admin:index' %}">Admin</a> </li> <li class="nav-item {% if request.path == logout_url %}active{% endif %}"></li> <a class="nav-link" href="{% logout_url %}">Logout</a> <!-- logout_url --> </li> {% endif %} It works fine if I just substitute the part: <li class="nav-item {% if request.path == logout_url %}active{% endif %}"></li> <a class="nav-link" href="{% logout_url %}">Logout</a> </li> with: <li class="nav-item {% if request.path == logout_url %}active{% endif %}"></li> <a class="nav-link" href="{% url 'logout' %}">Logout</a> </li> But I don't understand why... It's like line {% url … -
How to set placeholders in django filters for fields in meta
How to set placeholders in django filters for fields in meta. Because for the field 'type, I already have predefined specific values for them to filter, so I cant use CharFilters etc like what I did for my end_date. Any idea? class TypeFilter(django_filters.FilterSet): end_date = DateFilter(field_name="date_published", lookup_expr='lte', widget=TextInput(attrs={'placeholder': 'MM/DD/YYYY'})) class Meta: model = Blog fields = ['type'] widgets = { 'type' : forms.TextInput(attrs={'placeholder': 'choose type'}), } -
Django jsonresponse for updating table makes the screen go black like opening a modal; can not close it
So if I update a author I want to update the candidates table with only the updated author and its new information. The problem is if I do that that the whole screen turns black like opening a modal. And the table is not updated but empty. If I do not do a call to process_author to update the table after update modal has been filled in there will not be a dark screen. Below is the code: <div id="authors-candidates-div"> <table id="authors-table" class="table"> <thead> <tr> <th class="text-center" scope="col">ID</th> <th class="text-center" scope="col">Name</th> <th class="text-center" scope="col">Name original language</th> <th class="text-center" scope="col">Extra info</th> <th class="text-center" scope="col">Update/ Link</th> </tr> </thead> <tbody> {% for author in authors.all %} <tr> <th class="text-center" scope="row">{{ author.pk }}</th> <td class="text-center">{{ author.name }}</td> <td class="text-center">{{ author.name_original_language }}</td> <td class="text-center">{{ author.extra_info }}</td> <td class="text-center"> <!-- Update author buttons --> <button type="button" id='init-btn{{ author.pk }}' class="btn btn-primary btn-danger" data-toggle="modal" data-target="#UpdateAuthorModal{{ author.pk }}"> <span class="fa fa-pencil"></span> </button> <!-- Modal --> <div id="UpdateAuthorModal{{ author.pk }}" class="modal fade" tabindex="-1"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title col-md-10">Update Author</h5> <button type="button" class="close" data-dismiss="modal">&times;</button> </div> <div class="modal-body"> <div class="form-group"> <label for="id_name_t">Name</label> <input type="text" name="name" maxlength="100" value="{{ author.name }}" class="form-control name" id="id_name{{ author.pk }}"> … -
How to simulate a User logging in with Selenium and Djangos LiveServerTestCase?
Currently working on an old Django project I want to finish and trying to write some tests using selenium for it. At this moment I and trying to test a user getting to the login screen and after typing the info in, they get redirected to the home page. The issue I am having though is this is having a user in the database. Since I didn't want the test info in the actual database, I wanted to use LiveServerTestCase. I created the User using the create_user() function in the setUp() part of the test. However when I ran the test, the user wasn't authenticated. After putting some print() statements in my test and view functions I found that I could see the user in the FT but then when it swapped to the view in the same test there were no User objects in the database. Below is more of my code from the tests/views. class TestNewUser(LiveServerTestCase): def setUp(self): self.browser = webdriver.Firefox() self.username = 'testuser' self.password = 'P@ssword9182' User.objects.create_user(username=self.username, password=self.password) print(User.objects.all()) Here's code from the FT They see a login screen with a username and a password input box login = self.browser.find_element_by_class_name('username') password = self.browser.find_element_by_class_name('password') button = self.browser.find_element_by_class_name('login_button') They … -
Mac: Running setup.py install for mysqlclient ... error
I am switching to mac from linux. In linux, i used to install mysqlclient in project enviroment and also globally when the app gave me error like "mysqlclient improperly configured". But in mac I couldn't seem to find a way. Here is the traceback below when I am trying to install mysqlclient in project enviroment. Collecting mysqlclient Using cached mysqlclient-2.0.3.tar.gz (88 kB) Using legacy 'setup.py install' for mysqlclient, since package 'wheel' is not installed. Installing collected packages: mysqlclient Running setup.py install for mysqlclient ... error ERROR: Command errored out with exit status 1: command: /Users/macbookpro/kalke-services/services/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_k/74wl7dz56txbh904slsgt2180000gn/T/pip-install-1y50fx7i/mysqlclient_f48588e55e2a4270a35a2d3c79c1d000/setup.py'"'"'; __file__='"'"'/private/var/folders/_k/74wl7dz56txbh904slsgt2180000gn/T/pip-install-1y50fx7i/mysqlclient_f48588e55e2a4270a35a2d3c79c1d000/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/_k/74wl7dz56txbh904slsgt2180000gn/T/pip-record-fgig7hxx/install-record.txt --single-version-externally-managed --compile --install-headers /Users/macbookpro/kalke-services/services/venv/include/site/python3.8/mysqlclient cwd: /private/var/folders/_k/74wl7dz56txbh904slsgt2180000gn/T/pip-install-1y50fx7i/mysqlclient_f48588e55e2a4270a35a2d3c79c1d000/ Complete output (132 lines): mysql_config --version ['8.0.23'] mysql_config --libs ['-L/usr/local/opt/mysql-client/lib', '-lmysqlclient', '-lssl', '-lcrypto', '-lresolv'] mysql_config --cflags ['-I/usr/local/opt/mysql-client/include/mysql'] ext_options: library_dirs: ['/usr/local/opt/mysql-client/lib'] libraries: ['mysqlclient', 'resolv'] extra_compile_args: ['-std=c99'] extra_link_args: [] include_dirs: ['/usr/local/opt/mysql-client/include/mysql'] extra_objects: [] define_macros: [('version_info', "(2,0,3,'final',0)"), ('__version__', '2.0.3')] running install running build running build_py creating build creating build/lib.macosx-10.14.6-x86_64-3.8 creating build/lib.macosx-10.14.6-x86_64-3.8/MySQLdb copying MySQLdb/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/MySQLdb copying MySQLdb/_exceptions.py -> build/lib.macosx-10.14.6-x86_64-3.8/MySQLdb copying MySQLdb/connections.py -> build/lib.macosx-10.14.6-x86_64-3.8/MySQLdb copying MySQLdb/converters.py -> build/lib.macosx-10.14.6-x86_64-3.8/MySQLdb copying MySQLdb/cursors.py -> build/lib.macosx-10.14.6-x86_64-3.8/MySQLdb copying MySQLdb/release.py -> build/lib.macosx-10.14.6-x86_64-3.8/MySQLdb copying MySQLdb/times.py -> build/lib.macosx-10.14.6-x86_64-3.8/MySQLdb creating build/lib.macosx-10.14.6-x86_64-3.8/MySQLdb/constants copying MySQLdb/constants/__init__.py -> … -
Getting pandas data into charts JS on a django site
I have a Django project that uses Pandas to make some data. Stats = df['criteria 4'].value_counts() print(Stats) Result: Pass 7 Fail 2 Not attended 1 What i am trying to do is put together a chart using charts js. The problem is nothing gets loaded. I can't figure out how to properly put the values from "Stats" into charts JS. Below is an empty charts JS template i put together. Anyone able to figure out how to get the data to appear in the graph? I have this JS code directly in my HTML code. <script> var ctx = document.getElementById('myChart').getContext('2d'); var myChart = new Chart(ctx, { type: 'doughnut', data: { labels: [], datasets: [{ label: 'Breakdown', data: [ ], backgroundColor: [], borderWidth: 1 }] }, options: { title: { display: true, text: }, responsive: false, } }); </script> -
Where should I place my context for the forms_as.p to work properly
basically, i'm trying to form.as_p to list the values but its not working. Its not really that its not working, but it only works (it only appears in my template) after i press submit. I believe I have placed the context in the wrong place or the wrong indentation but im not sure where i should shift context['form'] = form to. I tried to shift it but it says that lcoal variable referenced before assignment. Could someone advise? def create_blog_view(request): context = {} user = request.user if request.method == 'POST': form = CreateBlogPostForm(request.POST or None, request.FILES or None) if form.is_valid(): obj= form.save(commit = False) author = Account.objects.filter(email=user.email).first() obj.author = author obj.save() return redirect('HomeFeed:main') else: context['form'] = form return render(request, "HomeFeed/create_blog.html", context) -
Django/Nginx- How to pass url into function
I'm currently facing an issue that really drives me mad. I want to generate a secure download link (nginx secure link module) without using Javascript at all. To accomplish this I need to pass the download url over to the nginx signing function that generates the secure link via a shared secred between nginx and django. Afterwards the signed link should get returned to the user by a redirect. The problem now is that I always run into the following issue: TypeError: cypher_link_data() got multiple values for argument 'url' html: <a href="{% url 'cypher_link_data' url=post.postattachment.url %}">Download</a> signing function: def cypher_link_data(url): print(url) # sadly not reaching this point, so I can't tell you whats inside. secret = SOME_SECRET_VALUE future = datetime.datetime.utcnow() + datetime.timedelta(seconds=1) expiry = calendar.timegm(future.timetuple()) secure_link = f"{secret}{url}{expiry}".encode('utf-8') hash = hashlib.md5(secure_link).digest() base64_hash = base64.urlsafe_b64encode(hash) str_hash = base64_hash.decode('utf-8').rstrip('=') cypher_link = (f"{url}?st={str_hash}&e={expiry}") return redirect(cypher_link) url.py path('download<path:url>', auth_required(cypher_link_data), name='cypher_link_data'), the value of path:url is: /Data/user_upload/eb3b3141-b6ac-46fe-b394-9873af8c7d5a.png as you might note the missing slash after "download". The issue has to be at url.py and the processing of the url that gets passed to the signing function. I already checked onto https://docs.djangoproject.com/en/3.1/topics/http/urls/#path-converters with no succsess. What do I miss here? Please also note: I first implemented … -
Why does heroku install sqlite even if I already have a postgres database?
I'm starting to deploying applications to heroku and I connected my Django app to the hobby Django Database that heroku gave me for free. My question is, why if I have my app connected to postgres, heroku continues installing Sqlite in deployment? -
How to control whether to get style from in Vue MPA with Django webpack loader?
I'm building an app that uses Django for the backend, and integrates with a vue frontend using Django webpack loader module. Essentially, the frontend is configured as a multipage application and the end result is I can load and use vue components directly inide of django templates. Since I'm starting to see the complexity of my app grow, I want to switch over from using local <style>s inside of each components to having all the style stored together with my global styles. I also want to be able to access my sass variables (which are defined in my global styles, in a subdirectory that django uses to pull static files) from those styles. Here's what the project tree looks like: (I have hidden all the stuff that isn't relevant) . ├── django_vue_mpa │ └── static ├── __init__.py ├── static │ ├── grid-layouts.css │ ├── grid-layouts.css.map │ ├── grid-layouts.scss │ ├── style.css │ ├── style.css.map │ └── style.scss └── vue_frontend ├── babel.config.js ├── node_modules ├── package.json ├── package-lock.json ├── Pipfile ├── public ├── README.md ├── src ├── vue.config.js ├── webpack-stats.json └── yarn.lock I don't have a ton of experience with Vue MPA's. Looking at my vue.config.js, it looks like django_vue_mpa is … -
how do I check if something has had a value set to it in Django REST framework?
I have made an app back end now here's how it works user clicks on a product and a charge is made BUT the status is waiting How do I check in the background if the payment is waiting or confirmed? Reason I am asking this is because when it is confirmed then the product price which buyer bought is appended to the seller's balance model field. So I need to continuously in the background check if status is waiting or confirmed thanks in advance -
404 error when running local host command: django, python
when running the local host command, I get a 404 error. I have defined the empty ' ' path but the only URL paths that work are the '/admin', /posts/', and '/posts/about'. urls.py from django.urls import path from . import views urlpatterns = [ path('', views.home, name='Posts-Home'), path('about/', views.about, name='Posts-About'), ] views.py from django.shortcuts import render from .models import verdict posts1 =[ { 'author' : 'Tom E', 'title' : 'review1', 'content' : 'verdict1', 'date_posted' : 'today', }, { 'author' : 'Adam K', 'title' : 'review2', 'content' : 'verdict2', 'date_posted' : 'yesterday' } ] # Create your views here. def home(request): #puts data into dictionary context ={ #postkey 'reference' : verdict.objects.all() } return render(request, 'posts/home.html', context) def about(request): return render(request, 'posts/about.html', {'title': 'about'}) -
How to not reset form values in django admin
I am using Django-admin for inserting data. But when I submit, the form resets values, so I need to insert some of the fields again. Is it possible not to reset some of the field values? -
ModuleNotFoundError: No module named 'bootstrap4.bootstrap'
i'm learning about django-plotly-dash and i want to use bootstrap but i get error after install and here's its error: from bootstrap4.bootstrap import css_url ModuleNotFoundError: No module named 'bootstrap4.bootstrap' -
form_valid causes TypeError: quote_from_bytes() expected bytes
I have based my formset on the CRUD methodology. Taken code from here and there. I can't understand the Error that it is producing: Internal Server Error: /create/(?P2[\w-]+)/$ Traceback (most recent call last): File "C:\Python39\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "C:\Python39\lib\site-packages\django\core\handlers\base.py", line 179, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Python39\lib\site-packages\django\views\generic\base.py", line 70, in view return self.dispatch(request, *args, **kwargs) File "C:\Python39\lib\site-packages\django\views\generic\base.py", line 98, in dispatch return handler(request, *args, **kwargs) File "C:\Python39\lib\site-packages\django\views\generic\edit.py", line 172, in post return super().post(request, *args, **kwargs) File "C:\Python39\lib\site-packages\django\views\generic\edit.py", line 142, in post return self.form_valid(form) File "C:\Projects\hosp_app\doc_aide\views.py", line 84, in form_valid return super().form_valid(form) File "C:\Python39\lib\site-packages\django\views\generic\edit.py", line 126, in form_valid return super().form_valid(form) File "C:\Python39\lib\site-packages\django\views\generic\edit.py", line 57, in form_valid return HttpResponseRedirect(self.get_success_url()) File "C:\Python39\lib\site-packages\django\http\response.py", line 465, in __init__ self['Location'] = iri_to_uri(redirect_to) File "C:\Python39\lib\site-packages\django\utils\encoding.py", line 147, in iri_to_uri return quote(iri, safe="/#%[]=:;$&()+,!?*@'~") File "C:\Python39\lib\urllib\parse.py", line 853, in quote return quote_from_bytes(string, safe) File "C:\Python39\lib\urllib\parse.py", line 878, in quote_from_bytes raise TypeError("quote_from_bytes() expected bytes") TypeError: quote_from_bytes() expected bytes The Formset class on which it is based is as follows: The form and view are as below: class PrescriptionCreate(generic.CreateView): model = Prescription template_name = 'doc_aide/write_prescription4.html' form_class = PrescriptionForm def get_context_data(self, **kwargs): print('here') context = super().get_context_data(**kwargs) if self.request.POST: context['line_prescription'] = SinglePrescriptionFormset(self.request.POST) else: context['line_prescription'] = … -
Djongo mapper issue with mongo_aggregate()
Facing issue with mongo_aggregate(). Error: AttributeError: 'super' object has no attribute 'getattr' Model.objects.mongo_aggregate(pipeline).using("mongodb") My model has objects = models.DjongoManager() requirements: Django==3.0.5 djangorestframework==3.12.2 djongo==1.3.3 pymongo==3.11.2 -
why 'Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named django' when im trying to install django?
so i was trying to install django. i use pip3 install django and this what happened[1] then i tried to look if my django was having no problem by typing import django on python. but this what happened to me[2] can anyone help me? thanks, it helps me a lot! [1]: https://i.stack.imgur.com/FXMnV.png [2]: https://i.stack.imgur.com/Zha8Q.png -
Django mange.py migrate --> No Migration folder and no tables created
I recently started to experiment with python and Django at the same time. After playing with several little projects from GitHub and or youtube and tried do it from scratch now on my own. My problem is, the command python manage.py migrate Only creates those 10 "standard" Django and "auth" tables in my local mysql db. Attached you can find my project structure. The way I started was with " django-admin startproject Nico". enter image description here Then step after step've created models, views, forms and templates. My best guess is, the migrate command does not find the models file. But I don't know where to specify that. At least that is a missing link. In my previous examples which were complete, I never had to declare that. Would that go in the right direction? views.py from django.views.generic.base import TemplateView from ReProg.ReProg.models import Kunde from ReProg.ReProg.forms import KundeForm class HP(TemplateView): Model = Kunde Form = KundeForm #template_name = "TestViewHello.html" #template_name = "KundenAufnahme.html" template_name = "KundenAufnahme2.html" forms.py from django import forms from django.http import HttpResponse, HttpResponseNotFound from django.shortcuts import render from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit class KundeForm(forms.Form): #KID = forms.CharField(attrs={'disabled': True}) KID = forms.CharField() first_name = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'ReProg'})) … -
how to implement ci/cd for a django project on awslightsail from bitbucket
I'm following the instructions given on Using AWS CodeDeploy and AWS CodePipeline to Deploy Applications to Amazon Lightsail to implement ci/cd for my Django project. my project is currently published on AWS lightsail. on the last step (on Fork the GitHub Repo section), this tutorial uses GitHub, instead of GitHub, I want to use bitbucket, where my project is stored now. All I could find on bitbucket docs was Python with Bitbucket Pipelines. But, I'm stuck and I don't know where to use the bitbucket-pipelines.yml file, and how to connect these two tutorials. any clue is really appreciated. -
Anybody see the problem? #Bootoast script
Trying to get Bootoast to work on my website, where I try to pass a message. You can see the code below. Using Django-bootstrap for front-end. BASE.HTML <script srs="https://unpkg.com/bootoast@1.0.1/dist/bootoast.min.js"></script> <link rel="stylesheet" href="https://unpkg.com/bootoast@1.0.1/dist/bootoast.min.css"> <script> function toast(message, type) { bootoast.toast({ position: 'bottom-center', message, type, }); } {% if messages %} {% for message in messages %} toast('{{ message }}', '{{ message.tags }}') {% endfor %} {% endif %} </script> VIEWS.PY @login_required(login_url="/sign-in/?next=/customer/") def profile_page(request): user_form = forms.BasicUserForm(instance=request.user) customer_form = forms.BasicCustomerForm(instance=request.user.customer) if request.method == "POST": user_form = forms.BasicUserForm(request.POST, instance=request.user) customer_form = forms.BasicCustomerForm(request.POST, request.FILES, instance=request.user.customer) if user_form.is_valid() and customer_form.is_valid(): user_form.save() customer_form.save() messages.success(request, 'Your profile has been updated') return redirect(reverse('customer:profile')) return render(request, 'customer/profile.html', { "user_form": user_form, "customer_form": customer_form }) So the message I want to get passed is in views.py. -
Unable to deploy my django based API on Heroku
I tried to deploy my django based api to heroku, however I have been getting the same error for the past few lifetimes Error logs: *2021-01-31T11:42:30.163925+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=hospagoapi.herokuapp.com request_id=ba1f93a1-50ec-492e-b637-a3df4a1ab8d0 fwd="42.110.150.136" dyno= connect= service= status=503 bytes= protocol=https 2021-01-31T11:42:35.081501+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=hospagoapi.herokuapp.com request_id=abbd9954-86b9-41a6-b895-a9261ac12082 fwd="42.110.150.136" dyno= connect= service= status=503 bytes= protocol=https 2021-01-31T11:42:39.924144+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/v1/users" host=hospagoapi.herokuapp.com request_id=32eddcbd-7b44-49ef-9d1f-244f29681f05 fwd="42.110.150.136" dyno= connect= service= status=503 bytes= protocol=https 2021-01-31T11:42:41.717524+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=hospagoapi.herokuapp.com request_id=79c677cd-4a6c-4c7e-9ea5-db60a2732f2f fwd="42.110.150.136" dyno= connect= service= status=503 bytes= protocol=https* Hospagoapi is my app name My production git repo: https://github.com/RachitKumar205/hospago I apologize for any errors in my question in advance, this is my first time posting -
It is possible to run celery on gpu?
The question is - It is possible to run celery on gpu? Currently in my project I have settings like below: celery -A projectname worker -l error --concurrency=8 --autoscale=16,8 --max-tasks-per-child=1 --prefetch-multiplier=1 --without-gossip --without-mingle --without-heartbeat This is django project. One single task take around 12 s to execute (large insert to postgresql). What I want to achive is multiply workers as many as possible. -
how to add search bar in django leaflet
I'm trying to use a map on my website and for that, I'm using the Django leaflet library and I need to add a search bar to my map but I don't know how to do it help me pls my map -
plotly dash: click to enlarge table
I am fairly new to plotly dash and I am working with a data table. I would like to learn how it is possible to display like the first n rows on screen and have a "click to enlarg" button on the last row of the table that would enlarg the table to full screen and show all rows. I have not found a way to do this with plotly and dash yet, so I am wondering if this is possible and if yes, how? An link to resource, tuto, is welcomed!