django-admin startproject <project name>
inside the project folder
> cd <project name>
> python manage.py startapp <app name>
> INSTALLED_APPS = [
> ....
> <app name>
> ]
> import os
>
> 'DIRS': [os.path.join(BASE_DIR,'templates')],
> STATIC_URL = 'static/'
> STATIC_ROOT = BASE_DIR / 'static'
> STATICFILES_DIR = [os.path.join(BASE_DIR, 'static')]
> from django.urls import path, include
>
> urlpatterns = [
> ...
> path('',include('members.urls'))
> ]
> from django.urls import path
> from . import views
> urlpatterns = [
> ...
> path('',views.index,name='index'),
> ...
> ]
> from django.shortcuts import render
>
>def index(request):
> #any operations you want to do
> return render(request,'graph.html')
in models.py of app
> from pyexpat import model
> from django.db import models
>
> class QUESTION(models.Model):
> q1=models.IntegerField(blank=False,default=9)
in admin.py of app
> from <app name>.models import QUESTION
>
> admin.site.register(QUESTION)
> python manage.py makemigrations
> python manage.py migrate
>
> python manage.py collectstatic
> python manage.py createsuperuser
Login by going to the prebuilt django admin panel at http://127.0.0.1:8000/admin/