Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django ManyToMany self relationship with through model — user_from and user_to reversed behavior
I added following and followers by using intermediate model, it`s ok but does not correctly specify objects in the intermediate model. I expect the user who follows must to be in the user_from field and the one who followed to be in the user_to. but there are placed opposite. for example: class User(AbstractUser): #somefields following = models.ManyToManyField("self", related_name='followers', through="Contact", through_fields=('user_to', 'user_from'), symmetrical=False, blank=True) intermediate model: class Contact(models.Model): user_from = models.ForeignKey(User, related_name="rel_from_set", on_delete=models.CASCADE) user_to = models.ForeignKey(User, related_name="rel_to_set", on_delete=models.CASCADE) created = models.DateTimeField(auto_now_add=True) class Meta: ordering = ['-created'] indexes = [models.Index(fields=['created'])] def __str__(self): return f"{self.user_from} follows {self.user_to}" -
unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta'
I'm getting the above error while executing the following method in my django rest framework project (Django==5.0.4, djangorestframework==3.16.1). def activate( self, subscription_date=None, mark_transaction_paid=True, no_multiple_subscription=False, del_multiple_subscription=False, ): if no_multiple_subscription: self.deactivate_previous_subscriptions(del_multiple_subscription=del_multiple_subscription) current_date = subscription_date or timezone.now() next_billing_date = self.plan_cost.next_billing_datetime(current_date) self.active = True self.cancelled = False self.due = False self.date_billing_start = current_date self.date_billing_end = next_billing_date + timedelta(days=self.plan_cost.plan.grace_period) self.date_billing_next = next_billing_date self._add_user_to_group() if mark_transaction_paid: self.transactions.update(paid=True) self.save() The trace points to this line in the above method: self.date_billing_end = next_billing_date + timedelta(days=self.plan_cost.plan.grace_period) What I've tried : changed current_date = subscription_date or timezone.now() to current_date = subscription_date or datetime.now() I'm currently setting up the following package for subscription plan in my Django Saas project https://github.com/ydaniels/drf-django-flexible-subscriptions/tree/master The file in the above project where the issue is https://github.com/ydaniels/drf-django-flexible-subscriptions/blob/master/subscriptions_api/base_models.py -
LinkedIn organizationPageStatistics API returns 400 PARAM_INVALID for timeIntervals (REST.li 2.0)
I am calling the LinkedIn organizationPageStatistics endpoint using the REST.li 2.0 API, but I keep getting a 400 PARAM_INVALID error related to the timeIntervals parameter. According to the official documentation (li-lms-2025-11), timeIntervals is an object, not a list. Error response { "errorDetailType": "com.linkedin.common.error.BadRequest", "message": "Invalid param. Please see errorDetails for more information.", "errorDetails": { "inputErrors": [ { "description": "Invalid value for param; wrong type or other syntax error", "input": { "inputPath": { "fieldPath": "timeIntervals" } }, "code": "PARAM_INVALID" } ] }, "status": 400 } Code def fetch_linkedin_analytics_and_save(user, account): organization_urn = f"urn:li:organization:{account.page_id}" access_token = account.access_token start_ms = int( (datetime.now() - timedelta(days=90)).timestamp() * 1000) end_ms = int(datetime.now().timestamp() * 1000) base_url = "https://api.linkedin.com/rest/organizationPageStatistics" LINKEDIN_API_VERSION = os.environ.get("LINKEDIN_API_VERSION", "202511") headers = { "Authorization": f"Bearer {access_token}", "Linkedin-Version": LINKEDIN_API_VERSION, "X-Restli-Protocol-Version": "2.0.0", "Content-Type": "application/json" } time_intervals_str = f'(timeGranularityType:DAY,timeRange:(start:{start_ms},end:{end_ms}))', params = { "q": "organization", "organization": organization_urn, 'timeIntervals.timeGranularityType': 'DAY', 'timeIntervals.timeRange.start': start_ms, 'timeIntervals.timeRange.end': end_ms } print(params) response = requests.get(base_url, headers=headers, params=params) if response.status_code != 200: print(response.text) Attempt 1 – REST.li object string time_intervals_str = ( f"(timeGranularityType:DAY," f"timeRange:(start:{start_ms},end:{end_ms}))" ) params = { "q": "organization", "organization": organization_urn, "timeIntervals": time_intervals_str } Attempt 2 – Flattened parameters params = { "q": "organization", "organization": organization_urn, "timeIntervals.timeGranularityType": "DAY", "timeIntervals.timeRange.start": start_ms, "timeIntervals.timeRange.end": end_ms } Your help will be … -
Which one is best for 2026 Python developers , Python Data science or Python Django?
Only Experts Can Answer this question. Which one is best for 2026 Python developers , Python Data science or Python Django? From both of these which one is easy to learn and high paid? -
Research survey: Evaluating Code First vs Database First in different ORMs
I am conducting an academic research study focused on comparing Code First (CF) and Database First (DBF) approaches in different ORMs. The goal of this survey is to collect objective, experience-based input from developers who have worked in real-world projects. The responses will be used to analyze how CF and DBF are implemented in practice, based on clearly defined technical and organizational criteria. The comparison relies on a structured set of criteria covering key aspects of database usage in modern Django applications — including schema design, migrations and change management, performance considerations, version control, and team collaboration. These criteria are intended not only to describe theoretical differences, but to provide a practical framework for objectively evaluating both approaches in real development scenarios. The same criteria are applied across multiple ORM environments (Entity Framework Core, Hibernate, Django ORM, and Doctrine) in order to compare how different ORMs implement Code First and Database First in practice. If you have experience working with any of these ORMs here are the different survey links: Django: https://docs.google.com/forms/d/e/1FAIpQLSfFvpzjFii9NFZxbaUTIGZEaY0WY4jXty4Erv-hKZPE1ZESyA/viewform?usp=dialog EF Core: https://docs.google.com/forms/d/e/1FAIpQLSdGkQuwa4pxs_3f9f2u9Af64wqy_zeLP2xhhcwKxHnaQdWLmQ/viewform?usp=dialog Hibernate: https://docs.google.com/forms/d/e/1FAIpQLSdU51vOlhwxLFXA7Rp24pdYO-gRwZgm02qqIWaGaEz10MuwQg/viewform?usp=dialog Doctrine: https://docs.google.com/forms/d/e/1FAIpQLSeWwuI1PSFfN3tNC2yYXjw787zfoXOeXKehC1kce3ondiK8NQ/viewform?usp=dialog Thank you for contributing; comments, corrections, and practical insights are very welcome. -
Django DRF JWT Authentication credentials were not provided on UpdateAPIView even for is_staff user
I'm implementing JWT authentication using Django REST Framework and djangorestframework-simplejwt in my project. I have an endpoint for updating a category. What I tried Verified that the JWT token is valid. Confirmed that the user is is_staff=True and is_superuser=True. Tried both PATCH and PUT methods. Question Why am I getting the error message: Authentication credentials were not provided. on this UpdateAPIView, even though JWT is configured and the user is admin? Is there something specific about UpdateAPIView or the way permissions are checked that I might be missing? Imports from rest_framework import generics from rest_framework.permissions import IsAdminUser from drf_spectacular.utils import extend_schema from .serializers import CategorySerializer from .models import Category from .limiter import AdminCategoryThrottle View @extend_schema( tags=["categories"], summary="Update category (admin only)", responses={201: CategorySerializer} ) class UpdateCategoryView(generics.UpdateAPIView): """ This endpoint allows an admin user to update a category. It is protected and only admin users can access it. """ serializer_class = CategorySerializer permission_classes = [IsAdminUser] throttle_classes = [AdminCategoryThrottle] queryset = Category.objects.all() lookup_field = "slug" Serializer from rest_framework import serializers from .models import Category class CategorySerializer(serializers.ModelSerializer): class Meta: model = Category fields = ["name", "is_active"] read_only_fields = ["slug", "created_at", "updated_at"] def validate_name(self, value): if Category.objects.filter(name__iexact=value).exists(): raise serializers.ValidationError("Category already exists.") return value URL path( … -
What does _db used for in a django Model Manager
While trying to create a custom QuerySet and a custom Manager for a django Model I stumbled upon the documentation sections 1 and 2 that use the manager's _db property and i would like to understand what does this property do and why is it necessary to use it when overriding the get_queryset method. I read the code in the django repo and did some django db queries locally with different databases and printed the _db property but it seems it is always None. So, what is the use for it and why is it important to handle it as per doc 2? -
Gunicorn (Uvicorn Worker) continues processing requests after Heroku 30s timeout
I’m running a Django (ASGI) app on Heroku using Gunicorn with the Uvicorn worker to support WebSockets. Heroku has a hard 30-second request timeout. When a request exceeds 30 seconds, Heroku closes the connection as expected. Problem: Even after the Heroku timeout, Gunicorn/Uvicorn continues executing the request in the background, which wastes resources. Gunicorn command: newrelic-admin run-program gunicorn --workers 4 --worker-connections 200 --timeout 30 --max-requests 1000 --max-requests-jitter 500 --bind 0.0.0.0:8000 asgi:application Questions Why does Gunicorn/Uvicorn keep running the request after Heroku times out? Is there a way to cancel the request when the client disconnects? Should this be handled in Django (async cancellation/middleware), or via Gunicorn settings? Any help is appreciated. -
Correct implementation of Wright–Malécot inbreeding coefficient using shortest paths (Python/Django)
I am implementing the Wright inbreeding coefficient (F) for individuals in a pigeon pedigree (Django application, relational database). The current implementation builds the pedigree using a breadth-first search (BFS) up to a fixed number of generations and computes F using the classical formula: 𝐹=∑[(1/2)^(𝑛1+𝑛2+1)] (1+𝐹𝐴) where: n1 is the number of generations between the sire and the common ancestor, n2 is the number of generations between the dam and the common ancestor, 𝐹𝐴 is the inbreeding coefficient of the common ancestor. To reduce complexity, the algorithm intentionally: considers only the shortest path from sire and dam to each common ancestor, does not enumerate all possible loops in the pedigree. Although this approach works for simple pedigrees, the computed F values are incorrect for more complex cases involving: multiple independent loops, repeated ancestors through different paths, deeper or overlapping inbreeding structures. Specifically: the algorithm underestimates F when a common ancestor appears via more than one valid loop, contributions from additional paths are ignored, recursive calculation of 𝐹𝐴 propagates the same limitation. I am looking for clarification on whether: the Wright–Malécot coefficient can be correctly computed using shortest paths only, or all valid ancestral loops must be explicitly enumerated (or otherwise accounted … -
Existing Django project on Pythonanywhere refuses to correctly use static?
I have done the guide and yet i still cannot get it to work correctly. These two screenshots are the closest i have come to success attempt1 attempt2 This is how the site is suppose to look like https://github.com/zekaekop/The-Django-Project. Project settings.py: /home/zekaekop/The-Django-Project/testing_django/settings.py """ Django settings for testing_django project. Generated by 'django-admin startproject' using Django 5.2.7. For more information on this file, see https://docs.djangoproject.com/en/5.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/5.2/ref/settings/ """ from pathlib import Path import os # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-tcfa7m=f*$het2078=iywfz8w7^(u+m^&ya-r9y)(=hhiediu2' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False ALLOWED_HOSTS = ['zekaekop.pythonanywhere.com','localhost','127.0.0.1',] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'crispy_bootstrap5', 'crispy_forms', 'django_cleanup', 'ckeditor', 'post', 'home', 'user_profile', 'accounts', 'admin_panel', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'testing_django.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR,'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'testing_django.wsgi.application' # Database # … -
Does using Django model choices for search filters add server load on every page request?
I’m building a Django-based classifieds website. Previously, my search form populated districts and categories using database queries like: districts = ( AdPost.objects .filter(admin_verified=True) .values_list("district", flat=True) .distinct() ) To improve consistency and performance, I’ve now moved both district and category to static choices in the model. Example: class AdPost(models.Model): CATEGORY_CHOICES = [ ('fish', 'fish'), ('cow', 'cow'), ] DISTRICT_CHOICES = [ ('e', 'e'), ('j', 'j'), ] category = models.CharField(max_length=50, choices=CATEGORY_CHOICES) district = models.CharField(max_length=30, choices=DISTRICT_CHOICES) In my view, I now pass these directly: categories = AdPost.CATEGORY_CHOICES districts = AdPost.DISTRICT_CHOICES And render them in the search form: <select name="district"> {% for key, label in districts %} <option value="{{ key }}">{{ label }}</option> {% endfor %} </select> Question Does using model choices like this add any noticeable server load on every page request, or are these choices loaded once and reused? I want to confirm that this approach is safe and efficient compared to querying the database on each request. What I expect (but want confirmation) My understanding is that: choices are static Python data They are loaded once when Django starts Rendering them in templates does not cause database queries Is this correct? Environment Django 4.x PostgreSQL / SQLite Standard class-based views -
Change color for StackedInline?
I'd like to change background color for these headers for different color (not white): Like this: My models: from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models class Request(models.Model): class Method(models.TextChoices): POST = "POST", "POST" GET = "GET", "GET" PUT = "PUT", "PUT" DELETE = "DELETE", "DELETE" name = models.CharField(verbose_name="Название", null=True, blank=True, max_length=256, help_text="Не обязательно") method = models.CharField( max_length=10, choices=Method, default=Method.GET, verbose_name="Метод" ) url = models.CharField(verbose_name="Путь", max_length=1024, help_text="Часть после домена, без query-параметров") def __str__(self): return self.name or f"{self.method} {self.url}" class Response(models.Model): name = models.CharField(max_length=128, null=True, verbose_name="Название") status_code = models.PositiveIntegerField(verbose_name="Код") body = models.JSONField(verbose_name="Тело", blank=True, null=True) request = models.ForeignKey(Request, on_delete=models.CASCADE, related_name="responses", verbose_name="Запрос") class Meta: verbose_name = "Ответ" verbose_name_plural = "Ответы" def __repr__(self): return self.name or f"{self.request.method} {self.request.url}" @property def query_parameters(self): return {param.key: param.value for param in self.params.all()} class RequestParam(models.Model): key = models.CharField(verbose_name="Название", max_length=128) value = models.CharField(verbose_name="Значение", max_length=128) response = models.ForeignKey(Response, on_delete=models.CASCADE, related_name="params") My admin.py: from django.contrib import admin from django.urls import reverse from django.utils.safestring import mark_safe from app.server.models import Request, RequestParam, Response class RequestParamInline(admin.TabularInline): model = RequestParam extra = 1 @admin.register(Response) class ResponseAdmin(admin.ModelAdmin): inlines = [RequestParamInline] class ResponseInline(admin.StackedInline): model = Response extra = 1 show_change_link = True verbose_name = "Вариант ответ" verbose_name_plural = "Варианты ответов" fields = ["status_code", "body", "summary"] readonly_fields = … -
How to do nested inlines in Django?
I have models: from django.db import models class Request(models.Model): class Method(models.TextChoices): POST = "POST", "POST" GET = "GET", "GET" PUT = "PUT", "PUT" DELETE = "DELETE", "DELETE" method = models.CharField( max_length=10, choices=Method, default=Method.GET, ) url = models.TextField() class Response(models.Model): request = models.ForeignKey(Request, on_delete=models.CASCADE, related_name="responses") body = models.TextField(null=True) class RequestParam(models.Model): key = models.TextField() value = models.TextField() response = models.ForeignKey(Response, on_delete=models.CASCADE, related_name="params") And I'd like to display then all nested request response1 params response2 params ... How can I do it? -
How to make different url aliases work for local django development
I am using django-tenants and created various aliases that all point to localhost. If the local development server is reachable via http://localhost:8000/ and I can login to the admin as expected. If I use e.g. http://other_url.local:8000/django-admin the login form is also presented but I get an error message: 403 Forbidden CSRF verification failes cookie not set. How can I achieve testing for different clients locally without installing an nginx with different vhosts. Settings: CSRF_COOKIE_SAMESITE = None CSRF_COOKIE_SECURE = False Thanks and Regards -
Django Can't find table during insert: LINE 1: SELECT 1 AS "a" FROM "qmgr_def_rules" WHERE "qmgr_def_rules"
I'm trying to add a row to my model, but it keeps coming back with: django.db.utils.ProgrammingError: relation "qmgr_def_rules" does not exist LINE 1: SELECT 1 AS "a" FROM "qmgr_def_rules" WHERE "qmgr_def_rules"... Some context: I have 3 different applications under the same django project. I have 2 different postgres schemas: rules and django. The django schema is set to default where all the django specific tables go. The rules schema is for internal data where I can set interval timers, object definitions, etc. I have multiple tables in the rules schema for different types of data. When I use the admin panel to insert/update/delete on any other table in that schema, it works. Just not def_rules for some odd reason. A few really odd things: Updates work Deletions work Inserts break with error above through admin panel Inserts work if done through django shell (this is the shell that I used) from admin_page.models import QmgrDefRules from django.utils import timezone # Try to create a test entry with all required fields try: test_entry = QmgrDefRules( # Primary key - required qmgr='TEST', # Required boolean fields (NOT NULL in DDL) moni_core_enabled=False, moni_inventory_enabled=False, qreset=True, # Has default=true in DDL dbinsert_0_value=False, # Has default=false in … -
Django admin update get_queryset only for "change" view
In my django project admin I have an Order model. I display a bunch of information in the change page with the help of custom inlines. As I use a lot of related models, I want to prefetch/select the related objects but only for the change page (not the list page). I need to update the get_queryset method with a conditional branch "if this is the change view" but I can't find a proper way to do that. Any ideas? -
Why does Django Http404 return a JSON payload while all other Http error responses don't?
Django's http response.py library provides an Http404 class that can be used to raise a "not found" exception which returns a 404 along with the following JSON payload: {"detail":"Not found."}. However there are no other HTTP error response classes that do this. All the other standard error classes don't (such as HttpResponseBadRequest, HttpResponseServerError, HttpResponseBadRequest, etc). What is the rationale behind only providing a single error class (for a 404) that returns a JSON payload? -
Dealing with m2m changes in Django on object save
So I'm building a webhook functionality for a particular Django model, as in I trigger the webhooks for 2 events. One is for creation and one for modification, as in I wanna trigger them everytime an object of that model is created/updated. So, generally for other models, the pattern I follow is: class Model1(models.Model): ... fields ... def save(self. *args, **kwargs): self.is_new = self._state.adding super().save(*args, **kwargs) self.post_save() def post_save(self): if self.is_new: # Trigger webhook with self object as the payload. trigger_webhook(self) Now, with the current model I'm working, the only difference is that it has an m2m field on it, like: class Model2(models.Model): ... fields m2m_field = models.ManyToManyField( Model3, through="Model1Model2", blank=True, related_name="...", ) ... Now, for this model, when save() is triggered, the m2m field always comes out empty as apparently it's updated beyond this point and we need the field as part of our payload in the webhook. One of the solutions I tried was use a signal like: @receiver(m2m_changed, sender=Model1Model2) def signal_ready(sender, instance, action, **kwargs): if action not in ("post_add", "post_remove", "post_clear"): return trigger_model_webhook(instance) This did work for the case where the m2m field was changed or added during creation, but the limitation with this approach is that … -
How to make django textfield required
I'm somehow unable to make the field required, setting null and blank to True has no effect. # models.py from django.db import models class ExampleModel(models.Model): text_field = models.TextField() # tests.py from django.test import TestCase from .models import ExampleModel class ExampleModelTestCase(TestCase): def test_text_field_integrity(self): with self.assertRaises(Exception): example = ExampleModel.objects.create() -
How to insert single <li>?
I am trying to handle multi-level menu with AlpineJS. Is it posible to insert single <ul> (or </li>) in the code below? <template x-if="item.has_children"> <!-- insert <ul> here--> </template> <template x-if="! item.has_children"> <!-- insert </li> here--> </template> -
Celery crashes when PgBouncer closes idle connections (idle timeouts enabled)
I’m encountering an issue when running Celery with PgBouncer and PostgreSQL after enabling idle connection timeouts. My stack includes: Django (served via Tornado) Celery (workers + beat) PostgreSQL PgBouncer (in front of PostgreSQL) Due to a large number of idle database connections caused by Tornado + Django, I introduced idle timeout settings to protect PostgreSQL from running out of connections. PgBouncer idle_transaction_timeout=240 (4mins) client_idle_timeout=240 PostgreSQL idle_in_transaction_session_timeout=300000 (5mins) idle_session_timeout=300000 (5mins) Problem: After applying these settings, Celery occasionally crashes with the following error: [2025-12-16 06:12:01,578: ERROR/MainProcess] Unrecoverable error: DatabaseError('client_idle_timeout\nserver closed the connection unexpectedly\n\tThis probably means the server terminated abnormally\n\tbefore or while processing the request.\n',) Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/celery/worker/__init__.py", line 351, in start component.start() File "/usr/local/lib/python2.7/site-packages/celery/worker/consumer.py", line 393, in start self.consume_messages() File "/usr/local/lib/python2.7/site-packages/celery/worker/consumer.py", line 885, in consume_messages self.connection.drain_events(timeout=10.0) File "/usr/local/lib/python2.7/site-packages/kombu/connection.py", line 276, in drain_events return self.transport.drain_events(self.connection, **kwargs) File "/usr/local/lib/python2.7/site-packages/kombu/transport/virtual/__init__.py", line 760, in drain_events item, channel = get(timeout=timeout) File "/usr/local/lib/python2.7/site-packages/kombu/transport/virtual/scheduling.py", line 39, in get return self.fun(resource, **kwargs), resource File "/usr/local/lib/python2.7/site-packages/kombu/transport/virtual/__init__.py", line 780, in _drain_channel return channel.drain_events(timeout=timeout) File "/usr/local/lib/python2.7/site-packages/kombu/transport/virtual/__init__.py", line 578, in drain_events return self._poll(self.cycle, timeout=timeout) File "/usr/local/lib/python2.7/site-packages/kombu/transport/virtual/__init__.py", line 287, in _poll return cycle.get() File "/usr/local/lib/python2.7/site-packages/kombu/transport/virtual/scheduling.py", line 39, in get return self.fun(resource, **kwargs), resource File "/usr/local/lib/python2.7/site-packages/djkombu/transport.py", line 31, in _get m = … -
Django Deployment on Render: ModuleNotFoundError for WSGI Application The Problem
Demo of the Project The Problem I am attempting to deploy a Django portfolio project to Render. While the project runs perfectly on my local machine using python manage.py runserver, the deployment fails during the build process. The Render logs indicate that Gunicorn cannot locate the project module, even though the folder structure appears correct in my GitHub repository. Error Log: Bash ==> Running 'gunicorn foremanbportfolio.wsgi:application --bind 0.0.0.0:$PORT' Traceback (most recent call last): ... ModuleNotFoundError: No module named 'foremanbportfolio' ==> Exited with status 1 Minimal Reproducible Example 1. Project Structure: My repository is structured as follows: Foreman-B_MyPortfolio/ ├── manage.py ├── portfolio/ │ ├── __init__.py │ ├── settings.py │ ├── urls.py │ ├── wsgi.py │ └── asgi.py ├── pages/ │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── models.py │ ├── tests.py │ ├── urls.py │ ├── views.py │ └── static/ # App-specific static │ └── pages/ │ ├── css/ │ ├── js/ │ └── images/ ├── static/ # Global static folder (all large assets) │ ├── admin/ # Admin CSS/JS/images │ ├── bootstrap/ │ ├── css/ │ ├── js/ │ ├── img/ │ └── rest_framework/ ├── templates/ │ └── pages/ │ └── foremanbportfolio.html └── staticfiles/ 2. Current Configuration … -
My Journey as a Beginner Web Developer – Need Advice [closed]
As a beginner web developer, I started my journey with **HTML, PHP, and MySQL**. I built only one real project, a **school management system** . One day, I saw someone working with **React** as a front-end developer. That moment really inspired me — I felt a bit of envy and motivation at the same time. I decided to start learning **JavaScript**, and after a few months of understanding the basics, I moved on to **React**. My long-term goal has always been to become a **full-stack developer**. While learning React, some friends advised me to choose **Node.js** as my backend, saying that _React and PHP don’t really make sense together_. I followed that advice and started learning **React + Node.js**.So far, I’ve completed **three to four small React projects**, built my **portfolio** (https://abouzari.vercel.app/), and spent **more than six months learning JavaScript and React**. Later, I enrolled in **OpenLabs (Ghana)** for an **8-month full-stack developer training program**. At the beginning, I faced a challenge: I wasn’t learning much because we were covering fundamentals I had already learned earlier — **UI/UX, HTML, CSS, JavaScript, CSS frameworks, and jQuery**. Because of that, I decided to start **Node.js on my own** while continuing with **React**. … -
"No module named django_heroku" (or django_on_heroku) error
I'm trying to install OWASP PyGoat, and then create a secure version of it. I followed method 2 on the repository's site (https://github.com/adeyosemanputra/pygoat?tab=readme-ov-file#method-2), but running the "python3 manage.py migrate" command yielded the error message in this post's title. I used "pip3 list" to verify that django_heroku was installed. I also tried with the newer django_on_heroku, but got the same result. I saw on another post that somebody tried installing psycopg-binary to fix this, but that's already installed as well. What else should I do to diagnose this problem? -
When building platforms with multiple Python services (FastAPI, Flask, Django, internal APIs), we kept facing the same issues:
When building platforms with multiple Python services (FastAPI, Flask, Django, internal APIs), we kept facing the same issues: • Authentication duplicated across services • Roles and permissions drifting over time • Weak tenant isolation • No clear audit trail We built Verge Auth to solve this centrally. It’s a Python-first authentication & authorization service that: Integrates once across FastAPI, Flask, Django, or custom Python APIs Automatically generates permissions from routes Enforces RBAC and tenant isolation centrally Provides detailed audit logs It can be: Fully self-hosted using Docker Compose (on-prem) Or used as a managed service This is aimed at teams running multiple Python services, not simple apps. Would love feedback: • Would this simplify your setup? • What would make you hesitant to adopt it?