Fist, you need create virtual environment, install django to eviroment
This’s step, we are creating folder have name venv contain virtual environment
#2. Install Django
using command to install django framework
Fist time when we use virtual environment, we need activate file by type command in this picture. Refresh editor to show folder venv created
manage.py
: A command-line utility that lets you interact with this Django project in various ways. You can read all the details aboutmanage.py
in django-admin and manage.py.- The inner
mysite/
directory is the actual Python package for your project. Its name is the Python package name you’ll need to use to import anything inside it (e.g.mysite.urls
). mysite/__init__.py
: An empty file that tells Python that this directory should be considered a Python package. If you’re a Python beginner, read more about packages in the official Python docs.mysite/settings.py
: Settings/configuration for this Django project. Django settings will tell you all about how settings work.mysite/urls.py
: The URL declarations for this Django project; a “table of contents” of your Django-powered site. You can read more about URLs in URL dispatcher.mysite/asgi.py
: An entry-point for ASGI-compatible web servers to serve your project. See How to deploy with ASGI for more details.mysite/wsgi.py
: An entry-point for WSGI-compatible web servers to serve your project. See How to deploy with WSGI for more details.
Database setup
Important: You’ll need to run the above commands every time your models change in a way that will affect the structure of the data that needs to be stored (including both addition and removal of whole models and individual fields).
py manage.py makemigrations
py manage.py migrate
Creating models
Activating models
run migrate
again to create those model tables in your database:
Creating an admin user
Tell the admin that Question
objects have an admin interface.
Writing more views
https://pypi.org/project/pylint-django/