Hello Friends how are you, Today in this post i am going to teach you how you can create your first Django project in Pycharm and how you can run it live on server.
Now I am going to explain everything step by step.
If you want to understand this through video then watch this video i have explained it step by step live
Step 1: Install Pycharm: To install Pycharm into your system first click here , When you visit this link you will get official webpage for downloading Pycharm. On that page there are two download button (blue and black) in which blue download button is for professional version and black download button is for Community version. You have to download Professional Version because in community version there is no facility to create Django project. Just download from there and install it.
Step 2: Create Django Project: After installation of Pycharm open it and click on create new project and then you will get a screen like below.
Here in the above screenshot first step is to select Django then the second step is to Select directory in which you want to create your project and after the directory name for your project for example in my case my project name is WebsiteInDjango and the directory is H. After typing project name click on create button and wait for sometime it will take to create your project in the system. After successful creation of project you will get a screen like below
Step 3:Run Project: To run the django project click on terminal button which is in left bottom of screen
When you click on this Terminal button you will get a console area like below
Here in the above console area you have to type python manage.py runserver like below
When you will press enter after typing this command you will get output like below screenshot
Now in the above screenshot you have to click on the obtained URL and you will get output screen like below
Now its done successfully. It is the default home screen for Django website.
Step 4:Customize Home Screen: To customize this default home screen, right click on project name and select new and then click on Python file
When you will click on Python File then you will get a text box and in this textbox type views and press enter
Now open this views python file and type the following code
After this now open urls.py and add two lines into it , If you have any doubt then you can watch the above video i have explained everything live.
Now again run your project and at this time you will get output screen like below
I hope now you can create "Django project in Pycharm". If you have any doubt regarding this post or you want something more in this post then let me know by comment below i will work on it definitely.
0 Comments