Wednesday, January 9, 2019

Setup and Configure Django --steps

The first two assignments involved a lot of steps, so I though it might be useful to list them. Most of these steps only need to be done once. Also I want to reiterate that the tech review project and app are the in-class examples, the assignments are all with the python club project and app.

Initial set up

  1. Create a directory for the django projects
  2. Install django into that directory
  3. Install venv, the virtual environment
  4. Activate the virtual environment
  5. Create the project techreviews
  6. change directory into techreviews and start the app tech
  7. (do the same two steps with pythonclub)

Configuration

  1. Create the techreviewdb in pgadmin (also create pythonclubdb)
  2. Open VSCode, Open a folder to the outermost techteview folder
  3. Also open a terminal in VSCode
  4. Open the settings.py file in the project folder.
  5. In the settings.py file add 'tech' to the registered apps list.
  6. Also in the settings.py change the database to postgresql_psycopg2.
  7. You will need to install psycopg2 using pip, using the terminal in VSCode
  8. Migrate the databases
  9. In the project lever urls.py add an include that points to the app's url
  10. Add a urls.py file to the app directory

At this point you will have completed the setup and configuration

No comments:

Post a Comment