Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abe312/testing-subdomains
testing the subdomains library to see whether it works with django3/2/1.11LTS
https://github.com/abe312/testing-subdomains
Last synced: about 1 month ago
JSON representation
testing the subdomains library to see whether it works with django3/2/1.11LTS
- Host: GitHub
- URL: https://github.com/abe312/testing-subdomains
- Owner: abe312
- Created: 2020-01-07T18:06:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-22T18:21:32.000Z (over 3 years ago)
- Last Synced: 2024-10-30T17:53:30.391Z (about 2 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
This project is made to test out [subdomains](https://github.com/abe312/django-subdomains) library
```
/etc/hosts127.0.0.1 api.example.com
127.0.0.1 www.example.com
127.0.0.1 example.com
```#### example.com:8000 displays hello world!
#### api.example.com:8000 displays API
#### www.example.com:8000 displays FRONTEND
> tested on django1.11.27, django2.2.9 and django3.0.2
##### for using a different url domain name other than 'example.com':
./manage.py shell
```
>>> from django.contrib.sites.models import Site
>>> one = Site.objects.all()[0]
>>> one.domain = 'myveryspecialdomain.com'
>>> one.name = 'My Special Site Name'
>>> one.save()
```##### Then set SITE_ID in settings.py accordingly
credit: [stackoverflow](https://stackoverflow.com/questions/12289148/where-do-i-set-the-domain-for-my-django-sites-framework-site-when-i-only-have-o/12289245#12289245)