This will be help to create Django first App in pythonanywhere which is very useful for beginners.
What is mean of app in Django?
It is a web application to use python package that is specifically intended for use in a Django projects.
Process of create Django first app
Here you will learn deploy the Django app with step by step.
I hope you have a already setup Django project if not please click to setup django project
You can see below screen after login pythonanywhere website.
Step : 1
Click on Files Tab
You can see the main directory of pythonanywhere and you can check the list of Django project name.
Step : 2
Here you need to click on project name mysite and it is a directory of project where you can upload the Django project in pythonanywhere.
Also there are two highlighted column first is directory where you can create the multiple Django Apps name and Second is files where you can create the files and write the code.
Step : 3
Now create the Django App directory where you can keep the all Django files.
Here I am creating myapp directory for Django app and you will redirect to new page ,you can see in below screenshot.
Step : 4
Now you have reached inside of myapp directory. Files and Directory will be empty so now you have to create views.py and urls.py
I am creating both the files views.py and urls.py .
Step : 5
Now all the directory and files has been completed and Now need to write the code for showing content in webpage
I will show content name like Welcome to my first Django APP on web page.
Steps of write code in Django Files
Welcome to my first Django APP
How you can add url in mysite/urls.py
After the click on mysite directory you will see the multiple files so now you have you click on urls.py and write the one more url.
Now your work has been completed and it's time to reload a web page. click on the Web Tab and click on Reload button for showing data in webpage.
Now click on the Domain name for showing you web page and content.
Hope you like it , please comment if you have any doubt .
Setup django project in pythonanywhere
How to upload file in S3 bucket in python
Free live cricket score API for python
0 Comments