By Aditya Kumar
i run this code i terminal
$ python3 manage.py runserver ‘my ip address:8000’
and the result is
Traceback (most recent call last): File “manage.py”, line 22, in <module> execute_from_command_line(sys.argv) File “/usr/local/lib/python3.5/dist-packages/django/core/management/init.py”, line 364, in execute_from_command_line utility.execute() File “/usr/local/lib/python3.5/dist-packages/django/core/management/init.py”, line 308, in execute settings.INSTALLED_APPS File “/usr/local/lib/python3.5/dist-packages/django/conf/init.py”, line 56, in getattr self._setup(name) File “/usr/local/lib/python3.5/dist-packages/django/conf/init.py”, line 41, in _setup self._wrapped = Settings(settings_module) File “/usr/local/lib/python3.5/dist-packages/django/conf/init.py”, line 110, in init mod = importlib.import_module(self.SETTINGS_MODULE) File “/usr/lib/python3.5/importlib/init.py”, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 986, in _gcd_import File “<frozen importlib._bootstrap>”, line 969, in _find_and_load File “<frozen importlib._bootstrap>”, line 958, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 673, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 669, in exec_module File “<frozen importlib._bootstrap_external>”, line 775, in get_code File “<frozen importlib._bootstrap_external>”, line 735, in source_to_code File “<frozen importlib._bootstrap>”, line 222, in _call_with_frames_removed File “/home/aditya/test_django_app/testsite/testsite/settings.py”, line 28 ALLOWED_HOSTS = [my ip address] ^ SyntaxError: invalid syntax
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Put ALLOWED_HOSTS = '*' and then run your command line like python3 manage.py runserver 0.0.0.0:8000 if you’re running in the same machine.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.