Skip to content

ju14x/my-first-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my-first-blog

Learning Django through the Django Girls tutorial.

Project dependencies:

  • python
  • django
  • psycopg2
  • docker (container for the postgreSQL database)

How to run:

python -m venv .venv
source .venv/bin/activate # linux
pip install -U pip
pip install -r requirements.txt

The easiest way to create the database is in a docker container:

docker run --name postgres -e POSTGRES_PASSWORD=123 -d -p 5432:5432 postgres

# docker run --name <container-name-of-your-choice> -e POSTGRES_PASSWORD=<password> -d -p 5432:5432 postgres:<image-version>

Enter the container to create the database:

docker exec -it postgres bash # docker exec -it <container-name> bash

psql -U postgres # psql -U <user>

CREATE DATABASE djangu; # if you chose a different container name, be sure to change it on mysite/settings.py

\q
exit
python manage.py migrate # create database migrations
python manage.py createsuperuser # fill in the user and password fields
python manage.py runserver # runs on https://localhost:8000/

About

aprendendo Django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published