The website and applications of the Study Buffalo.
Hello, we are the Study Buffalo! We are excited to see you taking an interest in our project. This area is specifically the web hosting side of our projects. This website is currently created with the Django framework.
We strive to keep our projects accessible to all. Everything here is open source under the GNU Public License version 3. We are always open to discussing other licensing options, so please contact us if this is an issue for you.
You can always get a hold of us at studybuffalo@gmail.com, info@studybuffalo.com, or through GitHub itself.
- Install Python 3.8:
- Install PostgreSQL (version 9.4 or higher is required). You will need to create an admin account to create the required databases. You may use whatever interface you wish to run SQL commands; the following instructions assume you are using a commandline interace tool, such as psql.
Once PostgreSQL is installed you will need to create a database and user for Django. The following provides a minimal setup with some sane defaults (you may update the
database_name
,user
, andpassword
sections to whatever you prefer):CREATE DATABASE database_name; CREATE USER user WITH PASSWORD 'password'; ALTER ROLE user SET client_encoding TO 'utf8'; ALTER ROLE user SET default_transaction_isolation TO 'read committed'; ALTER ROLE user SET timezone TO 'UTC'; GRANT ALL PRIVILEGES ON DATABASE database_name TO user; ALTER USER user CREATEDB; ALTER DATABASE database_name OWNER TO user;
Install
pipenv
via command line:$ pip install pipenv
- Clone the github repository (https://github.com/studybuffalo/studybuffalo.git)
- In the
/config/settings
directory of the repo copy the.study_buffalo.env
file and rename itstudy_buffalo.env
- If needed, update the variables in the
study_buffalo.env
file to use your database credentials and any secret keys/API details. In the root directory of the repository, run the Makefile install command to setup Django.
You may setup the environment with no database content with the following command:
$ make --file=Makefile install-development-fresh
You may setup the environment with fixture content with the following command:
$ make --file=Makefile install-development-fixtures
You should now be able to run the Django development server. You can test this with the following command, which will generate output similar to below:
$ pipenv run python manage.py runserver 127.0.0.1:8000 > Performing system checks... > System check identified no issues (0 silenced). > Django version #.#.#, using settings 'config.settings.development' > Starting development server at http://127.0.0.1:8000/ > Quit the server with CTRL-BREAK.
If fixture data was loaded, the following user accounts will be available:
- Admin Account:
username
=admin
,email
=admin@email.com
, andpassword
=admin
- Basic User Account:
username
=user
,email
=user@email.com
, andpassword
=user
DO NOT use these accounts in a production environment.
- Admin Account:
To start the development server:
$ pipenv run python manage.py runserver 127.0.0.1:8000
To run tests:
$ pipenv run pytest
To generate coverage report:
# XML Report
$ pipenv run pytest --cov study_buffalo --cov-report xml
# HTML Report
$ pipenv run pytest --cov study_buffalo --cov-report html
To run linting:
# Run Pylint
$ pipenv run pylint study_buffalo/ config/
# Run Pycodestyle
$ pipenv run pycodestyle study_buffalo/ config/
Docstrings are documented using the reStructuredText format. Details of this style can be found here: https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html