Last updated on May 29th, 2023 at 10:04 pm3 minutes read
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. It lets developers use the same language they know to build the entire stack of their applications. This tutorial will walk you through the process of setting up a Django server in PyCharm Community Edition.
2, Go to your project directory and delete the ‘main.py’.
django-admin startproject mysite
4. Back to your Project directory, moved ‘manage.py’ to root directory. Move all the files files from mysite directory to upper level directory. Delete the empty mysite directory.
Project directory can be found in C:\Users\<Your PC Username>\PycharmProjects
Django project is now ready . You can now start creating an app.
5, Create a Django App by typing in terminal:
django-admin startapp polls
Replace ‘polls’ with your app name.
Note: Community Edition doesn’t handle manage.py. So, we need to do some configuration on next steps.
6, On PyCharm, click ‘Run’ on menu then click ‘Edit Configuration’. Delete ‘main’ and click ‘+’ sign. Add new ‘Python’
Enter ‘Django’ name. In ‘Script path’, select ‘manage.py’. Enter ‘runserver’ in Parameters. Click ‘Apply’ and ‘OK’.
7, Now everything is all setup, lastly, click the ‘Play’ button next to Django to start the Django server.
8, With the Ctrl key down, click the http://127.0.0.1:8000/ to open the localhost on the browser.
Congratulations! Django server is now up and you can now start coding.