Sorry if this question was asked before but I tried the suggestions in there and still cannot resolved it. I’m running Django project behind Nginx on my VPS. Main project is at https://myproject.com (port 443) and works …
I'm working through the "Django 5 by Example" textbook, and am nearly finished with chapter 12, however at the very end when the text asks you to runserver and checkout http://127.0.0.1:8000/accounts/login, I get the following error: …
What is the best practice in Django to achieve this? Should I use a management command + cron job, django-crontab, or Celery beat for scheduling the deletion? Is there a way to make this automatic without having to call the …
Настраиваю celery для Django. Поставил Docker, поставил Redis, как сделать так, чтобы при старте системы поднимался Redis из Docker, чтобы в виртуальном окружении его не поднимать? Или же Docker надо ставить в самом окружении проекта? ОС Centos 10.
Есть у меня две базы: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', }, 'mysql_db': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'ИМя2', 'USER': 'ИМя1', 'PASSWORD': 'Пароль', 'HOST': 'Айпи', 'PORT': 'Порт', } } пытаюсь в странице отобразить информацию из …
Recently, I was experimenting with Django URL customization and token-based encryption. I used AI "ChatGPT" to optimize code include these lines : url = url[1:] + req.request_token url = '/' + encrypt_text(url) + '/' But I spotted a subtle …
I have an Django Application that runs only locally on my machine. I have two diffrent tabels, with the transaction and the price. Now I want to enrich my transaction with the price. I wrote something similar already to calculate …
What is the issue or error you’re encountering I have create a Django app which run on a uvicron server on and AWS EC2. The EC2 is attached to a load balancer which is then connected to cloudflare proxy. If …
I am learning how to deploy a django website and for that I have 2 copies of the code in 2 Git branches one for developing (master) and the other for deploying (deployment) with differint configuarations. I did some modification …
I was working with shutil module. My file structure looked like this projects/backend/--3-5 repos-- . In one of the repo's views.py I used for d in destDirs: shutil.rmtree(d, ignore_errors=True) destDirs = "projects/backend/repo1/static/file1 After that my whole file system got …
I have sucessfully developed a Django App. However, i made some changes to the admin-panel and actually I can only successfully deploy the App in my tes-environment when I migrate the base-"makemgrations" and copy afterwards the changed migrations files for …
I try to check my Django project with pyright. There is this OneToOneField, which pyright does not detect, when I use it: user.lala Error message of pyright: error: Cannot access attribute "lala" for …
I. Have been try to combine both jwt and django allauth but i'm still considering that is not important I have read different documentation but i was not still satisfied please i need some advice And is my allauth email-verfication …
The default storage does'nt change! There by not letting me add images to the aws bucket and coz of that it shows an access denied message when i open the image url but in reality it just added the image …
My django app loads several pages (images) at once, e.g. to show a document, and queries the database mainly to check permissions. Django keeps the connections alive, but doesn't re-use them. At some point the maximum number of connections of …
I’m using Django with django-tenants and django-tenant-users to manage multi-tenant accounts. I’m having an issue when creating a new tenant: When I try to create a new user + its tenant through my view, I get the following error: django.db.utils.IntegrityError: …
Yesterday I reinstalled Windows and now my Django project’s Google login (using django-allauth v0.65.11) stopped working. I use a virtual environment and reinstalled the same dependencies (pip freeze matches exactly). Before the Windows reinstall, everything worked fine. Now, when …
Within a django_filters.FilterSet: class SomeFilter(django_filters.FilterSet): model = SomeModel fields = { "is_archived": ("exact",), } include_ancestors = django_filters.BooleanFilter(method="include_ancestors_filter") def include_ancestors_filter(self, queryset, name, value): pass how can I specify that the filter field include_ancestors should be applied after all other filter …
I am building a Django-based subscription system and integrating it with QuickBooks Payments. My goal: Allow a customer to enter their credit/debit card details once. Store their card in a secure way. Charge them automatically every month (like Stripe …
So I migrated my app to django tenants, in my local, I don't have any issues, I create a tenant and I don´t see the same data as public, but in the prod environment I see the data from public …
I'm working on a project that uses django, djangocms, and djangocms-text-ckeditor. The project is old and desperately in need of updating, so i'm currently updating these major packages one at a time. Due to djangocms-text-ckeditor no longer being supported and …
I have a variation of the problem described here: Using DjangoFilterConnectionField with custom Connection in graphene_django The modified problem is as follows: Lets say I have a Django model class 'User', that has a field 'email_addrs' that is a …
I’m trying to apply custom throttling for the signup endpoint in my Django REST Framework API. The goal is to allow only 5 signup attempts per hour for anonymous users. I created a SignupRateThrottle class that sets scope = "signup" …
I create a new instance of Model an use makemigrations its work and this is my 0001_initial.py: class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='ProfileModel', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('avatar', models.ImageField(blank=True, …
I am making an API with django rest framework and django 5.2 when i send a POST request, if i be logged in it gives me an CSRF token missing error. but if i be logged out it gives me …
I use PyRight to check my Django code. It complains about that class FooForm(ModelForm): def clean(self): cleaned_data = super().clean() start = cleaned_data.get("start_date") # <------- here error: "get" is not a known attribute of "None" (reportOptionalMemberAccess) …
I've been handed a rather old Django installation to support, with the specific request to re-enable a report that used to go out every week or so, but stopped showing up a few months ago. Django v 1.5.1 Python 2.7.3 …
I’m building a multi-tenant SaaS application with Django Ninja as the backend and Next.js as the frontend. I’m running into a problem around handling RBAC permissions and org-level feature entitlements without causing bad UI behaviour. Current setup The app …
Создаю тестовый проект в Django rest api. Есть данные из sqlite3: [ { "id": 1, "title": "test", "content": "test", "idcard": "Card", "idmenu": "Info", "author": "Admin", "date": "3" }, { "id": 2, "title": "Name table1", "content": "table1 will be here", "idcard": …
I am working on a cookie cutter JSON web API. Think /items/<id> with your typical CRUD of delete, patch, get, and post. Recently, we started rolling out a new permissions model for the API, where certain operations are forbidden based …
I have 3 Tabels in Django class Transactions(models.Model): public_key = models.ForeignKey(Keys, on_delete=models.CASCADE) txid = models.CharField(max_length=30) timestamp = models.DateTimeField() hash = models.CharField(max_length=64) block = models.IntegerField() amount = models.IntegerField() saldo = models.IntegerField() fee = models.IntegerField() fiat_CHF = models.FloatField(default=0) fiat_USD = models.FloatField(default=0) fiat_EUR …
I have 3 Tabels in Django class Transactions(models.Model): public_key = models.ForeignKey(Keys, on_delete=models.CASCADE) txid = models.CharField(max_length=30) timestamp = models.DateTimeField() hash = models.CharField(max_length=64) block = models.IntegerField() amount = models.IntegerField() saldo = models.IntegerField() fee = models.IntegerField() fiat_CHF = models.FloatField(default=0) fiat_USD = models.FloatField(default=0) fiat_EUR …
When I start python manage.py runserver I get many messages similar to the following: File C:\Users\PC\OneDrive\Documents\DoseSaaS\DoseV3MasterSaaS\templates\admin\dose\tenant\change_list.html first seen with mtime 1754471094.0 to the point it fills the terminal window. How do I stop this? Could not find anything …
I am using dj-rest-auth with Django as the backend and React.js as the frontend. I want the password reset email to point to my React frontend URL, not the default API endpoint. Sending: http://localhost:8000/api/auth/password/reset/confirm/{uidb64}/{token} Correct url: https://my-domain.com/password-reset/confirm/{uidb64}/{token} .env <pre class="lang-json …
I am starting learn django,I have made some basic templates/views and want to show the text from a json file located in the assets/jsons folder.The file is called "quotes.json" The content of the json file: { "emp_details": [ { "emp_name": …
I am working on this weekend project, to learn Django and I am stuck. Before adding the REST framework (one to last commit in the repo), everything was working just alright. Once I added …
For my Django projects, I am used to creating a custom user model and managing what my user can do for a specific route using a roles field like this: class User(AbstractBaseUser, PermissionsMixin): name = models.CharField("full name", max_length=255, blank=True) email …
I'm integrating Stripe with my Django app (using Django REST Framework). I've set it up to accept POSTs, and when I use the Stripe CLI to trigger events, everything works perfectly. Example Stripe CLI command: stripe listen --forward-to localhost:8000/webhooks/api/v1/stripe-webhook/ …
In my django application I have a list of notification types and I want to allow customers to subscribe to one or more notification types. Each notification type has somewhat of a custom logic so the code of each notification …
I have a website that uses an email contact form. Recently been told it does not work. When I recreated the error in development I got the error 535, b'5.7.139 Authentication unsuccessful, basic authentication is disabled. I read online that …