A blog system implemented with Django (deployed on Windows).
-
Install Python3.6.
-
Change directory to your project folder (e.g
D:\TypeIdea
), then create virtual environment (e.g.virtualenv -p D:\python-3.6.0-embed-amd64\python.exe venv
). If thevirtualenv
package doesn't exist, install it usingpip install virtualenv
. -
Activate virtualenv:
.\venv\Scripts\activate.ps1
-
Install Django and other packages:
pip install -r requirements.txt
-
Create database and tables:
python manage.py makemigrations python manage.py migrate
-
Create admin account:
python manage.py createsuperuser
-
Use dbshell for SQLite (optional):
- Download
sqlite-tools-win32-x86-*******.zip
on SQLite Download Page. - Unpack it and just paste it to the folder where you have your
manage.py
. You can paste all 3 files there (sqldiff.exe
,sqlite3.exe
,sqlite3_analyzer.exe
). - Then:
python manage.py dbshell sqlite> .tables ... sqlite> .exit
- Download
python manage.py runserver
Then access browser:
# home page
localhost:8000
# admin pages
localhost:8000/super_admin
localhost:8000/admin
- With PyCharm, you need to set the
Content Root
to the subdirectorytypeidea
. Otherwise, an editor resource reference error will occur.