15👍
I just added the ip in ALLOWED_HOSTS
property in the file <your_app_path>/settings.py
.
e.g.
...
ALLOWED_HOSTS = ['0.0.0.0']
...
And it worked fine.
5👍
Take a look at settings.py and fill the ALLOWED_HOSTS as follows.
For local host:
ALLOWED_HOSTS = ["0.0.0.0"]
OR you can do
ALLOWED_HOSTS = ["*"]
3👍
in settings.py,
change
ALLOWED_HOSTS = ['*']
this work for me,
*
represent the all the ports can have access to the site
- Import RelatedManager from django.db.models.fields.related
- Django: datetime filter by date ignoring time
1👍
ALLOWED_HOSTS = os.environ.get('DJANGO_ALLOWED_HOSTS', '*').split()
I’m just added split()
because without split()
it just localhost 127.0.0.1 0.0.0.0 [::1]
for django need the list
.
- Adding link to django admin page
- Serializer validate function is not called DRF
- How to check that an uploaded file is a valid Image in Django
0👍
You have to find your device ip address from where you are running the django app.
How to find the local ip address
To use django on local network
Run command
python manage.py runserver 0.0.0.0:8000
To run on other device connected to same local network you have to type ip address of your server device from where you are running django app.
192.168.1.1:8000/ # this is just dummy example.
Its should work as far both devices are connected to same network. And firewall is allowed.
- Timeout when uploading a large file?
- Celery: clean way of revoking the entire chain from within a task
- How to calculate average in Django?
- Validating upload file type in Django
0👍
If you are using Docker you’ll have to rebuild your container.
Considering you have already added your host on your config file (ALLOWED_HOSTS = ['0.0.0.0']
), you just have to run:
docker-compose down
docker-compose build
docker-compose up
- How to deploy a subdirectory of git repo to elastic beanstalk
- How to make UUID field default when there's already ID field