Giter Club home page Giter Club logo

django-with-selenium's Introduction

TEAM_003

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

Run the backend server

$ cd backend
$ python manage.py runserver

Run the frontend server

$ cd frontend
$ npm start

Activate the interactive python shell

View some use case examples here: https://docs.djangoproject.com/en/4.0/intro/tutorial02/#playing-with-the-api

$ python manage.py shell

Run automated tests

This will run all of the automated tests for a given app (i.e. polls).

$ python manage.py test <app_name>

Migrations

Run migrations

This must be done at an apps inception and every time a migration is created.

$ python manage.py migrate

Create a migration

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

Display SQL of a migration

This allows you to see the SQL that would be ran if you ran the given migration.

$ python manage.py sqlmigrate polls <migration_number>

Run problem checking software

This can be used to help identify any issues with migrations.

$ python manage.py check

Using pipenv to manage your virtual environment (instructions written for mac)

Install pipenv locally

In your source code root directory:

$ pip install pipenv

Activating the virtual environment

In your source code root directory:

$ pipenv shell

Deactivating the virtual environment

Do this when you woul dlike to leave the virtual environment:

$ deactivate

Updating the virtual environment

This will download any new dependancies added in version controll.

$ pipenv install

Install a new package

Use this to install new packages. This will update the Pipenv file for version control.

$ pipenv install <package_name>

Create an admin account

The online docs cover this: https://docs.djangoproject.com/en/4.0/intro/tutorial02/#creating-an-admin-user

$ python manage.py createsuperuser

View testing

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

Packaging and publishing our app

If we find it nessisary, this is how:

https://docs.djangoproject.com/en/4.0/intro/reusable-apps/

django-with-selenium's People

Contributors

kian-weimer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.