CentOS8 --Play --Django

From installation to startup

Acty

$ source django/bin/activate

Project creation

 // Move to the directory where you want to create the project and create it
(django) [*****]$ django-admin startproject hellodjango

Project confirmation

(django) [*****]$ ls hellodjango/
hellodjango  manage.py

(django) [*****]$ ls hellodjango/hellodjango/
__init__.py  __pycache__  asgi.py  settings.py  urls.py  wsgi.py

--hellodjango (outside): Just a container for your project. This name has nothing to do with Django, so you can change it to whatever you like --manage.py: Command line utility for performing various operations on the project --hellodjango (inside): The actual Python package for your project --init.py: An empty file to let you know that this directory is a Python package --settings.py: project settings file --urls.py: Django project URL declaration (= equivalent to the "table of contents" on the Django site) --wsgi.py: Entry point with WSGI compatible web server for serving projects

Reference: Creating your first Django app

Start-up

(django) [*****]$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.

December 16, 2019 - 14:06:33
Django version 3.0, using settings 'hellodjango.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

access

ttp://127.0.0.1:8000/

The install worked successfully! Congratulations! Is displayed, it is successful!

Application creation

Application creation

 // Move to the directory where manage.py is and execute
$ python manage.py startapp hello

Database settings

Set various things ...

python manage.py migrate

Model settings

Model activation

Recommended Posts

CentOS8 --Play --Django
CentOS8 --Install --Django
Play with CentOS 8
Django
Install Python 3.7 and Django 3.0 (CentOS)
django update
Django note 4
Django memorandum
django search
Django installation
Django Summary
Django test
Django # 2 (template)
Django Note 5
Django hands-on
Touch django
django notes
Django Summary
Django basics
CentOS8 + Apache2.4 + pyenv + mod_wsgi + Django project deployment
CentOS 6.4 with Python 2.7.3 with Apache with mod_wsgi and Django
Django Shoho
Django defaults
Django + Docker
Django Glossary
Django search
Install Django
Django: References
Django Note 1
Django note 3
Django note 2
Django startup
Django notes
Django NullCharField