Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Build website
#1
Is it possible to build a website with only python or do I have to know Java, html or C++ to go along with it ?
Reply
#2
You'll need HTML, CSS and JavaScript to make usable, static web pages. If you need to do more interesting things (like having people search for things stored in a database or something), then you'll need a backend and yes, that can be written in Python - there are several web frameworks for this: Django, Flask, Bottle are some of them.
Reply
#3
As mention by ndc85430 you need a frame-work,the two big one are Flask and Django.
Both come with build in development web-server,so can build and test all local.
Search web there are lot of tutorials,and of course some html,css,JavaScripts basic knowledge is good to have as it used in all web-development.
Have some tutorial Weather app,some year ago since i made it,tested it now still work just get free key from OpenWeather API.
Reply
#4
I attempted to download django but I'm having issues finding were to download it. Also it's recommended to use pip with django but the website to download these tools are not as simple as downloading python
Reply
#5
Are you on Windows?
Is so look at this Python 3.8 (3.6-3.7) and pip installation under Windows.
(Nov-03-2020, 07:50 PM)tdwinfre Wrote: I attempted to download django but I'm having issues finding were to download it.
pip is doing all this automatics,you shall only do pip install django.
Example:
# Test python
C:\code>python -V
Python 3.8.3

# Test pip,show version it will install to
C:\code>pip -V
pip 20.2.3 from c:\python38\lib\site-packages\pip (python 3.8)

C:\code>pip install django --upgrade
Collecting django
  Downloading Django-3.1.3-py3-none-any.whl (7.8 MB)
     |████████████████████████████████| 7.8 MB 656 kB/s
Collecting asgiref<4,>=3.2.10
  Downloading asgiref-3.3.0-py3-none-any.whl (19 kB)
Requirement already satisfied, skipping upgrade: pytz in c:\python38\lib\site-pa
ckages (from django) (2020.1)
Collecting sqlparse>=0.2.2
  Downloading sqlparse-0.4.1-py3-none-any.whl (42 kB)
     |████████████████████████████████| 42 kB 353 kB/s
Installing collected packages: asgiref, sqlparse, django
Successfully installed asgiref-3.3.0 django-3.1.3 sqlparse-0.4.1

# Test that it works
C:\code>python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>>
>>> django.__version__
'3.1.3'
>>> exit()  
Often in tutorial about web-development will use virtual environment,this is also build into Python trough venv.
Reply
#6
No I'm on mac and whenever I put pip install django I get command not found in my shell.
Reply
#7
(Nov-04-2020, 04:53 AM)tdwinfre Wrote: No I'm on mac and whenever I put pip install django I get command not found in my shell.
Then you need to set up Python,Homebrew is usually used for this in Mac.
Look at The right and wrong way to set Python 3 as default on a Mac

When you have python or python3 and pip working an at least pointing to Python 3.7 or newer.
Then install is the same way as i have shown.
Reply
#8
So the codes on homebrew website I should put them in my python shell?
Reply
#9
I have python 3.8.5 is that not good enough I'm trying to understand what exactly to do ? Anything I put in my python shell its says command not found Zsh
Reply
#10
(Nov-04-2020, 05:08 PM)tdwinfre Wrote: So the codes on homebrew website I should put them in my python shell?
Anything I put in my python shell its says command not found Zsh
You shall not type this in python shell,it's from command line Execute commands and run tools in Terminal on Mac.

Only this part after install i start python shell and test,same on Mac.
# Test that it works
C:\code>python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>>
>>> django.__version__
'3.1.3'
>>> exit()   
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failed tkinter Compile In Custom 3.7.2 Build Using Custom Tcl/Tk Build gwc 0 2,623 Jan-25-2019, 01:56 PM
Last Post: gwc

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020