django-apps

Sharing models between Django apps

丶灬走出姿态 提交于 2019-11-29 02:51:41
I will be brief: to work in the spirit and idea of a Django app, it is ok for an app to import models from inside another app ? Say, a User statistics app will import models from a User app something like: from users.models import users If you're building an internal app that has no chance of ever being released to the public, sure, do whatever you want. If you're building an internal app that has little chance of ever being released to the public, but will possibly be used by future/current developers, sure, but be sure to document what the app needs to work properly. If you're building an

How to use django-notification to inform a user when somebody comments on their post

好久不见. 提交于 2019-11-28 19:43:08
I have been developing in django for sometime now, and have developed a neat website having functionality such as writing blogs, posting questions, sharing content etc. However there is still one thing that is missing and i.e. creating notification for users. What I want to do is to inform users in their profiles, whenever somebody comments on their posts, or if they are following a particular post and there is an update on it, then inform the user of that update. I have looked around many applications but I am still very confused about how to do it. In case of using django-notification I seem

django-object-permissions Vs django-guardian Vs django-authority

允我心安 提交于 2019-11-28 18:39:46
问题 I've found 3 row-level permission solutions for Django 1.2+ django-object-permissions django-guardian django-authority Could someone tell if there is any recommended more than the others, what are their main differences, etc.? 回答1: I'll start this by saying we use none of these for object level permission - we use our own custom method and I really wish we hadn't. If you can avoid object level permissions at all, do so, they are a pain to organise. This is how I evaluate the 3 apps you've

Is there a naming convention for Django apps

可紊 提交于 2019-11-28 17:20:53
Is there a preferred naming convention for creating a Django app consisting of more than one word? For instance, which of the following is preferred? my_django_app my-django-app Update: Not allowed syntactically mydjangoapp Recommended solution While all of them may be options 1 and 3 are syntactically allowed, is there a preference? Looking at the way Django creates the table names by combining the app name and the model name with an underscore, I'm leaning against option #1. Thoughts? They must be valid package names. That rules out 2 ("import my-django-app" would be a syntax error). PEP 8

Is there a naming convention for Django apps

余生长醉 提交于 2019-11-27 10:24:06
问题 Is there a preferred naming convention for creating a Django app consisting of more than one word? For instance, which of the following is preferred? my_django_app my-django-app Update: Not allowed syntactically mydjangoapp Recommended solution While all of them may be options 1 and 3 are syntactically allowed, is there a preference? Looking at the way Django creates the table names by combining the app name and the model name with an underscore, I'm leaning against option #1. Thoughts? 回答1:

dynamically loading django apps at runtime

老子叫甜甜 提交于 2019-11-27 01:02:59
问题 Is it possible to dynamically load django apps at runtime? Usually, apps are loaded at initialization, using the INSTALLED_APPS tuple in settings.py. However, is it possible to load additional apps at runtime? I am encountering this issue in different situations. One situation, for example, arises during testing, when I would like to dynamically load or unload apps. In order to make the problem more concrete, imagine I have a directory called apps where I put my apps and I would like to