DoesNotExist at /up_emp/31/ Employee matching query does not exist. Request Method:POSTRequest URL:http://127.0.0.1:8000/up_emp/31/Django Version:5.0.6 Exception Type:DoesNotExistException Value:Employee matching query does not exist. While I was implementing CRUD operations in Django, I encountered some errors during the update process. Could you …
I've been working on a social media clone of mine for a few days and I now think that having discord as a method to signup and login would be really cool. How can I integrate it using only Allauth? …
Why we import like this. from django.db.models import Model, Model class is inside base.py not models. expecting from django.db.models.base import Model, why base module ommitted. django/db/models/base.py is the structure
I have a domain as abc.com. I have created subdomain as xyz.abc.com. I have two Django Webapps both are not same. I want to deploy both Django Webapps with this domain and sub-domain on same VPS server. Webapp deployed on …
So the context is I'm following a tutorial on codemy.com. Somewhere before Django 5.0 I lost my "magic", the tutorial was written for 3.8 or 4.X maybe. I am showing a function based view although I have tried the class …
In my django app am using DRF and it gives me , and it gives me this strange error when i try to run the app : water_maps | router.register(r'breaches_edit_delete', api.BreacEditDeletehViewSet) water_maps | File "/usr/local/lib/python3.10/dist-packages/rest_framework/routers.py", line 59, in register water_maps …
I am using django for my backend and postgresql for my database cause I have timeseries data i use timescaledb. i have hypertable called devices. there is a composite primary key on fields created_datetime(timestamp) and device_id(integer). I want to use …
I am facing the issue to integrate QR code in python django website but not getting proper solution Please help me that how can i integrate the QR code payment gateway in django. and what will be the payment method …
So I am trying to build a Django e-commerce website, where there is a cart modal which pops up when I try to add any product by clicking the add to cart button. While the product is being added correctly …
Im planning to develop Django framework for the LLM fine-tuned model based on HuggingFace models, I want the text to be streamed from model to the Django. My issue is that model streams the output in the terminal but not …
I am working on a Django project. Recently while working on my new project, I had to delete py an open project folder. Now I am not able to access the list of pip packages from any of the newly …
In Django, I have a TextField called 'description' in a model with null and blank set to False (for server side and client side validation). I'm using forms.ModelForm to pull the field and I'm using forms.Textarea to assign attributes. In …
I'm following along sentdex's django development tutorial. This is the code in the admin.py file class TutorialAdmin(admin.ModelAdmin): fieldsets = [ ("Title/date", {"fields": ["tutorial_title", "tutorial_published"]}), ("Content", {"fields": ["tutorial_content"]}) ] formfield_overrides = { models.TextField: {'widget': TinyMCE()} } admin.site.register(Tutorial, TutorialAdmin) <a href="https://i.sstatic.net/bmfHmxsU.png" …
My ModelSerializer is getting a KeyError when I call .data on the serializer and I'm not sure how to properly fix this error. Knox's AuthToken model looks like this class AuthToken(models.Model): objects = AuthTokenManager() digest = models.CharField( …
I do have such a model with class RecipeTag(models.Model): tag = models.CharField(max_length=300, blank=True, null=True, default=None, db_index=True) recipes = models.ManyToManyField(Recipe, blank=True) description = models.TextField(blank=True, null=True, default=None) language_code = models.CharField( max_length=5, choices=[(lang[0], lang[1]) for lang in settings.LANGUAGES], default='en', db_index=True # Index added …
In Django, I have this FBV that updates selected records: def edit_selected_accountsplan(request): selected_items_str = request.GET.get('items', '') selected_items = [int(item) for item in selected_items_str.split(',') if item.isdigit()] accountsplan_to_edit = AccountsPlan.objects.filter(id__in=selected_items) AccountsPlanFormSet = formset_factory(form=AccountsPlanForm, extra=0) if request.method == 'POST': formset = AccountsPlanFormSet(request.POST) if …
I have installed Cygwin on Windows 10 and installed following packages gcc-core (version 11.0.4-1, under Devel category ) gcc-g++ (version 11.0.4-1, under Devel category ) libintl-devel (version 0.22.4-1, under Text category ) gettext-devel (version 0.22.4-1, under Text category ) …
Je suis sur le point de réaliser une plateforme de protection et je demande la plus adéquate programmation pour réaliser ce plateforme je ne suis qu'au tout début qui est le cahier de charge et le plan mais je saiqs …
СОбственно вопрос в теме. Как сделать так чтобы на страницах приложений был свой placeholder, а не родительской страницы приложения?
Description: In my Django project, the static files path is generated incorrectly, appending the current page URL before the static URL. For example, when I'm on the about page, the path becomes http://127.0.0.1:8000/about/static/images/bg/17.jpg instead of <a href="http://127.0.0.1:8000/static/images/bg/17.jpg" …
I'm hosting a React frontend app and Django backend API on Nginx in a single local Raspberry Pi, on ports 80 and 8000, respectively, with the following config: // REACT APP server { listen 80; listen [::]:80; root /link-to/build; index …
Here i have two component Child Component which passes text and image to the Parent component and Parent post the form But text is passed but image is getting error. I am using Django as Backend I can provide it …
I'm developing a desktop application where users can log in using credentials from my Django website's database. The goal is for users to be able to create posts on the Django website (forum) through the desktop application. In the desktop …
I am trying to update from Django 4.2.13 to the most recent version (Django 5.0.6 at the time of writing). I ran pipenv update and a number of other dependencies were upgraded successfully, as reflected in my Pipfile.lock. However, Django …
I'm using django and oscar to create an ecommerce site. I'm trying to add allauth, and i need to add buttons to login_registration.html template. I set the templates dir to my custom template folder and already subscrived the oscar/base.html template …
I am trying to fetch data from this app http://api.aladhan.com/v1/calendarByCity/:year/:month search by city but failed I am writing this code in my project. Can you please help me how to fix this problem? def index(request): if request.method …
Can anybody help with this problem on django queryset distinct/order with annotated fields? THIS WORKS It returns nicely and called my Serializer after, no problem at all. def get_queryset(self) -> list: distinct_by = ('distance_to_first_point', 'id') pnt = create_point(float(lat), float(lng)) queryset …
I am doing first steps in Django. And I want to write program which can help me in my сurrent work. What is the problem? I need to have fields with dictionary of objects. But I do not know how …
I'm trying to add google authentication to my django application that is a social network, I added 'allauth.socialaccount.providers.google' into installed apps and created SOCIALACCOUNT_PROVIDERS = { 'google': { 'SCOPE': [ 'profile', 'email', ], 'AUTH_PARAMS': { 'access_type': 'online', } }, } …
I want to store an image in the media folder and the URL in the image field of the model. in this code the image is directly get saved to the model class CustomUser(AbstractUser): email = models.CharField(max_length=50,unique=True, null=True) username = …
I have two models, DocumentData & RecurringInvoice, which have a one to one relationship with each other. When I create an entry in the RecurringInvoice table, I want to pass in the DocumentData instance, instead of the id. But I …
I am new to Django and i am using Django Rest Framework for Backend. I followed this tutorial to add Ldap authenrication to my Django Rest Framework project. AUTH_LDAP_SERVER_URI = "ip" AUTH_LDAP_BIND_DN = "dn" AUTH_LDAP_BIND_PASSWORD = "password" …
Me working on python django school LMS project and facing issue in html dropdown filter. there are 3 fields. teacher name, subject list, and checkbox of classes. If I select class 1 one then that time subject dropdown should be …
We use an OAuth2-Proxy for our apps. Therefore the request header includes all groups of a user and the header get large. This is no problem for our fastAPI based apps but not for Django based apps. We always get …
I am developing a Django application where users can upload files associated with specific topics and submissions. Despite setting up everything according to the Django documentation, the files do not appear in the specified media directory or in the database …
I aim to access specific static files and HTML pages stored in either an S3 bucket or an Azure blob container using various URLs. The concept involves our server generating dynamic URLs in a specific format and then responding with …
I am trying in Python Django to create a system for encrypting and decrypting messages. Does anyone know why I get an error every time I try to read a message: "The encrypted message is invalid and cannot be decrypted". …
After running installation command, the output are as follows. please help me in setting up virtual env for django \Django>pip install virtualenv Requirement already satisfied: virtualenv in c:\python311\lib\site-packages (20.26.1) Requirement already satisfied: distlib<1,>=0.3.7 in c:\python311\lib\site-packages (from virtualenv) (0.3.8) Requirement already …
I have the following Django Test for a CreateView: def test_post_non_chargeable(self): self.client.force_login(self.user) form = EditStudyForm(data=self.non_chargeable_payload) self.assertTrue(form.is_valid()) response = self.client.post(self.url, self.non_chargeable_payload) self.assertRedirects(response, reverse("researcher_ui:console_study", kwargs={"pk": self.study.pk})) The first test, that the form is valid works. The second test doesn't work. The …
I am trying to save data in the database, it works for most of my models but for few models I am not sure why but django is not serializing data. I hope someone can point out where I might …