File tree Expand file tree Collapse file tree 3 files changed +10
-39
lines changed
Expand file tree Collapse file tree 3 files changed +10
-39
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ def hello():
1212
1313@app .route ("/page2" )
1414#/ ke baad url pe ye run hoga
15+ @app .route ("/dusrapage" )
16+ # can add multiple routes too
1517def page2 ():
1618 return "you are in the second page"
1719
Original file line number Diff line number Diff line change 11#Bootstrap Website se acha-acha templates download kar sakte hai for good frontend design
22
33from flask import Flask , render_template
4+ from flask_sqlalchemy import SQLAlchemy
45
56app = Flask (__name__ )
7+ app .config ["SQLALCHEMY_DATABASE_URI" ] = "mysql+pymysql://sql12789398:tEkUSPU9G5@sql12.freesqldatabase.com/sql12789398"
8+ db = SQLAlchemy (app )
9+
10+ class User (db .Model ):
11+ id : Mapped [int ] = mapped_column (primary_key = True )
12+ username : Mapped [str ] = mapped_column (unique = True )
13+ email : Mapped [str ]
614
715#Having same function to different routes
816@app .route ("/" )
Original file line number Diff line number Diff line change @@ -32,45 +32,6 @@ <h3 class="post-subtitle">Problems look mighty small from 150 miles up</h3>
3232 </ div >
3333 <!-- Divider-->
3434 < hr class ="my-4 " />
35- <!-- Post preview-->
36- < div class ="post-preview ">
37- < a href ="post.html "> < h2 class ="post-title "> I believe every human has a finite number of heartbeats. I don't intend to waste any of mine.</ h2 > </ a >
38- < p class ="post-meta ">
39- Posted by
40- < a href ="#! "> Start Bootstrap</ a >
41- on September 18, 2023
42- </ p >
43- </ div >
44- <!-- Divider-->
45- < hr class ="my-4 " />
46- <!-- Post preview-->
47- < div class ="post-preview ">
48- < a href ="post.html ">
49- < h2 class ="post-title "> Science has not yet mastered prophecy</ h2 >
50- < h3 class ="post-subtitle "> We predict too much for the next year and yet far too little for the next ten.</ h3 >
51- </ a >
52- < p class ="post-meta ">
53- Posted by
54- < a href ="#! "> Start Bootstrap</ a >
55- on August 24, 2023
56- </ p >
57- </ div >
58- <!-- Divider-->
59- < hr class ="my-4 " />
60- <!-- Post preview-->
61- < div class ="post-preview ">
62- < a href ="post.html ">
63- < h2 class ="post-title "> Failure is not an option</ h2 >
64- < h3 class ="post-subtitle "> Many say exploration is part of our destiny, but it’s actually our duty to future generations.</ h3 >
65- </ a >
66- < p class ="post-meta ">
67- Posted by
68- < a href ="#! "> Start Bootstrap</ a >
69- on July 8, 2023
70- </ p >
71- </ div >
72- <!-- Divider-->
73- < hr class ="my-4 " />
7435 <!-- Pager-->
7536 < div class ="d-flex justify-content-end mb-4 "> < a class ="btn btn-primary text-uppercase " href ="#! "> Older Posts →</ a > </ div >
7637 </ div >
You can’t perform that action at this time.
0 commit comments