I'm following a course online but am stuck, I'm using webpy
to create a little website on my localhost server. The CSS
and JavaScript
work perfectly on all pages but one, I'm not sure if it is to do with the regex in the url?
The CSS and Javascript is called on the Mainlayout html page and the page is called under the Navbar with $:page
I use the URL path: '/profile/(.*)/info', 'UserInfo',
and '/profile/(.*)', 'UserProfile',
Then define the classes as:
class UserProfile:
def GET(self, user):
login = LoginModel.LoginModel()
user_info = login.get_profile(user)
post_model = Posts.Posts()
posts = post_model.get_user_posts(user)
return render.Profile(posts, user_info)
class UserInfo:
def GET(self, user):
login = LoginModel.LoginModel()
user_info = login.get_profile(user)
return render.Info(user_info)
The CSS and JS are called on the main layout using:
$def with (page)
$var css: static/css/bootstrap.min.css static/css/bootstrap-material-design.min.css static/css/ripples.min.css static/css/jquery-ui.css static/css/custom.css static/css/materialdesignicons.min.css
$var js: static/js/jquery-3.2.1.min.js static/js/bootstrap.min.js static/js/material.min.js static/js/ripples.min.js static/js/scripty.js static/js/ripples.min.js static/js/jquery-ui.min.js static/js/material.min.js
$if self.css:
$for style in self.css.split():
<link rel="stylesheet" type="text/css" href="$style"/>
$if self.js:
$for script in self.js.split()
<script src="$script"></script>
These are the errors I get in the console:
Any tips on where I should look to get this working? I'm not sure what information I need to share for you to have the full picture so please ask if anything else is needed.