This branch contains code that was produced by following this tutorial: https://www.digitalocean.com/community/tutorials/build-a-to-do-application-using-django-and-react
$ cd backend
$ python manage.py runserver
$ cd frontend
$ npm start
View some use case examples here: https://docs.djangoproject.com/en/4.0/intro/tutorial02/#playing-with-the-api
$ python manage.py shell
This will run all of the automated tests for a given app (i.e. polls).
$ python manage.py test <app_name>
This must be done at an apps inception and every time a migration is created.
$ python manage.py migrate
This must be done everytime a change to our model is made. Django generates the migration automatically. You must run the migratons afterwards to apply the changes to your database.
$ python manage.py makemigrations polls
This allows you to see the SQL that would be ran if you ran the given migration.
$ python manage.py sqlmigrate polls <migration_number>
This can be used to help identify any issues with migrations.
$ python manage.py check
In your source code root directory:
$ pip install pipenv
In your source code root directory:
$ pipenv shell
Do this when you woul dlike to leave the virtual environment:
$ deactivate
This will download any new dependancies added in version controll.
$ pipenv install
Use this to install new packages. This will update the Pipenv file for version control.
$ pipenv install <package_name>
The online docs cover this: https://docs.djangoproject.com/en/4.0/intro/tutorial02/#creating-an-admin-user
$ python manage.py createsuperuser
To test a veiw as a user, we can use Selenium (much like Cucumber). Selenium is cool because it actually opens a webbrowser to run the tests. View it here: https://ordinarycoders.com/blog/article/testing-django-selenium
If we find it nessisary, this is how:
https://docs.djangoproject.com/en/4.0/intro/reusable-apps/