-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added api for Experience pages (#111)
- Loading branch information
Showing
5 changed files
with
48 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from rest_framework.renderers import JSONRenderer | ||
from wagtail.api.v2.router import WagtailAPIRouter | ||
from wagtail.api.v2.views import BaseAPIViewSet, PagesAPIViewSet | ||
|
||
from .models import ExperiencePage | ||
|
||
|
||
class ExperiencePageAPIViewSet(BaseAPIViewSet): | ||
"""Class that defines how page api works.""" | ||
|
||
renderer_classes = [JSONRenderer] | ||
model = ExperiencePage | ||
filter_backends = PagesAPIViewSet.filter_backends | ||
body_fields = [ | ||
"url", | ||
"id", | ||
"full_url", | ||
"title", | ||
"description", | ||
"cover_img_url", | ||
"code", | ||
"exp_url", | ||
"featured", | ||
"bugged", | ||
] | ||
listing_default_fields = body_fields | ||
|
||
|
||
api_router = WagtailAPIRouter("wagtailapi") | ||
api_router.register_endpoint("experiences", ExperiencePageAPIViewSet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,41 +10,18 @@ With the release of battlefield 2042, ripple effect studio, added the ability to | |
This project will replace the current website at https://bfportal.gg/ | ||
|
||
# Info | ||
project is now in beta testing | ||
head over to http://vmi656705.contaboserver.net:8000/, and try it out | ||
|
||
### Screenshots of several parts of the website | ||
<details> | ||
|
||
<summary> | ||
Click to show | ||
</summary> | ||
|
||
|
||
## Home Page | ||
![image](https://user-images.githubusercontent.com/22869882/162639043-ec231408-b2e2-4f7a-b89e-38e48fec75e3.png) | ||
## Profile Page | ||
![image](https://user-images.githubusercontent.com/22869882/162639063-19c9bd0b-888b-4116-ab25-cfc3d67692ec.png) | ||
## Experience Info Page | ||
![image](https://user-images.githubusercontent.com/22869882/162639079-105111d8-0557-4ce2-a697-6cb3b8091b16.png) | ||
## Experience Submission and edit page | ||
![image](https://user-images.githubusercontent.com/22869882/162639108-f3fef6b3-1c44-4283-a504-8ab959815bd8.png) | ||
## Discord Login process | ||
![image](https://user-images.githubusercontent.com/22869882/162639135-30265c6e-690a-47b2-b9c5-842f98061051.png) | ||
![image](https://user-images.githubusercontent.com/22869882/162639149-6ca41096-9892-4c5c-ab3f-0d1c7dd9b1d0.png) | ||
|
||
</details> | ||
Head over to [bfportal.gg](https://bfportal.gg/), and try it out | ||
|
||
## Features | ||
- User system (Discord login for intregation with bfportal community discord server) | ||
- User system (Discord login for integration with portal community discord server) | ||
- Auto Fill API for forms | ||
- Pagination and website wide search | ||
|
||
## How it works | ||
It is pretty straight forward | ||
|
||
- You use your discord account to make a new account on the website and submit your experiences. | ||
- On the submission page if u choose to share the playgound Url of the experience, the submission form will auto fill 😃. | ||
- On the submission page if u choose to share the playground Url of the experience, the submission form will autofill 😃. | ||
|
||
You can later edit your experience if u like. | ||
|
||
|
@@ -57,16 +34,8 @@ You can later edit your experience if u like. | |
|
||
- create and activate a venv | ||
- install dependencies `python -m pip install -r requirements.txt` | ||
- create a .env file with the following values | ||
- ``` | ||
DB_NAME=<postgres_db_name> | ||
DB_USERNAME=<postgres_username> | ||
DB_PASSWORD=<postgres_password> | ||
POSTGRES_HOST=127.0.0.1 | ||
SU_PASSWD=1234 | ||
DISCORD_CLIENT_ID=931965340764737608 | ||
DISCORD_SECRET=SuzQK6oAV_ArY3HGXUYIOUjFT46C5OtW | ||
``` | ||
- copy the [.env.template](bfportal/.env.template) file and rename it to .env | ||
- fill the appropriate data in .env file | ||
- Do first run migrate | ||
- run `python manage.py ensure_superuser --username bfportal --email [email protected] --password <password>` | ||
- run `python manage.py ensure_initialization` | ||
|
@@ -79,7 +48,7 @@ You can later edit your experience if u like. | |
|
||
|
||
### Special Thanks to | ||
- [gametools.network](https://gametools.network/) for providing API to auto fill submisson form 🥰 | ||
- [Wagtail](https://github.com/wagtail/wagtail) for providing a awesome framework that makes managing submissions very easy ✅ | ||
- [gametools.network](https://gametools.network/) for providing API to autofill submisson form 🥰 | ||
- [Wagtail](https://github.com/wagtail/wagtail) for providing an awesome framework that makes managing submissions very easy ✅ | ||
- [tailwindcss](https://github.com/tailwindlabs/tailwindcss) for saving the lives of backend developers. 🙏 | ||
- [Matavatar](https://discord.com/users/236802771381125120) from BFportal discord community for providing valuable feedback 🤝 | ||
- [Matavatar](https://discord.com/users/236802771381125120) from BFportal discord community for designing UI of the website 🤝 |