Questions tagged [django-apps]

Django apps are reusable collections of django code that use the ORM layer. They may provide a single model class, or they may implement a full web application, or provide any mixture of such functionality.

Django apps are reusable collections of django code that use the ORM layer. They may provide a single model class, or they may implement a full web application, or provide any mixture of such functionality.

421 questions
6
votes
3 answers

How to divide a django project into applications

I want to know how to divide a project having a hierarchical structure into applications. Let's say that I'm trying to build something like github.com. In github.com, an account has some repositories, which have some features like code, issues, or…
user9486747
6
votes
1 answer

Django 1.8: How do I use my first 3rd Party Fork with my current project?

I'm still very new to development... I would like to simplify django-friendship and add some different functionality. I've forked it on GitHub. I'm not sure what to do next. Where should the local copy of my django-friendship repo go? Should I…
StringsOnFire
  • 2,726
  • 5
  • 28
  • 50
5
votes
3 answers

Multiple Instances of a django app, does django support this

I have written a simple feedback application in django. It's not particulairly complex, basically it allows authenticated users to write a shot message with a subject line and submit that message via a form. I then allows who are in a selected group…
john-charles
  • 1,417
  • 4
  • 17
  • 30
5
votes
1 answer

Where to up django app startup code that must interact with the database?

I have some django code that needs to run once when my app is loaded in the dev server or as a wsgi worker. This code also needs to write to the database. In my particular case I do not need the code to run for many management commands like…
mightyroser
  • 780
  • 6
  • 10
5
votes
3 answers

AttributeError: module 'profile' has no attribute 'run'

So I have an extended User model (extended AbstractUser) called Profile. This was in a seperate app called "profiles". I was plugging in the standard login and realised it was looking for a "profile" app name as standard, so I renamed it…
michjnich
  • 2,796
  • 3
  • 15
  • 31
5
votes
0 answers

Django app with other apps as dependencies

Imagine you create a reusable django app 'A' which depends on another reusable django app 'B'. Now if I want to use an app 'A' I have to add not only 'A' but also 'B' in INSTALLED_APPS? How do I add only 'A' without explicitly adding 'B' too?
Laimonas Sutkus
  • 3,247
  • 2
  • 26
  • 47
5
votes
3 answers

Django tests fails when using a specific model in a migration file

I've manually created a data migration file for a specific Django 1.11 app: from __future__ import unicode_literals from django.db import migrations, models def set_item_things(apps, schema_editor): MyModel = apps.get_model('my_app',…
Leonardo
  • 4,046
  • 5
  • 44
  • 85
5
votes
1 answer

In Django is it okay to have models of two different apps dependent of each other?

I am working on a billing and accounting application from scratch in which I have created two different apps as: billing: this app stores all the billing related logic for example; subscription plans, products, coupons and similar stuff. accounts:…
akm
  • 830
  • 6
  • 20
5
votes
2 answers

Django apps sharing a model

I Django can 2 apps share 1 model, or 2 apps must define the same model inside. so app1 and app1 can have have same products model inside them for example?
css3newbie
  • 165
  • 1
  • 5
5
votes
4 answers

Django apps equivalent to Drupal's CCK and Views modules?

Are there any Django apps equivalent to Drupal's Views and CCK modules? I find Django much more flexible and logically organized than Drupal. But I think Drupal's Views and CCK modules are killer apps. They let the webmaster very rapidly to build…
Mert Nuhoglu
  • 9,695
  • 16
  • 79
  • 117
5
votes
4 answers

Adapt a view if an app is installed with Django

I have a web app with a project that works alone (it's index, login.. pages). I would need to change the index page if a new app is installed (e.g: add a link, a table in the template with my app models..). Have it dynamic. The removal of the app…
nlassaux
  • 2,335
  • 2
  • 21
  • 35
4
votes
3 answers

Django: extend overridden template

I have two applications in my settings.INSTALLED_APPS: INSTALLED_APPS = [ 'application2', 'application1' ] and want application2 to change a template from application1 (e.g. by adding a button). How can achieve this without overriding the…
Don
  • 16,928
  • 12
  • 63
  • 101
4
votes
2 answers

Django comments

I have a Django application with two models: the first one is django.contrib.auth.User and the second one is Product, created by me. For every product I would add the comments, so every User registered can insert a comment for every product. I've…
Fred Collins
  • 5,004
  • 14
  • 62
  • 111
4
votes
0 answers

AUTH_USER_MODEL as a sub-application of a custom auth app

I've got an auth application which is used instead of django's own auth app, called authentication. Typically projects will specify AUTH_USER_MODEL = 'authentication.User'. There are some other projects which utilise a separate authentication…
markwalker_
  • 12,078
  • 7
  • 62
  • 99
4
votes
3 answers

Django settings: How to access variables from the settings folder in an app

I have a Django project with the following structure: --|src --project --|settings --__init__.py --production.py --local.py --|app1 In my app I import the settings (from django.conf import settings) and then as I was following…
Micah Pearce
  • 1,805
  • 3
  • 28
  • 61