Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Djongo Remove DB (python manage migrate)
I'm using djongo. I don't know what the cause is, but a message asking me to run python manage migrate appears from time to time. Does anyone know the cause? please. this is my code below code is app/models model from djongo import models class RealTime(models.Model): _id = models.CharField(max_length=255, primary_key=True) site = models.CharField(max_length=125) title = models.CharField(max_length=255) url = models.URLField() create_time = models.DateTimeField() GPTAnswer = models.TextField() class Meta: db_table = 'realtimebest' class Daily(models.Model): rank = models.IntegerField() title = models.CharField(max_length=255) url = models.URLField() create_time = models.DateTimeField() below code is Schema schema import graphene from graphene_django.types import DjangoObjectType from graphene import Mutation from .views import board_summary from .communityWebsite.models import RealTime, Daily class RealTimeType(DjangoObjectType): class Meta: model = RealTime class DailyType(DjangoObjectType): class Meta: model = Daily class Query(graphene.ObjectType): all_realtime = graphene.List(RealTimeType) all_daily = graphene.List(DailyType) def resolve_all_realtime(self, info, **kwargs): return RealTime.objects.all() def resolve_all_daily(self, info, **kwargs): return Daily.objects.all() class SummaryBoardMutation(Mutation): class Arguments: board_id = graphene.String(required=True) response = graphene.String() def mutate(self, info, board_id): response = board_summary(board_id) return SummaryBoardMutation(response=response) class Mutation(graphene.ObjectType): summary_board = SummaryBoardMutation.Field() schema = graphene.Schema(query=Query, mutation=Mutation) settings.py # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', "corsheaders", # Graph QL 'graphene_django', 'graphene_mongo', 'webCrwaling', 'kingwangjjang', 'chatGPT' ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'corsheaders.middleware.CorsMiddleware', … -
get user-details from rest-auth/user
I want to get the details of the logged in user... it's working on localhost, but not on remote other paths e.g rest-auth/login/ etc are all working on remote except rest-auth/user it keeps returning Server error(500) my url pattern urlpatterns = [ path('', include('dj_rest_auth.urls')), ] config in setting REST_AUTH = { 'USER_DETAILS_SERIALIZER': 'accounts.serializers.UserDetailsSerializer', } REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.TokenAuthentication', ] } i don't know what's wrong -
Problem with organizing models and forms in Django
I need a good tip, how can i create registration form fro this two models: class Adress(models.Model): """ Abstract model for users and organizations adresses """ country = models.CharField(max_length=50) city = models.CharField(max_length=50) street = models.CharField(max_length=50) house_number = models.IntegerField() postal_code = models.CharField(max_length=50) class Meta: verbose_name = "Adress" verbose_name_plural = "Adresses" And Patient model: class Patient(DiaScreenUser): """ Choices for diabet type options """ FIRST_TYPE = '1' SECOND_TYPE = '2' NULL_TYPE = 'null' DIABETES_TYPE_CHOICES = ( (FIRST_TYPE, '1 тип'), (SECOND_TYPE, '2 тип'), (NULL_TYPE, 'відсутній'), ) height = models.DecimalField(max_digits=6, decimal_places=2) weight = models.DecimalField(max_digits=6, decimal_places=2) body_mass_index = models.DecimalField(max_digits=6, decimal_places=2, blank=True, null=True) connect_to_doctor_date = models.DateTimeField(blank=True) diabet_type = models.CharField(max_length=10, choices=DIABETES_TYPE_CHOICES, default=NULL_TYPE) is_oninsuline = models.BooleanField(db_index=True) doctor_id = models.ForeignKey(Doctor, on_delete=models.SET_NULL, blank=True, null=True) adress_id = models.ForeignKey(Adress, on_delete=models.SET_NULL, blank=True, db_index=True, null=True) I need a registration form in which patient could input his personal info AND adress info ( BUT i cant understand how it works when i have a foreign key in my patient model ). Thanks for any advices! I tried create something like that, but in this case i cannot understand how to link adress to a patient class AdressForm(ModelForm): class Meta: model = Adress fields = ["country","city"] class PatientForm(ModelForm): adress_form = AdressForm() class Meta: model = Patient fields … -
No connection to the administartion panel. Django, JS
I'm having trouble connecting my snake game points to the model registered in admin. Then I want to use them to create a ranking.I dont use a JS on a daily basis so i use chatGtp to generate js code. I more or less understand the JS code. Its my code: @require_POST def submit_score(request): data = json.loads(request.body) score = data.get('score') user = request.user if request.user.is_authenticated else None if user: player_username = user.username new_score = Score(player=user, point=score, player_username=player_username) new_score.save() return HttpResponse("Dobry wynik!") class Score(models.Model): player = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True, blank=True) point = models.IntegerField() player_username = models.CharField(max_length=30) # Stores the username def __str__(self): return f'{self.player_username} - {self.point}' function submitScore(score) { // fetch to send score fetch('submit-score/', { // The URL to change to the correct endpoint in Django method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': getCookie('csrftoken') // Required to Django to prevent CSRF attacks }, body: JSON.stringify({ score: score }) }) .then(response => { console.log(response); if (response.ok) { return response.json(); } throw new Error('Nie udało się zapisywać wyniku.'); }) .then(data => console.log('Wynik został zapisany:', data)) .catch((error) => console.error('Błąd:', error)); } I call the JS function in restart game. The game on the website works as it should -
Django: problem with adding apps to isntalled apps when they are moved from root directory
i am using django 4.2 . the project was working when apps were in base directory ( where manage.py locates) , then i created an apps directory and moved the apps to this directoryso the structure is like this ( partially) : /project/ /manage.py /config/ /settings/ / base.py # base settings file / local.py / testing.py / __init__.py /__init__.py /requirements/ /siteapps/ /products/ / (file of products app including __init__.py /accounts/ / (file of accounts app including __init__.py / (other apps) /__init__.py and this is related code i use in base.py settings : BASE_DIR = Path(__file__).resolve().parent.parent.parent print(f"base dir => {BASE_DIR}") # output : # base dir => /code # /code is base directory is docker container the project running in. print("path =>", sys.path) # output: # path => ['/code', '/usr/local/lib/python311.zip', '/usr/local/lib/python3.11', '/usr/local/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/site-packages'] INSTALLED APPS = [ ... # other apps including django's and third parties, # LOCAL APPS "siteapps.accounts.apps.AccountsConfig", "siteapps.products.apps.ProductsConfig", ] the error i get is : Traceback (most recent call last): File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() File "/usr/local/lib/python3.11/threading.py", line 982, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run autoreload.raise_last_exception() File "/usr/local/lib/python3.11/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception raise _exception[1] … -
Почему внутренний HTML на странице не обновляется?
I'm making a project in Django. ran into a problem. I have div containers with dynamic IDs. I load the ID from the database and automatically upload it to HTML. Here is an example of dynamic IDs for container divs: <div id="replyLikesDiv"> <img id="replyReviewsImg" src="{% static 'images/icons8-reply-arrow-50.png' %}"> <div id="replyReviewsDiv">Ответить</div> <img class='likesReviewsImg' id="likesReviewsImg{{ REVIEWS_IDS }}" onclick="likesReviewsImgClick(this)" src="{% static 'images/icons8-facebook-like-50.png' %}"> <div class='likesReviewsDiv' id="likesReviewsDiv{{ REVIEWS_IDS }}" onclick="likesReviewsDivClick(this)">{{ REVIEWS_LIKES }}</div></div> <div class="likeAuthorizationDiv" id='likeAuthorizationDiv{{ REVIEWS_IDS }}'> <div id="likeAuthorizationMessage">Пожалуйста, авторизуйтесь, чтобы продолжить.</div> <div id="sendReviewBtnDiv2"> <div id="sendReviewBtn2"">Закрыть</div> </div> </div> REVIEWS_IDS is automatically loaded from the database and inserted using the Jinja template engine. REVIEWS_IDS is an integer value 1,2,3,4... and does not repeat, so all ids are unique. By design, when you click id="likesReviewsDiv{{ REVIEWS_IDS }}", the likesReviewsDivClick() function is called. It looks like this: function likesReviewsDivClick(el){ var id = el.id; id = Number(id.replace(/[^0-9]/g, '')); id = 'likeAuthorizationDiv' + id; var element = document.getElementById(id); element.style.visibility = 'hidden'; alert(element.style.visibility); } In the function I read the ID and substitute it in likeAuthorizationDiv. Then I get the element I need in the function and try to change its style to hidden. The style changes in the alert, but not on the page. What can be wrong? I … -
Is there a function for adding buttons?
I created a website using python, and it was operating good. But now my buttons are not working properly. I ran a migration,added some more stuff and now my buttons refuse to work. How do I get it to start operating again?? -
Specifying one of many keys for a DRF serializer response
I'm building an API to a spec which has been defined by a third party, the response returns a list of items, each specified by a key which indicates it's type. example: [ { 'someType': { 'name': 'some type instance', 'someTypeSpecificField': 'foo', } }, { 'someOtherType': { 'name': 'some other type instance', 'someOtherTypeSpecificField': 123, } }, { 'someType': { ... } }, ... ] Where each of the items in the response are derived from one model ie. class SomeModel(models.Model): name = models.CharField() type = models.ChoiceField() ... I was curious what the best way to define this type of output might be using DRF serializers. Ideally it would be DRF-y enough to parse out properly in our AutoSchema, but any solutions are welcome. -
in django i try to get a word collection but my function return "nothing"
I have a foreign language learning page, which also has a memory game that works by displaying a random word. I would like to use the same database as the game to display a "word: translation" dictionary with all the words in alphabetical order. thanks this is my views.py file from django.shortcuts import render from cards.models import Card def lexicon(request): card_list = Card.objects.all() context = {'card_list': card_list} return render(request, 'lexicon/lexicon.html', context) and this is my html <main> <div class="container-small"> {% for card in card_list %} <p>{{ card.question }}</p> <p>{{ card.answer }}</p> {% endfor %} </div> </main> my db.sqlite3 file have this structure database structure -
Cant login django administrator
why when is_staff = false and is_superuser = true I still can't log in to the django administrator dashboard. Can I do something custom so that is_superuser can still log in even though is_staff is false?.can anyone help me? -
Validation using cerberus
I am trying to validate a validation schema using cerberus but getting error. The data is like this "day": { "monday": { "period": "2023-06-27", "time": "05:03:00" } }. I tried a schema but always getting the error {'type': ['must be of dict type']} -
Error while running the Django exe file created by PyInstaller
I am using Pyinstaller to convert my Django project to a standalone executable file. WHen i run the exe file, i get the following error in the window. Can you please tell me what the error means and where should i check to rectify the error. `Traceback (most recent call last): File "manage.py", line 28, in <module> File "manage.py", line 24, in main File "django\core\management\__init__.py", line 401, in execute_from_command_line utility.execute() File "django\core\management\__init__.py", line 385, in execute sys.stdout.write(self.main_help_text() + '\n') ^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'write' ` -
Django-filter Multiple Foreign Keys from one model
I have model with 2 fields place_of_loading and place_of_unloading with foreign key to the same model ConstructionSite. class DailyPerformance(models.Model): date = models.DateField() driver = models.ForeignKey(Employee, on_delete=models.CASCADE) TYPE_OF_GOODS_CHOICES = ( ("Excavated soil", "Excavated soil"), ("Sand", "Sand"), ("Crushed stone", "Crushed stone"),... ) type_of_goods = models.CharField(blank=True, null=True, max_length=30, choices=TYPE_OF_GOODS_CHOICES) place_of_loading = models.ForeignKey(ConstructionSite, on_delete=models.CASCADE, related_name='place_of_loading') place_of_unloading = models.ForeignKey(ConstructionSite, on_delete=models.CASCADE, related_name='place_of_unloading') number_of_rounds = models.IntegerField(blank=True, null=True) Now I want to implement filter using django-filters, but I want instead of 2 fields place_of_loading and place_of_unloading to have 1 field construction_site and to show results for both fields. So if I choose one construction site I want to get all information regarding loading and unloading materials. class DailyPerformanceFilter(django_filters.FilterSet): date = DateFilter(field_name='date', widget=DateInput(attrs={'type': 'date'})) start_date = DateFilter(field_name='date', lookup_expr='gte') end_date = DateFilter(field_name='date', lookup_expr='lte') place_of_loading = django_filters.ModelChoiceFilter(queryset = ConstructionSite.objects.all(), widget=forms.Select(attrs={'class': 'filter-select'})) place_of_unloading = django_filters.ModelChoiceFilter(queryset = ConstructionSite.objects.all(), widget=forms.Select(attrs={'class': 'filter-select'})) construction_site = django_filters.ModelChoiceFilter(queryset = ConstructionSite.objects.all(), widget=forms.Select(attrs={'class': 'filter-select'})) class Meta: model = DailyPerformance fields = '__all__' -
How to cache get_queryset() when using ForeignKeyWidget in django-import-export?
I am importing data using django-import-export but because I use ForeignKeyWidgets there are a lot of database calls making the import very slow for only a few 100 rows (checked with django-debug-toolbar). On the documentation page of Bulk imports the following is mentioned: "If you use ForeignKeyWidget then this can affect performance, because it reads from the database for each row. If this is an issue then create a subclass which caches get_queryset() results rather than reading for each invocation." I believe caching the get_queryset() results could help me, but I have no idea how to do the caching. Could you help me with some example code? I searched on Google for how to do this but didn't find any examples. -
Django: How do I get from my error message into my code?
I am currently working on a Django code where I place a bid in the template that outbids the current bid. view.py def article(request, id): if request.method == "POST": new_bid = request.POST["new_bid"] user_name = request.user get_article = Listing.objects.get(pk=id) try: if int(new_bid) < get_article.current_price: messages.error(request, "Your bid does't count. Bid is less than highest bid.") return HttpResponseRedirect(reverse("article", args=(id, ))) elif get_article.price.bid is None: messages.error(request, "Entry is not a number or is none") return HttpResponseRedirect(reverse("article", args=(id, ))) except AttributeError: messages.error(request, "Attribute Error") return HttpResponseRedirect(reverse("article", args=(id, ))) if int(new_bid) > get_article.price.bid: bid_placement = Bid( bid = int(new_bid), user_name = user_name) bid_placement.save() get_article.price = bid_placement get_article.save() return HttpResponseRedirect(reverse("article", args=(id, ))) else: get_article = Listing.objects.get(pk=id) listed = request.user in get_article.watchlist.all() return render(request, "auctions/article.html", { "get_article": get_article, "listed": listed }) model.py class Bid(models.Model): bid = models.FloatField(default=0) user_name = models.ForeignKey(User, on_delete=models.CASCADE, blank=True, null=True, related_name="user_bid") def __str__(self): return f"{self.bid}" class Listing(models.Model): title = models.CharField(max_length=20) description = models.CharField(max_length=500) developer_id = models.ForeignKey(Games, on_delete=models.CASCADE, blank=True, null=True, related_name="developer_id") current_price = models.IntegerField() price = models.ForeignKey(Bid, on_delete=models.CASCADE, blank=True, null=True, related_name="price") user_name = models.ForeignKey(User, on_delete=models.CASCADE, related_name="user") photo = models.URLField() watchlist = models.ManyToManyField(User, blank=True, null=True, related_name="user_watchlist") def __str__(self): return f"{self.title} {self.description} {self.developer_id} {self.current_price} {self.photo} {self.price}" article.html {% extends "auctions/layout.html" %} {% block body %} <h2>Article</h2> <ul><a … -
Getting two "https://" in the url of image
I'm developing a project using Django and Django Rest Framework in which I have to save an image in a model. I'm using S3 bucket as a storage device. I'm able to upload the image and save it to the model. The Problem When getting response (either getting a single object or an array of objects), I'm getting the url of image with two https://. This only happens when I'm using the Django server that's hosted on AWS Ec2. The url of the image is returned normally when using localhost, the problem is with static files as well (but they aren't used, only the admin panel and rest-framework templates use it) Example: When calling the API from the hosted server This is the response. Notice the image field. [ { "id": 5, "image": "https://https://d2to87w45k79nd.cloudfront.net/media/testimonies/Myron/Section_2_img.png", "name": "Myron", "message": "Cool Website", "position": "CEO", "company": "ME Ltd." }, { "id": 6, "image": "https://https://d2to87w45k79nd.cloudfront.net/media/testimonies/phoenix0347/Section_2_img.png", "name": "phoenix0347", "message": "askjn", "position": "false", "company": "false" }, { "id": 7, "image": "https://https://d2to87w45k79nd.cloudfront.net/media/testimonies/Kushagra%20Gupta/Section_9.png", "name": "Kushagra Gupta", "message": "jksabdsadb", "position": "1jb", "company": "sajd" }, { "id": 8, "image": "https://https://d2to87w45k79nd.cloudfront.net/media/testimonies/jksadb/hero_img.png", "name": "jksadb", "message": "akjsbasjdb", "position": "213u3", "company": "129ujieo2" } ] The same API when called from localhost gives A response like … -
Overriding Function for Password Reset via Email with drf-social-oauth2 and djoser Libraries
What function should I override to enable password reset via email when using both drf-social-oauth2 and djoser libraries, considering that user is active but I'm encountering issues with password reset through djoser after creating a user via email through the drf-social library? -
Why does it change the field without saving the form?
I want to implement the functionality of changing the email address. But before that, I want to check whether the user has changed his email. But for some reason, even without saving the form, the email automatically changes in the database. def form_valid(self, form): new_email = form.cleaned_data['email'] current_email = self.object.email if current_email == new_email: # same values ???? return super().form_valid(form) else: self.request.user.is_active = False self.request.user.save() reset_email_task(self.request.user, new_email) logout(self.request) return HttpResponseRedirect(reverse_lazy('email-done')) I tried a lot, nothing worked -
Django Error DisallowedHost at / Invalid HTTP_HOST header: 'xx.xx.xx.xx' again and again
Error: DisallowedHost at / Invalid HTTP_HOST header: '3.17.142.65'. You may need to add '3.17.142.65' to ALLOWED_HOSTS. I am trying to deploy my django site om AWS EC2 while deploying through github using git clone on AWS live cli. I am getting the following errors again and again. My EC2 instance ip is 3.17.142.65 and in my settings file first i kept it like this ALLOWED_HOSTS = ['3.17.142.65', 'localhost', '127.0.0.1'] this shows me the same error then i changed it to ALLOWED_HOSTS = ['3.17.142.65'] this also giving same error. (One thing i am not getting like i cloned my github project once at starting after then if i am changing on my github setting file how aws cli knows these changes. Btw i run the command git pull origin master Am i right that i should run this command while making any changes on github files? ) I am new to ubuntu and deploying websites so please guide me what mistake i am dong here. To run the server i executing these commands sudo systemctl restart nginx sudo service gunicorn restart sudo service nginx restart My Configured Nginx file server { listen 80; server_name 3.17.142.65; location = /favicon.ico { access_log off; … -
Django with djoser and social auth not working as expected, I have problem when post my state and code on URL
`I'm using Django with Djoser to be able to use google/facebook as social authentication, I created the CustomUserModel. Im using OAuth2 for social login, I got credentials on google etc. When I GET request on this url: enter image description here My Redirect_url config on google console developer platform: enter image description here I have back the response with state and code at URL. But when I try to POST these 2 as params (state and code), I'm facing some error: { "non_field_errors": [ "Authentication process canceled" ] } I'm including also the state on the cookies, because I'm using cookie HttpOnly I tried to remake project on Google to get new credentials, but still not working. How can i solve this error? thanks guys settings.py: from pathlib import Path from os import getenv, path import os from pathlib import Path from django.core.management.utils import get_random_secret_key from datetime import timedelta from django.utils.translation import gettext_lazy as _ import dotenv # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Take environment variables from .env file dotenv_file = BASE_DIR / ".env" SECRET_KEY = getenv("SECRET_KEY", get_random_secret_key()) API_KEY_NEWS = getenv("API_KEY_NEWS") DEBUG = True ALLOWED_HOSTS = getenv("DJANGO_ALLOWED_HOSTS") CORS_ALLOWED_ORIGINS = [ .... … -
Soft deletion in many-to-many relationships with through model in Django
I'm facing an issue in my Django project related to soft deletion in many-to-many relationships using a through model. I'd appreciate any help or advice on how to resolve this issue. I have three models in my application: Author, Book, and BookAuthor. The many-to-many relationship between Author and Book is defined through the BookAuthor model. Here are the definitions of my models: from django.db import models class Author(SoftDeleteModel): name = models.CharField(max_length=100) class Book(SoftDeleteModel): title = models.CharField(max_length=200) authors = models.ManyToManyField(Author, through='BookAuthor', related_name='books') class BookAuthor(SoftDeleteModel): book = models.ForeignKey(Book, on_delete=models.CASCADE) author = models.ForeignKey(Author, on_delete=models.CASCADE) class Meta: # Other necessary meta definitions pass The issue arises when I soft delete a relationship in the BookAuthor model and then try to access the books of an author using the query author.books.all(). Even though I have soft deleted the relationship in BookAuthor, I still see all the books associated with the author. I'm using the django-soft-delete package (https://pypi.org/project/django-soft-delete/), Does anyone have any suggestions on how I can address this issue and ensure that softly deleted relationships are not displayed when accessing through the many-to-many relationship? Any help or advice would be greatly appreciated! Thank you in advance! -
To remove intermedite Page like signup page when login with linkedin using OpenId Connect with django-allauth
In settings.py file 'allauth.socialaccount.providers.openid_connect', SOCIALACCOUNT_PROVIDERS = { "google":{ "SCOPE":[ "profile", "email" ], "AUTH_PARAMS": {"access_type": "online"}, "EMAIL_AUTHENTICATION": True, }, "openid_connect": { "APPS": [ { "provider_id": "linkedin_oidc", "name": "hrms", "client_id": os.environ.get("linkdin_id"), "secret": os.environ.get("linkdin_secret"), "settings": { "server_url": "https://www.linkedin.com/oauth", "token_auth_method": "client_secret_post", "scope": ["openid", "email"] }, } ] } } AUTHENTICATION_BACKENDS = ( "django.contrib.auth.backends.ModelBackend", "allauth.account.auth_backends.AuthenticationBackend", ) SITE_ID = 4 LOGIN_REDIRECT_URL = 'dashboard' LOGIN_URL = "login" LOGOUT_REDIRECT_URL = 'login' SOCIALACCOUNT_LOGIN_ON_GET=True ACCOUNT_EMAIL_VERIFICATION = 'none' SOCIALACCOUNT_AUTO_SIGNUP = True SOCIALACCOUNT_LOGIN_REDIRECT_URL = 'dashboard' When I complete login with linkedin then page redirect to http://localhost:8000/accounts/social/signup/ url, If anyone know how to remove this intermediate page -
django fail to run front-end file
I can run this part of the code successfully using node.js, but there are some issues with transferring this part of the code to django. node.js run node.js success django fail The code has been modified into a django format errors I tried to add this part of the code to the django project, but it failed. -
Django and creating superuser_bot
How to create superuser_bot admin via Django? With user registration and authorization. I am interested in everything that will help me create this telegram bot (a kind of superuser_bot admin). Using the Python programming language, Django framework and of course aiogram (version 3.11, this is very important). I tried to put the project together and it led to a huge quantity of errors. -
Can someone please help me convert my Django project to an exe file?
I am new to Django and I have done a project using Django which has four Django apps. I am trying to distribute my project to someone as a standalone executable file. I am using PyInstaller for that. But, it detects only the main Django app and it can't find the other three apps. What am i doing wrong? Please help me ! I have successfully created an exe file. But upon running it i get an error saying that it doesn't find one of my Django apps. This is the error i got on the window. homepage is one my four apps. core is my main app which settings.py and the other two are transactions and inventory. Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 17, in main execute_from_command_line(sys.argv) File "django\core\management\__init__.py", line 442, in execute_from_command_line utility.execute() File "django\core\management\__init__.py", line 416, in execute django.setup() File "django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) ^^^^^^^^^^^^^^^^^^^^^^^ File "django\apps\config.py", line 178, in create mod = import_module(mod_path) ^^^^^^^^^^^^^^^^^^^^^^^ File "importlib\__init__.py", line 126, in import_module File "<frozen importlib._bootstrap>", line 1206, in _gcd_import File "<frozen importlib._bootstrap>", line 1178, in _find_and_load File "<frozen …