This is a Django/React starter project with lots of batteries included. I created it to get started on new projects more quickly and stay up-to-date on the tools I like to use. I'm hoping you'll get something out of it too.
-
Install the following:
- Command Line Tools package -
xcode-select --install
- Vagrant
- VirtualBox
- Homebrew
- Ansible -
brew install ansible
- Node.js -
brew install node@14
- Command Line Tools package -
-
To start the backend and watch for code changes, run the following in a terminal window:
git clone https://github.com/johnthedebs/basicproject.git cd basicproject # OR django-admin startproject <project_name> --template https://github.com/johnthedebs/basicproject/archive/main.zip cd <project_name> vagrant up vagrant ssh runserver
-
To build the frontend and watch for code changes, run the following in a second terminal window:
npm install npm start
-
Visit
localhost:8080
in a browser
Cypress tests with npm run test
or npm run test-headless
.
https://docs.cypress.io/guides/getting-started/writing-your-first-test.html#Write-your-first-test
- Set SECRET_KEY in settings.py
- Rename ops/host_vars/basicproject
- Set hostname, user, ansile_ssh_host, and ansible_ssh_user
- Change ops/production to reflect host_vars file name
- Set hostname, site_name, site_path in group_vars
npm install
inops/lets
directory- Fill out
ops/lets/config/example-settings.js
and rename tosettings.js
- In conf/production.py
- Set ALLOWED_HOSTS, ADMINS, SENTRY_DSN
- Set SENTRY_DSN in conf/webpack.config.js
- https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/