42
loading...
This website collects cookies to deliver better user experience
pip install Django
django-admin
” command, which helps developers to manage their projects and that is what we are going to use right now for creating a new project:django-admin startproject project1
cd project1
python manage.py runserver
cd project1
django-admin startapp app1
class User(models.Model):
user = models.CharField(max_length=32)
email = models.EmailField(max_length=32)
pwd = models.CharField(max_length=32)
python manage.py makemigrations
python manage.py migrate
python manage.py sqlmigrate app1 0001
path('', index, name='index')
return render(request, ‘index.html’, context)
{{context.key}}
to get variables sent from view functions. This makes front end programming much easier.python manage.py runserver
to start the web app, type 127.0.0.1:8000 and you will see the first page of our app!