Reputation: 415
I am using Angular as my front end and Django as back end.
What I am facing is my server load the static file really slowly.Although,when I ran the server,the html shows the static file exist, but when I click on the url, it just keep load the file and eventually crashed.This is the GitHub link:https://github.com/Honesty1997/my-lotto-game.git
Hope you can help me find the problem!I am sure the django static file settings are all right!
Upvotes: 0
Views: 467
Reputation: 4579
I found some issues with your app
index_production.html
. You need to use single quote between two double quote.There is many places in your code miss using the double quote, please double check that. You can change your code this:
// +--------------------------------+---- use single quote instead
// v v
src="{% static '/node_modules/angular/angular.js' %}"
angular.module('app').component('myComponent', {
templateUrl: "/static/js/app.template.html", // <---- add '/' before static
controller: ['$http', appController],
});
src
|---facebooklotto
|---lotto
|---static
|---db.sqlite3
|---manage.py
And change your static file setting like this:
STATIC_URL = '/static/'
# STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
After making the changes above, I can run your webapp. Hope it would help...
Upvotes: 1