Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
# This is a combination of 8 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

wooo

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #2:

moving computers

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #3:

v1 complete

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #4:

documentation

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #5:

code cleanup and minor bug fixes

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #6:

progress

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #7:

finish feature

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #8:

cleanup and help text

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
  • Loading branch information
itsthejoker authored and Joe Kaufeld committed May 14, 2021
1 parent 93750ea commit f9917a9
Show file tree
Hide file tree
Showing 28 changed files with 927 additions and 69 deletions.
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Relevant issue: {issue url}

## Description:

{description}

## Screenshots:

{if applicable}

## Testing Instructions:

{testing instructions}

## Checklist:

- [ ] Code Quality
- [ ] Pep-8
- [ ] Tests (if applicable)
- [ ] Success Criteria Met
- [ ] Inline Documentation
- [ ] Wiki Documentation (if applicable)
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Grafeas Development <devs@grafeas.org> itsthejoker <joe@grafeas.org>

9 changes: 9 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
# Unless a later match takes precedence, @global-owner1 and @global-owner2
# will be requested for review when someone opens a pull request.
* @GrafeasGroup/core

*.sh @thelonelyghost
test/* @thelonelyghost
42 changes: 42 additions & 0 deletions CODE_OF_MERIT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Code of Merit

> *"Intellectual freedom can exist only where two essential conditions are met: first, that all individuals have the right to hold any belief on any subject and to convey their ideas in any form they deem appropriate, and second, that society makes an equal commitment to the right of unrestricted access to information and ideas regardless of the communication medium used, the content of work, and the viewpoints of both the author and the receiver of information."* - Intellectual Freedom Manual, 7th edition

**1.** The project creators, lead developers, core team, constitute the managing members of the project and have final say in every decision of the project, technical or otherwise, including overruling previous decisions. There are no limitations to this decisional power.

**2.** Contributions are an expected result of your membership on the project. Don’t expect others to do your work or help you with your work forever.

**3.** All members have the same opportunities to seek any challenge they want within the project.

**4.** Authority or position in the project will be proportional to the accrued contribution. Seniority must be earned.

**5.** Software is evolutive: the better implementations must supersede lesser implementations. Technical advantage is the primary evaluation metric.

**6.** This is a space for technical prowess; topics outside of the project will not be tolerated.

**7.** Non technical conflicts will be discussed in a separate space. Disruption of the project will not be allowed.

**8.** Individual characteristics, including but not limited to, body, sex, sexual preference, race, language, religion, nationality, or political preferences are irrelevant in the scope of the project and will not be taken into account concerning your value or that of your contribution to the project.

**9.** Discuss or debate the idea, not the person.

**10.** There is no room for ambiguity: Ambiguity will be met with questioning; further ambiguity will be met with silence. It is the responsibility of the originator to provide requested context.

**11.** If something is illegal outside the scope of the project, it is illegal in the scope of the project. This Code of Merit does not take precedence over governing law.

**12.** This Code of Merit governs the technical procedures of the project not the activities outside of it.

**13.** Participation on the project equates to agreement of this Code of Merit.

**14.** No objectives beyond the stated objectives of this project are relevant to the project. Any intent to deviate the project from its original purpose of existence will constitute grounds for remedial action which may include expulsion from the project.

**15.** We distinguish between our personal convictions and professional duties and do not allow our personal beliefs to interfere with fair representation of the aims of our institutions or the ability to contribute to shared endeavors.

tl;dr: We support everyone and encourage everyone to contribute. However, if you are a shitbird to other contributors during your work on the project, or if you're found to be inciting violence with your work, then you'll be kicked out of the project.

---

This document is adapted from the Code of Merit (<strike>http://code-of-merit.org</strike>), version 1.0.
Point 15 is adapted from the American Librarian Association (ALA)'s Code of Ethics (http://www.ala.org/tools/ethics).
Originally retrieved from https://github.com/DuckHP/Code-of-Merit, 2019-03-19. Last updated: 2019-03-19.
90 changes: 90 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Contributing

Here is a short checklist of what we strive for in a well-formed code contribution:

- [ ] Commit log is clean and devoid of "debugging" types of commits
- [ ] Entry into [`CHANGELOG.md`](/CHANGELOG.md) with `(credit: @username)` (see **Changelog** below)
- [ ] Pull request is associated with at least 1 issue
- [ ] Virtualenv files are not included in the commit log

Do your best to check as many of these boxes as you can and everything will be fine!

## Issues

Any bugs you find, features you want to request, or questions you have should go in the
repository's [issues section]({REPO ISSUE LINK HERE}).
Please, be kind and search through both open and closed issues to make sure your question
or bug report hasn't already been posted and resolved.

## Development

{Add information here for setting up a local version of the project}

## Testing

This project is expected to have automated test coverage, so be sure to check that tests
are passing _before_ you begin development. Our emphasis is on stability here, so if tests
aren't passing, that's a bug.

### Stability

As noted before, make sure tests are passing before starting. If you have difficulty getting
to that stable, initial state, reach out by opening an issue (see [Issues](#Issues) above).
This is considered a failure by the maintainers if instructions are less than absolutely
clear. Feedback is very helpful here!

### Writing tests

Tests are written using `pytest` for a variety of reasons. Some of which are:

- easy assertions that an exception will be thrown and the message it contains
- skipping some tests for stated reasons
- marking some tests as expected to fail
- colorized output compared to `unittest`

We should be able to invoke the full test suite by calling either `python setup.py test` or
`pytest` from the terminal.

The test suite should run quickly at the moment, but that won't always be the case. Running
individual tests with `pytest path/to/test/file.py` is also acceptable while actively
developing.

> **NOTE:** a pull request should always have a fully passing test suite.
## Pull Requests

If you're unfamiliar with the process, see [Github's helpful documentation](https://help.github.com/articles/about-pull-requests/)
on creating pull requests.

We try to keep parity of at least one issue in each pull request. This is so we can discuss the
big-picture plans in the issue, preferrably before actual development begins. This helps keep
wasted time to a minimum.

### "[WIP]" Requests

Sometimes there are changes that are unfinished, but require periodic feedback--which is recommended
for large changes. If this is the case, add `[WIP]` to the start of the title of the pull request
when opening it, or edit the existing pull request title to include it. For example:

```
TITLE: [WIP] Convert from Redis to Cassandra
Some description here
- [ ] To do list item
- [ ] Other to do list item
- [x] Completed to do list item
I'm looking for feedback on what I've added so far.
```

## Changelog

We follow the practices defined on [Keep A Changelog](http://keepachangelog.com), keeping our
changelog in [`CHANGELOG.md`](/CHANGELOG.md)

The gist of it is:

- Add line items with a short summary of changes to `CHANGELOG.md` under the `UNRELEASED` section as they are created
- Add `(credit: @your_username)` at the end of each line item added
- (_When releasing a new version_) Replace `UNRELEASED` section title with the version number of the release, then create a new header above it named `UNRELEASED`
62 changes: 59 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,68 @@ DATABASES = {
}
```

This file will be ignored by git, so make any changes you need to while developing.
* Minimum Python version: 3.8

* Install dependencies with `poetry install`. Don't have Poetry? Info here: https://poetry.eustace.io/

* Run `python manage.py makemigrations blossom` to build the migrations, then commit them to the database with `python manage.py migrate --settings=blossom.local_settings`.

* Run `python manage.py bootstrap --settings=blossom.local_settings` to prepopulate the site with the base posts. This will also create a base user account that you can use to make another user for yourself.

* username: `blossom@grafeas.org`
* password: `asdf`

You can use the above credentials to create yourself a new account.
* Navigate to http://localhost:8000/superadmin/newuser and log in with the above credentials.
* Create a personal user account with the requested fields. Make sure that you select "is superuser".

Next, we'll disable the default admin account.
* Navigate to http://localhost:8000/superadmin/blossom/blossomuser/ and click on the "admin" user.
* Scroll to the bottom of the page and deselect "Active".
* Click Save.

Run the server with `python manage.py runserver --settings=blossom.local_settings`
You are now the only admin for the site. Other users must be added through the original form that

Any time you need to run a django command when running locally, always end it with `--settings=blossom.local_settings`.
This file will be ignored by git, so make any changes you need to while developing.

Run the server with `python manage.py runserver --settings=blossom.local_settings` Any time you need to run a django command that will affect the database when running locally, always end it with `--settings=blossom.local_settings`.

## Preparing for deploy

Run `python manage.py makemigrations blossom && python manage.py migrate`

Run `python manage.py collectstatic` and answer 'yes' -- this will populate the /static/ endpoint with everything it needs. This is not needed in development, but without it nothing from the static folders will be served properly. It will create a new folder called 'static' in the application root, which is why the staticfiles development side is called 'static_dev'.

Run `python manage.py bootstrap` and see above for expected user credentials and user configuration.

---

## Important links

#### payments.localhost:8000

The processing url for Stripe.

#### payments.localhost:8000/ping

Used by Bubbles for site isup checks.

#### localhost:8000

Site root.

#### localhost:8000/admin/

General site administration, open to all user accounts.

#### localhost:8000/superadmin/

User / post traditional admin. Requires staff acount.

#### localhost:8000/superadmin/newuser

Create a new user for the site.

#### localhost:8000/newpost

Create a new post for the site.
8 changes: 5 additions & 3 deletions blossom/authentication/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.contrib import admin
from django.urls import path

from blossom.website import views
from blossom.website.views import LoginView, LogoutView

urlpatterns = []
urlpatterns = [
path('login/', LoginView.as_view(), name='login'),
path('logout/', LogoutView, name='logout')
]
7 changes: 7 additions & 0 deletions blossom/engineeringblog/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.urls import path

from blossom.engineeringblog import views

urlpatterns = [
path('', views.index, name="blog_index"),
]
15 changes: 15 additions & 0 deletions blossom/engineeringblog/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.shortcuts import render
from django.db.models import Q

from blossom.website.models import Post

def index(request):

p = Post.objects.filter(
Q(published=True) &
Q(engineeringblogpost=True) &
Q(standalone_section=False) &
Q(show_in_news_view=True)
)

return render(request, 'website/index.html', {'posts': p})
4 changes: 3 additions & 1 deletion blossom/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

host_patterns = patterns(
'',
host(r'www', settings.ROOT_URLCONF, name='www'),
host(r'api', 'blossom.api.urls', name='api'),
host(r'payments', 'blossom.payments.urls', name='payments'),
host(r'engineering', 'blossom.engineeringblog.urls', name='engineeringblog'),
host(r'', settings.ROOT_URLCONF, name='www')
)
Loading

0 comments on commit f9917a9

Please sign in to comment.