Hi,
I created 2 Django project e.g. Project1 and Project2
-
Under Project1 created one app user profile and created user id and password for authentication .
-
After login displaying one welcome page and there are multiples icon like Project2, project3 and Project4 etc....
-
I want to run all project on same port like local-host:8080 and running successfully.
-
But once I clicked on Project2 so error showing like Using the URLconf defined in project1.urls, Django tried these URL patterns, in this order, ofcourse because same url getting in the project1 and redirecting to project1 instead of others project.
-
How to link project2,project3 and other projects to project1 .
-
How to authenticate means single singon.
Please help me.
There are at least two different ways of handling this situation - and your decision among them probably depends upon a number of different factors.
- The easy way - integrate these different “projects” as “apps” within the same project.
- If you really do absolutely need to run these as separate projects under different containers, then you can use any of the available single sign-on type applications such as OAuth, CAS, or, use Django’s REMOTE_USER behind some type of authentication app at the web service layer. However, keep in mind that you can generally only have one process listening on a port at one time. So it’s simply not possible to use something like uwsgi to run multiple applications on the same port.
Dear Sir,
Thanks for the details I will trying to do like your suggestions.
One question point no.1 project2 add as a apps in project1 how to do . how add app under projects that parts I know but how to add project2 as a app under project1 please provide the steps.
You won’t be adding project2 under project1. You’ll be taking the apps you need from project2 and adding those apps to project1.
example:
If your directory layout is something like this:
- django_projects
- project1
- app1
- settings.py
- urls.py
- wsgi.py
- app2
- app3
- project2
Then, what you’d want to do is have:
- django_projects
- project1
- app1
- settings.py
- urls.py
- wsgi.py
- app2
- app3
- app4
- (note that the files listed in app4 above have been removed because they’ve been integrated with app1)
- app5
so that you’ve integrated the functionality of project2 within project1.
For single sign on, check Django-auth-ADFS on PyPi.