First Answer:
First I wan to mention these two things
- It doesn't matters how many projects are there in your virtual
environment each can be handled by different different
manage.py
.
- And each project runs on different addresses if you do but single
app won't run on different addresses (until you do it manually).
As you mentioned here you had created another app inside same project like this
Project
-- manage.py
-- Project
-- -- settings.py
-- -- urls.py <<--- Main url pattern file for whole project
-- -- wsgi.py
-- App1
-- -- views.py
-- -- models.py
-- -- urls.py <<-- Another specific urls pattern file for App1 (optional)
-- -- others
-- App2
-- -- views.py
-- -- models.py
-- -- urls.py <<-- Another specific urls pattern file for App2 (optional)
-- -- others
So if you register urlpatterns for every particular apps like
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^home/$',views.home, name = "app_home"),
]
and
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^home/$',views.home, name = "app_home"),
]
then you have to include both of these urls.py
files in projects main urls.py
like this
from django.conf.urls import url, include
urlpatterns = [
url(r'^app1/', include('app1.urls')),
url(r'^app2/', include('app2.urls')),
]
or if you don't wanna go like this
you can register both url patterns
in main urls.py
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^app1/home', App1.views.home),
url(r'^app2/home', App2.views.home),
]
So, that is it, you just have to deal with urls.py
files.
Second Answer:
You can create multiple projects in single Virtual Environment. But configurations like packages and their versions stays same for all. If you make changes there (by upgrading, degrading, installing or uninstalling) then it will affect all projects inside that Virtual Env.