Monday, October 27, 2014

Re: AUTH_USER_MODEL does not accept sub application

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJUTrBOAAoJEC0ft5FqUuEh4g0P/04mpTZanNAyks1RiaXiu410
RIAXe7444RTjSGH2CrX49WoBil2yD0bwnXcB+uQ5BkDQmK+da6WK6KMpKZpS20Yw
K0+PG/CVAJMEvp4tUYPYxJqTdP0mNNDTncUlU19uzfE9XpaeFLH2PX2i5+doDHyM
ttmxWjcniyl3oNO63TDo5DIG69YraDRYmeRs689AxGIblBgL8DvIqF+dk8sFEicC
dqLFDXZqmZpiIo6wZW6W1+R16lvaaf+Fn5+MCp75zLRTzg1amK004Zo+MYf+/QzR
ZwKVLi6QJo85RgqYDyIFdJXx/47nhujLXpcS02RkC8We6CZ4g1vtN26GTL785+Hr
sZfj8/TMnWPBEfTtu415SD72VvY1Dm8eZlNVkC/eccfMQdi2p1IRByg/bYN2s3p1
VENv6zCbed7VR25QOZRkrlH1QlNqNumW6yCFdii9abHqrDANjitBxHpcCc9HPFgT
8NgjpsvZWLKOEn1MZwgdfDawSPzEgPll8GuLzdtGgmfV23kDeKeK9SMqCjY4hP1j
1Rdt0Y+hVfvzpoEb3m/Gnuf+hECURDhvCd/XvejGv2vCDlmyu7Ag6ORUUR0d7vq9
/+gfYkjh0pjwln4o9gQRiR7xxbRYyDBghiIVIavZBIVnEPEsl5+wzeihWESccOb0
H9SkMHMI+ZFWkUMa1Kqk
=PAso
-----END PGP SIGNATURE-----
On 10/27/2014 10:01 AM, Scot Hacker wrote:
>
>
> On Monday, October 27, 2014 8:58:36 AM UTC-7, Scot Hacker wrote:
>
>
> add2virtualenv /path/to/custom/apps/directory
>
>
>
> And when its time to deploy, you'll need to do similar on the server,
> using an equivalent method in the wsgi definition, e.g.:
>
> import os, sys, site
>
> sys.path.append('/path/to/custom/apps/directory')

Please don't do this. There is no good reason to add complexity to the
sys.path required for your site to run. Everything is simpler if you
have a single "root path" for all Python code in your project, and make
all import paths relative to that single filesystem location (which
should generally be the location of `manage.py`).

If you don't want to have to import from "apps.users", then just get rid
of the "apps/" directory and move all the apps in there up one
filesystem level. Django apps aren't special, they're just Python
modules; they can be placed into a logical module hierarchy just like
any other module.

Carl

No comments:

Post a Comment