implementing nested blueprint for api calls
This commit is contained in:
parent
fbdc6b4ee4
commit
d0908cf65d
4 changed files with 43 additions and 4 deletions
|
|
@ -50,15 +50,16 @@ def create_app():
|
||||||
from app.users import users
|
from app.users import users
|
||||||
from app.main import main
|
from app.main import main
|
||||||
from app.campaigns import campaigns
|
from app.campaigns import campaigns
|
||||||
|
from app.campaigns.campaign_api import campaign_api
|
||||||
from app.admin import admin
|
from app.admin import admin
|
||||||
# from app.agent_reports import agent_reports
|
|
||||||
# from app.status_reports import status_reports
|
campaigns.register_blueprint(campaign_api)
|
||||||
|
|
||||||
app.register_blueprint(users)
|
app.register_blueprint(users)
|
||||||
app.register_blueprint(main)
|
app.register_blueprint(main)
|
||||||
app.register_blueprint(campaigns)
|
app.register_blueprint(campaigns)
|
||||||
app.register_blueprint(admin)
|
app.register_blueprint(admin)
|
||||||
# app.register_blueprint(agent_reports)
|
|
||||||
# app.register_blueprint(status_reports)
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def reroute_base_url():
|
def reroute_base_url():
|
||||||
|
|
|
||||||
9
app/campaigns/campaign_api/__init__.py
Normal file
9
app/campaigns/campaign_api/__init__.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
from flask import Blueprint
|
||||||
|
|
||||||
|
campaign_api = Blueprint('campaign_api',
|
||||||
|
__name__,
|
||||||
|
template_folder='templates',
|
||||||
|
static_folder='static',
|
||||||
|
url_prefix='/campaign_api')
|
||||||
|
|
||||||
|
from app.campaigns.campaign_api import routes
|
||||||
7
app/campaigns/campaign_api/routes.py
Normal file
7
app/campaigns/campaign_api/routes.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
from flask import render_template
|
||||||
|
from app.campaigns.campaign_api import campaign_api
|
||||||
|
|
||||||
|
|
||||||
|
@campaign_api.route('testing')
|
||||||
|
def testing():
|
||||||
|
return render_template('testing.html')
|
||||||
22
app/campaigns/campaign_api/templates/testing.html
Normal file
22
app/campaigns/campaign_api/templates/testing.html
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block title %}testing{% endblock title %}
|
||||||
|
|
||||||
|
{% block stylesheet %}
|
||||||
|
<style>
|
||||||
|
.custom-table {
|
||||||
|
border-radius: 15px;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||||
|
overflow: hidden; /* Ensures rounded corners apply to the entire table */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endblock stylesheet %}
|
||||||
|
{% block content %}
|
||||||
|
<main>
|
||||||
|
<div class="container my-4 px-5">
|
||||||
|
<h2 class="text-center">Testing Page</h2>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
{% endblock content %}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue