Pastebin

Paste #24099: No description

< previous paste - next paste>

Pasted by Anonymous Coward

Download View as text

import app
from app import db
from app.models import Challenge, ChallengeLevel, ChallengeCategory

with app.app_context():

    cl_veryeasy = ChallengeLevel()
    cl_veryeasy.sort_key = 100
    cl_veryeasy.name = "Very Easy"
    cl_veryeasy.description = "Requires only a single step to get the flag. These are good if you are starting from scratch."

    cl_medium = ChallengeLevel()
    cl_medium.sort_key = 200
    cl_medium.name = "Medium"
    cl_medium.description = "Moderate difficulty. Typically requires multiple steps to get the flag."

    cl_hard = ChallengeLevel()
    cl_hard.sort_key = 300
    cl_hard.name = "Hard"
    cl_hard.description = "Harder challenges. Will typically require multiple or complex steps to solve. Or will require background knowledge in the subject."

    db.session.add(cl_veryeasy)
    db.session.add(cl_medium)
    db.session.add(cl_hard)
    db.session.commit()




################# result:
C:\wc\sascode\python\CTF\venv\Scripts\python.exe C:\wc\sascode\python\CTF\data.py 
[2022-10-29 17:10:57,624] INFO in __init__: ctfwebapp startup
Traceback (most recent call last):
  File "C:\wc\sascode\python\CTF\data.py", line 5, in <module>
    with app.app_context():
AttributeError: module 'app' has no attribute 'app_context'

Process finished with exit code 1

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.