Net153 Home
A migration of a blosxom ( mirror ) powered blog converted to a Django project.
The next steps assume that conda is already installed
1 - Install the project basic dependencies and development dependencies
Make sure you are inside the root project directory before executing the next commands.
The root project directory is the directory that contains the
manage.pyfile
On Linux and Mac
pip install -r requirements/local.txtOn Windows
pip install -r requirements\local.txt2 - Configure the database connection string on the .env
On Linux and Mac
cp env.sample.mac_or_linux .envOn Windows
copy env.sample.windows .envChange the value of the variable DATABASE_URL inside the file .env with the information of the database we want to connect.
Note: Several project settings have been configured so that they can be easily manipulated using environment variables or a plain text configuration file, such as the .env file.
This is done with the help of a library called django-environ. We can see the formats expected by DATABASE_URL at https://github.com/jacobian/dj-database-url#url-schema.
3 - Use the django-extension's sqlcreate management command to help to create the database
On Linux:
python manage.py sqlcreate | sudo -u postgres psql -U postgresOn Mac:
python manage.py sqlcreate | psqlOn Windows:
Since there is no official support for PostgreSQL 12 on Windows 10 (officially PostgreSQL 12 is only supported on Windows Server), we choose to use SQLite3 on Windows
4 - Run the migrations to finish configuring the database to able to run the project
python manage.py migratecoverage run -m pytest