Now that you've created your first Django project, it's time to run it and see your web application in action. Follow these steps to run your Django project on the development server:
Before you begin, make sure you have Python and Django installed. If you haven't installed Django yet, you can do so using the following command:
pip install django
Open your terminal or command prompt and navigate to the directory where your Django project is located.
cd path/to/your/django/project
Execute the following command to start the Django development server:
python manage.py runserver
This command tells Django to launch the development server, and you should see output indicating that the server is running. By default, the server will be accessible at http://127.0.0.1:8000/ in your web browser.
Open your web browser and go to http://127.0.0.1:8000/. You should see the default Django welcome page, indicating that your project is up and running.
Django provides a powerful admin interface for managing your application's data. To access the admin interface, go to http://127.0.0.1:8000/admin/. If you created a superuser during the project setup, use those credentials to log in.
If you've created a Django app as part of your project, you can explore its functionality by navigating to the associated URL. For example, if you created an app named "myapp" and defined a view at the root URL, visit http://127.0.0.1:8000/myapp/ in your browser.
Now that your project is running, you can start making changes to your code. Observe how the development server automatically detects changes and refreshes the application. You don't need to restart the server every time you make a modification.
When you're done exploring your Django project, you can stop the development server. In the terminal where the server is running, press Ctrl+C. You'll be prompted to confirm the shutdown by entering Y.
Congratulations! You've successfully run your first Django project. From here, you can start building the actual functionality of your web application by defining models, creating views, and designing templates. Refer to the official Django documentation for in-depth guidance on Django development.
Happy coding!