Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDDDE27_2024_WEB_PROJECT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TDDD27_MYPET
TDDDE27_2024_WEB_PROJECT
Commits
ca89e2da
Commit
ca89e2da
authored
11 months ago
by
Daniel Myrén
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
ddbfd576
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/README.md
+6
-11
6 additions, 11 deletions
backend/README.md
with
6 additions
and
11 deletions
backend/README.md
+
6
−
11
View file @
ca89e2da
...
@@ -58,17 +58,12 @@ https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#migration-20-query
...
@@ -58,17 +58,12 @@ https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#migration-20-query
```
python
```
python
# Create Flask app
app
=
Flask
(
__name__
)
# Enable CSRF on all api endpoints
app
=
Flask
(
__name__
)
# Create Flask app
csrf
=
CSRFProtect
(
app
)
db
=
SQLAlchemy
()
# Integrates SQLAlchemy with Flask.
csrf
=
CSRFProtect
(
app
)
# Enable CSRF
# Define Content Security Policies
talisman
=
Talisman
(
app
,
content_security_policy
=
csp
)
# HTTP Security
talisman
=
Talisman
(
app
,
content_security_policy
=
csp
)
user_db
=
SQLAlchemyUserDatastore
(
db
,
User
,
Role
)
# Connect User tables
app
.
security
=
Security
(
app
,
user_db
)
# Initialize Flask-Security
# Initialize Flask-Security
user_datastore
=
SQLAlchemyUserDatastore
(
db
,
User
,
Role
)
app
.
security
=
Security
(
app
,
user_datastore
)
```
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment