Skip to content

Instantly share code, notes, and snippets.

@vsobotka
Last active November 5, 2020 23:22
Show Gist options
  • Save vsobotka/4ae1ab5302e2b4b8fd93291ce18e3642 to your computer and use it in GitHub Desktop.
Save vsobotka/4ae1ab5302e2b4b8fd93291ce18e3642 to your computer and use it in GitHub Desktop.
Run your app in Xcode against the dev build - iOS, Python + Django, Create React App (CRA)
# Add your machine IP as allowed for Python server as well as for CRA (Create React App).
# You than have to start the server with this IP like:
# python manage.py runserver 192.168.0.168:8000
ALLOWED_HOSTS = [
'192.168.0.168'
]
# CRA_HOST and CRA_PORT are from the 'cra_helper' app installed in the project as well.
# Tells the base.html where to load the scripts from.
CRA_HOST = '192.168.0.168'
# CRA_PORT = '8000' (default)
@vsobotka
Copy link
Author

vsobotka commented Nov 5, 2020

I have not been able to make this work using localhost. The Xcode seems to refuse to connect to it, but I was not able to debug that case at all. If you know how to make it work, please let me know.

Also using the machine IP makes it possible to use a real device for testing instead of using only the simulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment