Host Django apps on multiple subdomains. This repository is just a boilerplate to get started with Django hosts.
- Clone repo
git clone https://github.com/MexsonFernandes/django-mulitple-hosts-subdomain
. - Go to directory
cd django-mulitple-hosts-subdomain
. - Install environment using Pipenv
pipenv shell
. Usepip3 install pipenv
if not installed. - Install all requirements using
pipenv install
orpip3 install -r requirements.txt
. - Run app using
python manage.py runserver
.
- open default app at http://www.localhost:8000
- open admin at http://admin.localhost:8000
- open installed app at http://app2.localhost:8000
- Add new app using
django-admin startapp newapp
. - Register app in settings.py under MY_APP.
- Create urls.py file with initial route.
- Add it as host in 'django_subdomains_project/hosts.py'.
- Go to 'django_subdomains_project/settings.py' and change app name in DEFAULT_HOST variable.
Thanks for checking out my repo. Explore my profile at Linkedin.