Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
I'm unable to save data to db in Django
Views.py I was trying to save this data that I'm getting from form but I'm unable to save it..it is going for the exception. I think the error is in the following line q = Query(sender=s, subject=subject, message=message, receiver=receiver) class SendQuery(View): def get(self, request): user=request.user if user.is_authenticated: try: s = Student.objects.get(user=user) ###Common code for students op = Staff.objects.filter(stype="1") return render(request,'students/send_query.html',{'s':s,'op':op}) ###Common code for students except: return redirect('home') return redirect('logout') def post(self, request): user=request.user if user.is_authenticated: try: s = Student.objects.get(user=user) ###Common code for students receiver = request.POST.get('receiver') subject = request.POST.get('subject') message = request.POST.get('message') print(receiver,subject,message) if receiver != "None": print("Hello") q = Query(sender=s, subject=subject, message=message, receiver=receiver) q.save() # if t: msg="Query raised successfully" return render(request,'students/msg.html',{'msg':msg}) else: msg="Failed to raise issue. Try again and mention all fields." return render(request,'students/msg.html',{'msg':msg}) ###Common code for students except: return redirect('home') return redirect('logout') -
How to implimanet backend of a Quiz Webiste?
I am planning to make a Quiz app using Django as a backend. Users would be able to make their own quizzes (mostly MCQ questions) and I needed help in figuring out the backend for it. So far my plan was to Have Users, Quiz, and Questions table. And use foreign Keys to connect Users to Their Quizzes and Quizzes to the Question. But this would result in way too many rows in the question table as Number of quizzes increases. Currently, I plan to use Django to make tables. I wanted to know if there is a way to probably make Tables dynamically or some other way to store quizzes data like JASON or some other way? If yes how would I be able to do so using django. I am open to any other suggestions. (not sure if required but I plan to use React for frontend) -
Why am I unable to migrate when other files use my models in Heroku?
For context, I have an application that works perfectly fine locally, after some fiddling with the database. It uses a react frontend, with a django backend for internal api calls. However, on a new, fresh download, with a new, fresh database, I always get an error saying relation "claims" does not exist, where Claims is the name of a table in my database, in the form of a model. I have been able to bypass this error by commenting out all code that uses the model, then slowly migrating every single table, one at a time, then uncommenting out the code that uses the model. This is incredibly tedious, but it works in a local environment. However, as I attempt to push this into production, I am using Heroku, and I am unable to make multiple commits in the same way, as it seems the database gets reset everytime there is a new update. Am I missing something? I feel as though there must be something I am doing incorrectly here, but I have not been able to find anything other than posts saying to reset all my migrations, and redoing the makemigrations command. This method hasn't worked for me … -
Django 3.2.5 é possível ter um app dentro de outro app?
exemplo: tenho um app chamado aplicativo1 na raiz do projeto, mas quero criar o app chamado aplicativo2 dentro do aplicativo1. mas quando faço isso eu não consigo registrar ele no settings e nem chamar as views do aplicativo2 dentro do arquivo urls.py do aplicativo1. como posso fazer isso ? -
How to confirm popup in django test?
I have been writing django tests for a django project, and I encountered a problem. I don't know how to confirm a popup in django test like below in code. [![enter image description here][1]][1] # in tests.py class Tests(TestCase): def test_delete_admin(self): self.client.login(username=self.admin.username, password=self.admin_password) id = self.admin.id path = reverse("accounts:user_delete", args=[id]) response = self.client.post(path) self.assertEqual(200, response.status_code) After I ran this code, I got 302 status code. like this↓ FAIL: test_delete_admin (PBSystem.tests.PBSystemTests) delete admin ---------------------------------------------------------------------- Traceback (most recent call last): File "/src/project/app/tests.py", line 321, in test_delete_admin self.assertEqual(200, response.status_code) AssertionError: 200 != 302 Thank you in advance. -
django live videos and real time chat with node js integration
I plan to build a web application that supports live, video, and real-time chatting Since I've never done anything like this before, I had to understand it well But with studying the topic, the situation became very complicated about what technique to use. I usually work with Django and React But with the research, people say this is very difficult. It is necessary to use Node I went to search for the integration of Node with Django and here I found a greater complexity. People say that you must use redis Pub/sub or that you work with the same database in both sides. Now I'm so distracted I don't see any document on what I want to reach The main question is: how can I integrate Node with Django to implement these functions You can help even with an untested idea or article, literally anything Thanks in advance -
Writing a Django Form while keeping HTML styling
I have a Django form that I have created manually in order to keep the format of the styling, but I realized that the form is compromised of several inputs and manually is taking too long to change each. I am also able to generate the form automatically using {{ form.as_p }} but I lose the HTML style format that I have below. Is there an easy way to make it instead of manually changing each input? This is the original HTML template that I am trying to keep </button> <div class="form-outline mb-4"> <input type="text" id="businessName" class="form-control" name="businessName" /> <label class="form-label" for="typeText" >Legal Business Name</label> </div> Here is the working Django form: {% if submitted %} Your forms has been submitted {% else %} <form method="post"> {% csrf_token %} {{ form.as_p }} <!-- Submit button --> <button type="submit" class="btn btn-primary btn-block mb-4" id="btn" > Submit </button> </form> Here is the views.py def add_form(request): submitted=False if request.method == 'POST': form = infoForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect('/?submitted=True') else: form = infoForm() if 'submitted' in request.GET: submitted=True return render(request, 'template/template.html',{'form':form, 'submitted':submitted}) Here is the form class infoForm(ModelForm): class Meta: model = Info fields = ['businessName'] Here is what I have tried: <div … -
Django running in kubernetes does not load jquery files
I have a django application which I am running using docker container inside kubernetes cluster. When I load it using docker, I can see the proper UI however when I try to load using kubernetes and port-forwarding to local, I see UI like this. I did further investigation and found that inside docker jquery.js file exists however when I run it through k8s only jquery.min exists but no jquery.js Please advise what could be the reason. -
Trying to iterate over a model in Django with class based views but getting the error Project object is not iterable
I used the following code for models.py class Project(models.Model): name = models.CharField(max_length=20,null=True) description = models.TextField(null=True) clientid = models.ForeignKey(Client, on_delete=models.CASCADE) def __str__(self): return self.name def get_absolute_url(self): # new return reverse('projectdetail', args=[str(self.id)]) This is the code for views.py class ProjectDetailView(DetailView): model = Project template_name = 'projectdetail.html' fields='__all__' And this is the template i am using {% extends 'base.html' %} {% block content %} {% if project %} There are {{ project|length }} records: {% for i in project %} <div class="project-entry"> <h2>{{ i.id }}</h2> <p>{{ i.name }} </p> <p>{{ i.description }} </p> <p>{{ i.clientid }} </p> {% endfor %} {% else %} There are no records in the system {% endif %} </div> {% endblock content %} I get the error TypeError at /client/1/projectexisting 'Project' object is not iterable Request Method: GET Request URL: http://02ccd1dfc89b4b71b62f894adef16c07.vfs.cloud9.us-east-2.amazonaws.com/client/1/projectexisting Django Version: 2.1 Exception Type: TypeError Exception Value: 'Project' object is not iterable Exception Location: /home/ec2-user/.local/lib/python3.7/site-packages/django/template/defaulttags.py in render, line 165 Python Executable: /usr/bin/python3 Python Version: 3.7.10 Python Path: ['/home/ec2-user/environment/cons_mgmt/cons_mgmt', '/usr/lib64/python37.zip', '/usr/lib64/python3.7', '/usr/lib64/python3.7/lib-dynload', '/home/ec2-user/.local/lib/python3.7/site-packages', '/usr/local/lib64/python3.7/site-packages', '/usr/local/lib/python3.7/site-packages', '/usr/lib64/python3.7/site-packages', '/usr/lib/python3.7/site-packages'] Server time: Tue, 20 Jul 2021 19:55:29 -0600 Error during template rendering In template /home/ec2-user/environment/cons_mgmt/cons_mgmt/templates/base.html, error at line 6 'Project' object is not iterable I am able to see data … -
Django Invalid Filter
I'm getting the following error message from my API request: { "errors": [ { "detail": "invalid filter[branch]", "status": "400", "source": { "pointer": "/data" }, "code": "invalid" } ] } I'm struggling with this since is have other ViewSets which follow the same structure but won't break once I try to filter by an FK. Below is the endpoint I'm hitting: http://localhost:8000/templates/?page[number]=1&filter[branch]=7KzZ5vLWlydlNbG&filter[name]=Client%20Portal%20Invitation For context I have a backend using Django DRF JsonAPI. It is structured as follow: Model: class Template(BaseModel): id = HashidUnsignedAutoField(db_column="template_id", primary_key=True, salt="Template", min_length=11) branch = ForeignKey(to="Branch", on_delete=DO_NOTHING) name = CharField(max_length=128) class Meta(BaseModel.Meta): db_table = "Templates" managed = False Serializer: class TemplateSerializer(BaseSerializer): included_serializers = { "branch": "app.serializers.BranchSerializer", } class Meta(BaseSerializer.Meta): model = Template ViewSet: class TemplateViewSet(BaseViewSet): queryset = Template.objects.all() serializer_class = TemplateSerializer filterset = TemplateFilterSet Filterset: class TemplateFilterSet(BaseFilterSet): class Meta: model = Template fields = { "branch": ["exact", "in"], "name": ["exact"], } Any hints on why would I be getting this error message would be greatly appreciated. -
redirect errot - NoReverseMatch: Reverse for 'edit' with keyword arguments '{'title': 'Python'}' not found
I'm working on an app that allows the user to create, show and edit an entry. right now i'm working on the editing function. what i'm trying to do is have an edit button (that's actually a form that sends data via hidden inputs) that sends the title of the entry to a view called trans whose sole purpose is redirect to the edit view, the reason i did this is so that when i'm working on the edit view, i can simplify the process where if the request method is GET it shows the page with the form where the user can edit the entry and if it's post the edit view can receive the changes and save them without worrying about the redirecting from the entry's page. The problem lies in the fact that everytime i click the edit button i get the error: NoReverseMatch at /wiki/trans Reverse for 'edit' with keyword arguments '{'title': 'Python'}' not found. I have checked over and over for any misspellings or issues in urls.py or any problems with the naming but i just can't find the bug. and it's frustrating because i thought that this would be the easiest part of the … -
Django parsing values of fields in models - Extracting pk
I'm completely lost on part of my Django website. I finally figured out a way to have the same model create a template and then use that template and create another post. This works and is ideal. Now I need to put them in different locations on the screen so I basically need two for-loops and a way to decipher the two(templates and posts off of templates) apart from each other. The model has a title and a content field. When a template is created the title always starts with "Temp: ". I'm completely lost on this because I need to parse through the model and not just use an HTML parser because the content won't already be on the page and there is more than just the title that needs to be moved. I need a way I think in the views.py file to get the pk of ALL titles that start with "Temp: " and the content field tied with it and return it in a variable to the HTML file. I have been working on this for 3 days now and I just really need help. -
NOT NULL constraint failed: KNB_balance.user_id Django
I'm trying to update a value that's stored in the database from views.py, I can't get form.save() to work I keep getting this error, I don't understand what's the problem and if Im going about this all wrong can you explain to me how I can update the value in the database by using user's input in views. Views.py def deposit(request): form = DepositForm(request.POST or None) pk = request.session.get('pk') if pk: user = CustomUser.objects.get(pk=pk) balance = user.balance code_user = f"{user.username}: {user.balance}" if not request.POST: balance.save() print(balance.number) if request.method == "POST": if form.is_valid(): print(balance.number) balance.number = balance.number + 5 print(balance.number) form.save() return redirect('home-view') return render(request, 'deposit.html') Models.py class Balance(models.Model): number = models.IntegerField(blank=True, null=True) user = models.OneToOneField(CustomUser, on_delete=models.CASCADE) def __int__(self): return int(self.number) def save(self, *args, **kwargs): number_int = 500 self.number = number_int super().save(*args, **kwargs) forms.py class DepositForm(forms.ModelForm): number = forms.IntegerField(label='balance',help_text='Please enter your deposit amount') class Meta: model = Balance fields = ('number',) HTML FIle {% load crispy_forms_tags %} {% load static %} {% block content %} <form method="POST" action="#"> {% csrf_token %} {{ form }} <input id="number" type="number" name="number" placeholder="Deposit amount"> <button type="submit" class="hero-btn sbmt">Deposit</button> </form> </div> {% endblock %} -
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443)
I have a Python 3.7 Django project, and I am trying to generate a PDF using ReportLab and WeasyPrint. I ran into an issue while installing WeasyPrint, and since attempting to install it I have received the same error message while trying to install any pip install in new virtual environments. This issue has persisted for two weeks now, please help! Versions and Pip List, all of these were installed during the same day without issue, reportlab was installed without error seconds before I attempted to install WeasyPrint. image-1 These are the versions and the current pip list.. everything else installed normally up to this point without issues. The Project also runs without error, with the exception of needing to build out this aspect. Here is the error that happened when running the pip install WeasyPrint. image-2 I also attempted to switch gears and use other solutions but now every pip install I run, even in new environments returns this error. I'm guessing it's an actual permissions issue on my computer? And I have no idea what that means and where to start trouble shooting that if that's my issue. -
Django - how to display related many-to-many field in choice field?
I’m building a web app using Django for my music collection. For each album, there are multiple songs, and each song has one or more composers. Here’s the song model: class Song(models.Model): title = models.CharField(max_length=50) composer = models.ManyToManyField(Artist) class Meta: ordering = ['title'] def __str__ (self): return self.title The Artist model contains firstname and lastname fields. There are a number of occurrences of songs with the same title, and the only way to distinguish between them is by the composer. Currently, when songs are loaded into a choice field, only the title appears, using def__str. I’ve tried to include the composers, but haven’t found a way to make it work. Any suggestiions? -
python dictionary value is getting printed on a line but not getting printed on another line in django
I am new to django and using python version 3.8 In my index.html, I am trying to display the products and their info using for loop as below: {% for prod in products %} <footer class="card-footer"> <span id="atc_prod_{{ prod.product_id }}" class="atc_prod">prod_{{ prod.product_id }} <button class="button is-info is-small card-footer-item cart" id="prod_{{ prod.product_id }}">Add to Cart</button> </span> <a href="/shop/products/{{ prod.product_id }}"><button class="button is-small is-info card-footer-item cart" id="qv{{ prod.product_id }}">Quick View</button></a> </footer> {% endfor %} Structure of products list is as below: products = [ {'id':'1', 'name':'A'}, {'id':'2', 'name':'B'}, {'id':'3', 'name':'C'} ] Same prod.product_id is getting used in 3 places (span - id, button - id and a - href) but for few products (2 out of 5), id is blank. Refer screenshot below of HTML: I do not know the reason, please suggest. Also, please let me know if I missed any of the important info. Thanks in advance. -
I have problem Page not found (404) Django
import jobs.views urlpatterns = [ path('admin/', admin.site.urls), path('nick', jobs.views.nick, name='nick'), ] enter code here def nick(request): return render(request, 'jobs/nick.html') I got: Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/nick/ -
Bootstrap 5 card footer not staying at the end of the page
I am still new to creating websites with Bootstrap and have come across an issue with adding a footer to my base.html template in Django. What I want is that the footer stays at the end of page and shows when I scroll to the end of that page. Here is my base.html code: {% load static %} <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>Vlereso Profesorin</title> <!-- Bootstrap --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <!-- Bootstrap JS --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> <!-- Google Font --> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap" rel="stylesheet"> <!-- Custom CSS --> <link rel="stylesheet" href="{% static 'vleresoprofesorin/css/master2.css' %}"> <link rel="stylesheet" href="{% static 'css/master.css' %}"> </head> <body> <nav class="navbar navbar-expand-lg navbar-light bg-light mynav"> <div class="container-fluid"> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav leftnav"> <li class="nav-item"> <a class="navbar-brand" href="{% url 'home' %}">Kreu</a> </li> <li class="nav-item dropdown"> <a class="navbar-brand dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Universitetet</a> <ul class="dropdown-menu" aria-labelledby="navbarDropdown"> <li><a class="dropdown-item" href="#">Universiteti i Tiranës</a></li> <li><a class="dropdown-item" href="#">Universiteti Politeknik i Tiranës</a></li> <li><a class="dropdown-item" href="#">Universiteti i Mjekësisë, Tiranë</a></li> <li><a class="dropdown-item" href="#">Universiteti i Sporteve të Tiranës</a></li> <li><a class="dropdown-item" href="#">Universiteti i Arteve Universitet</a></li> <li><a class="dropdown-item" href="#">Universiteti Bujqësor i Tiranës</a></li> … -
TypeError in heruko django
i wanna develop a Django project in Heroku but I have error. I Have Did everything that it Needs but still this Error Template error: In template /app/templates/base/Main_Layout.html, error at line 0 serve() missing 1 required positional argument: 'path' 1 : <!DOCTYPE html> 2 : <html lang="en"> 3 : {% load render_partial %} 4 : <head> 5 : {% include 'base/header_reffrences.html' %} 6 : <title> 7 : {% block title %} 8 : {% endblock %} 9 : </title> 10 : </head> Traceback (most recent call last): File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/base.py", line 204, in _get_response response = response.render() File "/app/.heroku/python/lib/python3.9/site-packages/django/template/response.py", line 105, in render self.content = self.rendered_content File "/app/.heroku/python/lib/python3.9/site-packages/django/template/response.py", line 83, in rendered_content return template.render(context, self._request) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py", line 170, in render return self._render(context) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/app/.heroku/python/lib/python3.9/site-packages/django/template/loader_tags.py", line … -
I am using filtering in django and it doesn't work
I am using filtering in Django and it is appearing on my website but doesn't do anything, and some of my fields I can't access to filter. def Books(request): Books = Book.objects.all() myFilter = BookFilter(request.GET, queryset=Books) Books = myFilter.qs context = {'pro':Book.objects.all(), 'myFilter':myFilter} return render(request, 'pages/Books.html', context) books.models class Book(models.Model): name = models.CharField(max_length=50) ISBN = models.IntegerField(max_length=20) image = models.ImageField(upload_to = 'photos/%y/%m/%d') stat = models.BooleanField(default=True) pubYear = models.IntegerField(max_length=4) author = models.CharField(max_length=50) categ = models.CharField(max_length=50) the fields (stat,pubYear) shows in the filter on the website but they are unwritable. -
Django -- Converting function views to class based views for TMDB API request
I'm using function views to generate render an output using the tmdb api I'm familiar with the basics on class based views. How would I write the following api request code into a TemplateView? Example output Views.py from django.shortcuts import render import requests # Create your views here. def index(request): # Query API with user input if 'movie' in request.GET: api_key = 'api' id = request.GET['movie'] url = 'https://api.themoviedb.org/3/search/movie?api_key={}&language=en-US&query={}&include_adult=false' response = requests.get(url.format(api_key,id)) # successful request if response.status_code == 200: # Parse json output for key value pairs tmdb = response.json() # backdrop image -- tmdb for each movie backdrop_path = tmdb['results'][0]['backdrop_path'] url_backdrop = 'https://image.tmdb.org/t/p/original'+backdrop_path # poster image -- tmdb for each movie poster_path = tmdb['results'][0]['poster_path'] url_poster = 'https://image.tmdb.org/t/p/original'+poster_path context = { 'title': tmdb['results'][0]['original_title'], 'overview': tmdb['results'][0]['overview'], 'release_date': tmdb['results'][0]['release_date'], 'vote_average': tmdb['results'][0]['vote_average'], 'vote_count': tmdb['results'][0]['vote_count'], 'backdrop_path' : tmdb['results'][0]['backdrop_path'], 'backdrop' : url_backdrop, 'poster' : url_poster } return render(request, 'home.html', {'context': context}) else: # returns homepage if invalid name is given in form return render(request, 'home.html') else: # Homepage without GET request return render(request, 'home.html') -
I want to use Django with Asp.net only database
I want to create a Django project where I can apply my machine learning and later want to sync it with Asp.net project which is already created, the only thing that I am interested in is the Database, and to be more specific only with a single table. Basically, I want to enter some data in my machine learning algo which on basis of that will return a specific value, and on basis of that value, I want to fetch certain records from the database. Can anyone guide me that is it possible? If yes then how. -
how do I run a function in django-admin?
I'm programming a project, and i need a way to run a function every time i access django admin. this function change some things in the DB, and if you know an easy way for it, i'll be happy. a thing like a function that run every time the database changes. thanks -
Celery/Django/Redis task getting executed multiple times
In my current project, what I need to do is to get data from 700+ endpoints and then send that data to another 700+ endpoints. My approach is to use Django Celery Redis, Put 70+ endpoints on each worker so that there are approx 10 workers which will retrieve the data and then post the data. For this, I am using Chord to do the parallel task and then calculate the time it takes. The problem is that Celery is running the same task multiple times. task_get_data is the main method that first gets the list of websites then splits it into groups of 70 each and then calls task_post_data using Chord. In the output below you can see website_A, website_B etc. multiple times, I have manually checked my data and everything and there is no repetition of websites but when the celery task is submitted, multiple entries are created. Also, Is there any way to monitor the number of workers and what are they processing? Below is the code os.environ.setdefault('DJANGO_SETTINGS_MODULE','django_backend.settings') app = Celery('django_backend', backend='redis://localhost:6379', broker='redis://localhost:6379') app.config_from_object('django.conf:settings', namespace='CELERY') # app.config_from_object('django.conf:settings') app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) @app.task(bind=True) def debug_task(self): print('Request: {0!r}'.format(self.request)) def post_data(json_obj, website): for items in json_obj: md = md + items['data'] n … -
How to write a real self-contained Django app?
They say Django apps should be self-contained. I find it hard to implement. My website has 3 apps. All have their own static and templates folders. But — like many other sites — they share same front-end design. The problem is, I have a very small form at the footer of each page to sign up for my newsletter. First, I have to define the database model in one of apps, which means the other two rely on that one. Second, the view to update the database should be defined in an app — naturally, the same app that defines the model — which again means the other two have to call that view. So, app1 provides the model and view, app2 and app3 use them; so they are not self-contained. Isn't this against the philosophy?