Django Integrate custom apps with each other

18 views
Skip to first unread message

Eduardo Pascoal

unread,
Mar 26, 2015, 6:50:10 AM3/26/15
to django...@googlegroups.com, Inês Falcão
Hi everyone,
I am a Django newbie and I'm facing the problem related with binding applications.

My intention is to make a new functionality to manage comments (i don't want to use disqus) and for that reason i want to create an application and integrate with another one that i've created in first place.

What is the best way to do that? How can i bind them?

It is simply like when i use django contrib auth model?
 
from django.db import models
from django.contrib.auth.models import User

class Group(models.Model):
    groupName
=  models.CharField(max_length=200)
    users
= models.ManyToManyField(User, through='GroupWatcher')
   
def __unicode__(self):
       
return self.groupName




something like this...

from django.db import models
from app2.models import MyApp2Model

class Group(models.Model):
    groupName
=  models.CharField(max_length=200)
    users
= models.ManyToManyField(MyApp2Model, through='GroupWatcher')
   
def __unicode__(self):
       
return self.groupName

aRkadeFR

unread,
Mar 26, 2015, 7:23:18 AM3/26/15
to django...@googlegroups.com
Hello,

Everything is an application in Django, and you can see them
in settings.INSTALLED_APPS.

Then you can include your app models/forms/etc. from
anywhere else in the project containing the previous app.

To check if the app is registrered or not, you can use the
Django Application (new in Django 1.7). Please read
https://docs.djangoproject.com/en/1.7/ref/applications/

From your example, you can have an app called "comment"
that inside has some models and can be related to anything
else, or the reverse any of your model in your project related
to some model from the comment app.

For more information, please check out the "comments" app
in django.contrib :)

Thanks

aRkadeFR
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ca41151f-bc0f-412e-bf85-780916f90cf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages