Skip to content

Commit

Permalink
pytest test cases added in the app of users.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebamus committed May 8, 2023
1 parent 518fc3d commit 5032b8e
Show file tree
Hide file tree
Showing 583 changed files with 158,596 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: bluebamus

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/clean-up-or-repactoring-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Clean-up or Repactoring report
about: Describe this issue template's purpose here.
title: "[UPDATE]"
labels: cleanup, repactoring
assignees: bluebamus

---

**Is your update request related to a problem or what? Please describe.**
A clear and concise description of what is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Documentation report
about: Describe this issue template's purpose here.
title: "[DOC]"
labels: documentation
assignees: bluebamus

---

**Describe the Documentation**
A clear and concise description of what the it is.

**Additional context**
Add any other context.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/error-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Error report
about: Describe this issue template's purpose here.
title: "[ERROR]"
labels: error
assignees: bluebamus

---

**Describe the error**
A clear and concise description of what the error is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.

20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[NEW]"
labels: enhancement
assignees: bluebamus

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/test-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Test request
about: Describe this issue template's purpose here.
title: "[TEST]"
labels: test
assignees: bluebamus

---

**Describe the Test**
A clear and concise description of what the Test is.

**To produce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the test here.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# cache files
__pycache__/
migrations/

# secure files
.env
.env*

# log files
logs/
.log

# prof files
*.prof

# media files
media/
87 changes: 87 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Reference
github : [Good-CONTRIBUTING.md-template.md](http://contributor-covenant.org)
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 devspoon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.11"
113 changes: 113 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
![waving](https://capsule-render.vercel.app/api?type=waving&height=200&text=devspoons-portfolio-blog&fontSize=60&fontAlign=50&fontAlignY=40&color=gradient)

# devspoons-portfolio-blog
This project that supports the development of personal homepages for portfolios and blogs. based on django that uses class views with separated views, models, admin can help you with advanced learning and practice of django.
# Navigation
- [devspoons-portfolio-blog](#devspoons-portfolio-blog)
- [Navigation](#navigation)
- [Official documentation](#official-documentation)
- [Features](#features)
- [Development skills to get started](#development-skills-to-get-started)
- [Project understanding](#project-understanding)
- [Home](#home)
- [User](#user)
- [Blog](#blog)
- [Current category : Blog, Books, Online study, Open source, project](#current-category--blog-books-online-study-open-source-project)
- [Board](#board)
- [Current category : Notice, Reactivate, Visiter](#current-category--notice-reactivate-visiter)
- [Config](#config)
- [Installing](#installing)
- [Running the tests](#running-the-tests)
- [Deployment'](#deployment)
- [Contributing](#contributing)
- [Versioning](#versioning)
- [Authors](#authors)
- [License](#license)
# Official documentation
- preparing...
# Features
- **Separated config(settings) file management** : Setting files are separated with base(common file), dev, prod, stage, test. So user can choice a condition for any server status of development.
- **Separated file management** : Normally Django provides views.py, admin.py and models.py respectively. However, it is very difficult to manage all classes and functions in one file. So this project has separated file management to show how it can be handled.
- **Replication database management** : In a distributed system, databases are created in a replicated state. So django needs a connection point for reading and writing. This project shows you how to use replica_router.py to handle cases.
- **Unit test** : developing - will use pytest, faker and factory boy
- **profiling** : developing - silk, linesman
- **Github action test** : developing.
- **Redis cash** : developing - cash, session, celery worker buffer.
- **Celery** : developing - will work with redis.
- **Docker** : developing - will include nginx, unicorn, mysql, redis, monitoring etc.
- **Distributed system** : developing - mysql replication, infra monitoring etc.
- **Multi cloud support** : developing - oracle cloud, AWS.
- **github action distribute** : developing - oracle cloud, AWS.
- **Monitoring** : developing - django, db, docker, infra condition etc.
# Development skills to get started
- Front-end : Css, Javascript, Html, Bootstrap5.
- Back-end (App application) : Python3.x, Database Query, Redis, Celery.
- Framework : Django.
# Project understanding
## Home
- Index
- Search (using django orm) / will update to haystack search.
- Main menu (django-mptt) - model only.
- Site information - model only.
- Social Account - model only (not use).
## User
- User - AbstractUser
- Email Verification : It sends a email which has verification link
- Sending Email monitoring - model only : Supports mailgun, sendinblue, sendgrid.
- User profile : when a user register website, is created automatically.
- Login : Supports local and social account logins (django-allauth).

## Blog
### Current category : Blog, Books, Online study, Open source, project
- Separate files in each folder by category name (admin, models, views, test).
- All categories have a similar structure for easy understanding. This allows users to expand new categories by copying and pasting. But it's not good for manage code.
Using init function of "class view" or "function view", user can consider repactoring this one.
But doesn't deal with in this project.
- A blog model designed based on an abstract architecture.
- A blog_reply designed based on an abstract architecture.
- Almost category's reply in views files are response to json. (Request and response, UI processing with JavaScript.)
## Board
### Current category : Notice, Reactivate, Visiter
- It is similar to the blog app, the design of the 'model' is different, and the app is separated for the purpose of expanding the 'view' function and separating the 'administrator' menu.
## Config
- The settings folder contains fragmented files and folders for each service. So users can easily included any service they want by using 'Import'.
- The current settings folder contains files for 5 cases: Basic, Development, Test, Stage, and Product. For all settings, user must include the base file that is default file.
# Installing
- Install requirement file using pip
- Requirement folder has 4 case of file : dev.txt, test.txt, stage.txt, prod.txt
- stage.txt can be same with prod.txt. Users should make their own modifications according to the conditions of testing and monitoring of the server and infrastructure.
- development environment setting : consider local server or one or two of CURD database.
```
pip install -r requirements/dev.txt
```
- test environment setting : test and profiling.
```
pip install -r requirements/test.txt
```
- stage environment setting : infra and integration test. can include performance test.
```
pip install -r requirements/stage.txt
```
- product environment setting : clean install for real service.
```
pip install -r requirements/prod.txt
```
# Running the tests
- Using pytest.ini
```
pytest
```
# Deployment'
- It is not covered in this project. Refer to following project.
- preparing...
# Contributing
Please read [CONTRIBUTING.md](https://github.com/devspoon/devspoon-portfolio-blog/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
# Versioning
We use [SemVer](https://semver.org/ "SemVer") for versioning. For the versions available, see the [tags on this repository](https://semver.org/ "repository tag").
# Authors
- Lim DoHyun - Owner
# License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/devspoon/devspoon-portfolio-blog/blob/main/LICENSE) file for details
Empty file added blog/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions blog/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from .blog_admin import *
from .books_admin import *
from .onlinestudy_admin import *
from .opensource_admin import *
from .project_admin import *
from .common_admin import *
Loading

0 comments on commit 5032b8e

Please sign in to comment.