Hi,
Your requirements are a bit contradicting.
While you want to use same app with identical settings twice to
different domain, you also want to have different urls?
How these urls should be different compared to that other site?
--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0da53e34-428d-4803-ba8f-dddc83c24443%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Jani Tiainen
Ok,
There are several ways how to tackle with this (you can do most of that with webserver configs). Just limit access from proper IP's (if your VPN is setup decently it will give your end users certain IP-range(s) which you can use to filter admin-access) same for "local network" app.To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/457fa003-6515-40d3-a661-a402cf45b5db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Jani Tiainen
On Friday 26 May 2017 04:22:49 marcin....@gmail.com wrote:
> I think that my reqs are pretty straightforward.
> I'd like to setup project environment with 3 different apps:
>
> 1. main app (public)
> 2. admin app (vpn)
> 3. local network app for api talking with other services in the
> datacenter
>
> The whole thing is about preserving same project environment.
> Models, registries, configuration should stay same.
> Middlewares, urls, views and anything related to http will be
> different.
Use Mezzanine's approach (modified a bit by me) in settings.py near bottom:
PROJECT_APP_PATH = os.path.dirname(os.path.abspath(__file__))
PROJECT_APP = os.path.basename(PROJECT_APP_PATH)
local_module = os.getenv("LOCAL_SETTINGS_MODULE", "local_settings.py")
f = os.path.join(PROJECT_APP_PATH, local_module)
if os.path.exists(f):
import sys
import imp
module_name = "{}.{}".format(PROJECT_APP, local_module[0:-3])
module = imp.new_module(module_name)
module.__file__ = f
sys.modules[module_name] = module
exec(open(f, "rb").read())
else:
print("WARNING: no such local module: {}: File does not exist".format(f))
Now your repo can have public_settings.py, admin_settings.py etc, and use env in uwsgi configuration to select the correct one. The main settings.py contains shared settings. All the rest in the local variants.
--
Melvyn Sopacua