I am deploying Django app. I am trying to run python then It is giving me error.

When I am running http://My_IP:8000 then it is working perfectly but when I am trying to run python runserver then it is showing me an error. I am new to deployment, I am working to solve this thing from last 3 days. Once I would run my domain then how I would run it forever ever if I would close my terminal. I have tried to create the Apache server but when I am not able to do it. Will someone please correct me and help me?

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Without knowing what the error message you’re a seeing, it’s hard to know the exact problem you’re experiencing. The first thing I would check is that your domain is included in the ALLOWED_HOSTS section of your project’s file. You’ll likely want it to look like:

ALLOWED_HOSTS = [ '', 'your.ip.address', 'localhost', '']

See the Django docs for more information.

When you’re ready to set up your project in a more production-like environment (and not have to run it from the terminal directly), take a look at this tutorial. It should point you in the right direction.