jrief / django-angular

Let AngularJS play well with Django
http://django-angular.awesto.com/
MIT License
1.23k stars 294 forks source link

Static files not showing up, css, js, angular while running the example #319

Closed amitasthana closed 6 years ago

amitasthana commented 6 years ago

Last login: Wed Sep 20 10:31:23 on ttys000 Amits-MacBook-Pro:da amitasthana$ cd Amits-MacBook-Pro:~ amitasthana$ da -bash: da: command not found Amits-MacBook-Pro:~ amitasthana$ cd Amits-MacBook-Pro:~ amitasthana$ source /usr/local/bin/virtualenvwrapper.sh Amits-MacBook-Pro:~ amitasthana$ mkvirtualenv da New python executable in /Users/amitasthana/.virtualenvs/da/bin/python2.7 Not overwriting existing python script /Users/amitasthana/.virtualenvs/da/bin/python (you must use /Users/amitasthana/.virtualenvs/da/bin/python2.7) Installing setuptools, pip, wheel...done. (da) Amits-MacBook-Pro:~ amitasthana$ cd da (da) Amits-MacBook-Pro:da amitasthana$ ls node_modules npm-debug.log package.json (da) Amits-MacBook-Pro:da amitasthana$ pwd /Users/amitasthana/da (da) Amits-MacBook-Pro:da amitasthana$ pip install django-angular Requirement already satisfied: django-angular in /Users/amitasthana/.virtualenvs/da/lib/python2.7/site-packages (da) Amits-MacBook-Pro:da amitasthana$ django-angular-admin startproject mysite -bash: django-angular-admin: command not found (da) Amits-MacBook-Pro:da amitasthana$ cd ../ (da) Amits-MacBook-Pro:~ amitasthana$ git clone https://github.com/jrief/django-angular/ Cloning into 'django-angular'... remote: Counting objects: 8158, done. remote: Compressing objects: 100% (113/113), done. remote: Total 8158 (delta 121), reused 155 (delta 88), pack-reused 7947 Receiving objects: 100% (8158/8158), 1.97 MiB | 62.00 KiB/s, done. Resolving deltas: 100% (5240/5240), done. (da) Amits-MacBook-Pro:~ amitasthana$ cd django-angular/ (da) Amits-MacBook-Pro:django-angular amitasthana$ ls AUTHORS.md README.md docs CONTRIBUTING.md authors-info.yml examples Dockerfile client setup.py LICENSE.txt djng tox.ini MANIFEST.in docker-files (da) Amits-MacBook-Pro:django-angular amitasthana$ pip install -e . Obtaining file:///Users/amitasthana/django-angular Installing collected packages: django-angular Found existing installation: django-angular 1.1.3 Uninstalling django-angular-1.1.3: Successfully uninstalled django-angular-1.1.3 Running setup.py develop for django-angular Successfully installed django-angular (da) Amits-MacBook-Pro:django-angular amitasthana$ ls AUTHORS.md README.md docker-files CONTRIBUTING.md authors-info.yml docs Dockerfile client examples LICENSE.txt django_angular.egg-info setup.py MANIFEST.in djng tox.ini (da) Amits-MacBook-Pro:django-angular amitasthana$ open . (da) Amits-MacBook-Pro:django-angular amitasthana$ cd examples/ (da) Amits-MacBook-Pro:examples amitasthana$ ls manage.py pytest.ini server package.json requirements.txt (da) Amits-MacBook-Pro:examples amitasthana$ python manage.py runserver Traceback (most recent call last): File "manage.py", line 9, in from django.core.management import execute_from_command_line ImportError: No module named django.core.management (da) Amits-MacBook-Pro:examples amitasthana$ cd ../ (da) Amits-MacBook-Pro:django-angular amitasthana$ ls AUTHORS.md README.md docker-files CONTRIBUTING.md authors-info.yml docs Dockerfile client examples LICENSE.txt django_angular.egg-info setup.py MANIFEST.in djng tox.ini (da) Amits-MacBook-Pro:django-angular amitasthana$ ls AUTHORS.md README.md docker-files CONTRIBUTING.md authors-info.yml docs Dockerfile client examples LICENSE.txt django_angular.egg-info setup.py MANIFEST.in djng tox.ini (da) Amits-MacBook-Pro:django-angular amitasthana$ ls AUTHORS.md README.md docker-files CONTRIBUTING.md authors-info.yml docs Dockerfile client examples LICENSE.txt django_angular.egg-info setup.py MANIFEST.in djng tox.ini (da) Amits-MacBook-Pro:django-angular amitasthana$ pip install -e . Obtaining file:///Users/amitasthana/django-angular Installing collected packages: django-angular Found existing installation: django-angular 1.1.3 Uninstalling django-angular-1.1.3: Successfully uninstalled django-angular-1.1.3 Running setup.py develop for django-angular Successfully installed django-angular (da) Amits-MacBook-Pro:django-angular amitasthana$ cd djng/ (da) Amits-MacBook-Pro:djng amitasthana$ open . (da) Amits-MacBook-Pro:djng amitasthana$ cd ../ (da) Amits-MacBook-Pro:django-angular amitasthana$ ls AUTHORS.md README.md docker-files CONTRIBUTING.md authors-info.yml docs Dockerfile client examples LICENSE.txt django_angular.egg-info setup.py MANIFEST.in djng tox.ini (da) Amits-MacBook-Pro:django-angular amitasthana$ pwd /Users/amitasthana/django-angular (da) Amits-MacBook-Pro:django-angular amitasthana$ cd examples/ (da) Amits-MacBook-Pro:examples amitasthana$ ls manage.py pytest.ini server package.json requirements.txt (da) Amits-MacBook-Pro:examples amitasthana$ pip install -r requirements.txt Collecting Django<2.0 (from -r requirements.txt (line 1)) Using cached Django-1.11.5-py2.py3-none-any.whl Collecting beautifulsoup4==4.6.0 (from -r requirements.txt (line 2)) Using cached beautifulsoup4-4.6.0-py2-none-any.whl Collecting cssselect==1.0.1 (from -r requirements.txt (line 3)) Using cached cssselect-1.0.1-py2.py3-none-any.whl Collecting django-classy-tags==0.8.0 (from -r requirements.txt (line 4)) Using cached django_classy_tags-0.8.0-py2.py3-none-any.whl Collecting django-sekizai==0.10.0 (from -r requirements.txt (line 5)) Using cached django_sekizai-0.10.0-py2.py3-none-any.whl Collecting easy-thumbnails==2.4.1 (from -r requirements.txt (line 6)) Using cached easy_thumbnails-2.4.1-py2.py3-none-any.whl Collecting gevent==1.2.2 (from -r requirements.txt (line 7)) Using cached gevent-1.2.2-cp27-cp27m-macosx_10_6_intel.whl Collecting greenlet==0.4.12 (from -r requirements.txt (line 8)) Collecting Pillow==4.1.1 (from -r requirements.txt (line 9)) Using cached Pillow-4.1.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Collecting pluggy==0.4.0 (from -r requirements.txt (line 10)) Using cached pluggy-0.4.0-py2.py3-none-any.whl Collecting py==1.4.34 (from -r requirements.txt (line 11)) Using cached py-1.4.34-py2.py3-none-any.whl Collecting Pygments==2.2.0 (from -r requirements.txt (line 12)) Using cached Pygments-2.2.0-py2.py3-none-any.whl Collecting pytz==2017.2 (from -r requirements.txt (line 13)) Using cached pytz-2017.2-py2.py3-none-any.whl Collecting redis==2.10.5 (from -r requirements.txt (line 14)) Using cached redis-2.10.5-py2.py3-none-any.whl Collecting six==1.10.0 (from -r requirements.txt (line 15)) Using cached six-1.10.0-py2.py3-none-any.whl Collecting wsaccel==0.6.2 (from -r requirements.txt (line 16)) Collecting olefile (from Pillow==4.1.1->-r requirements.txt (line 9)) Installing collected packages: pytz, Django, beautifulsoup4, cssselect, django-classy-tags, django-sekizai, olefile, Pillow, easy-thumbnails, greenlet, gevent, pluggy, py, Pygments, redis, six, wsaccel Successfully installed Django-1.11.5 Pillow-4.1.1 Pygments-2.2.0 beautifulsoup4-4.6.0 cssselect-1.0.1 django-classy-tags-0.8.0 django-sekizai-0.10.0 easy-thumbnails-2.4.1 gevent-1.2.2 greenlet-0.4.12 olefile-0.44 pluggy-0.4.0 py-1.4.34 pytz-2017.2 redis-2.10.5 six-1.10.0 wsaccel-0.6.2 (da) Amits-MacBook-Pro:examples amitasthana$ ./manage.py runserver Performing system checks...

System check identified no issues (0 silenced).

You have 15 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, easy_thumbnails, sessions. Run 'python manage.py migrate' to apply them.

September 20, 2017 - 07:46:01 Django version 1.11.5, using settings 'server.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. ^C(da) Amits-MacBook-Pro:examples amitasthana$ python manage.py migrate Operations to perform: Apply all migrations: admin, auth, contenttypes, easy_thumbnails, sessions Running migrations: Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying easy_thumbnails.0001_initial... OK Applying easy_thumbnails.0002_thumbnaildimensions... OK Applying sessions.0001_initial... OK (da) Amits-MacBook-Pro:examples amitasthana$ ./manage.py runserver Performing system checks...

System check identified no issues (0 silenced). September 20, 2017 - 07:46:27 Django version 1.11.5, using settings 'server.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [2017-09-20 07:46:36,207 basehttp] INFO: "GET / HTTP/1.1" 302 0 [2017-09-20 07:46:36,581 basehttp] INFO: "GET /classic_form/ HTTP/1.1" 200 28291 [2017-09-20 07:46:36,752 basehttp] WARNING: "GET /static/node_modules/angular/angular.js HTTP/1.1" 404 1706 [2017-09-20 07:46:36,758 basehttp] WARNING: "GET /static/node_modules/bootstrap/dist/css/bootstrap.css HTTP/1.1" 404 1748 [2017-09-20 07:46:36,913 basehttp] INFO: "GET /static/js/djng-forms.js HTTP/1.1" 200 12342 [2017-09-20 07:46:36,915 basehttp] INFO: "GET /static/djng/css/bootstrap3.css HTTP/1.1" 200 160 [2017-09-20 07:46:36,915 basehttp] INFO: "GET /static/djng/css/styles.css HTTP/1.1" 200 830 [2017-09-20 07:46:36,915 basehttp] INFO: "GET /static/js/djng-tutorial.js HTTP/1.1" 200 415 [2017-09-20 07:46:36,916 basehttp] INFO: "GET /static/css/djangular-demo.css HTTP/1.1" 200 6662 [2017-09-20 07:46:37,253 basehttp] WARNING: "GET /static/node_modules/angular/angular.js HTTP/1.1" 404 1706 [2017-09-20 07:46:38,151 base] WARNING: Not Found: /favicon.ico [2017-09-20 07:46:38,152 basehttp] WARNING: "GET /favicon.ico HTTP/1.1" 404 3116 [2017-09-20 07:46:48,524 basehttp] WARNING: "GET /static/node_modules/bootstrap/dist/css/bootstrap.css HTTP/1.1" 404 1748 ^C(da) Amits-MacBook-Pro:examples amitasthana$ ls manage.py pytest.ini server package.json requirements.txt test.sqlite (da) Amits-MacBook-Pro:examples amitasthana$ pwd /Users/amitasthana/django-angular/examples (da) Amits-MacBook-Pro:examples amitasthana$ cd ../ (da) Amits-MacBook-Pro:django-angular amitasthana$ pwd /Users/amitasthana/django-angular (da) Amits-MacBook-Pro:django-angular amitasthana$ npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults.

See npm help json for definitive documentation on these fields and exactly what they do.

Use npm install <pkg> --save afterwards to install a package and save it as a dependency in the package.json file.

Press ^C at any time to quit. name: (django-angular) version: (1.0.0) description: entry point: (index.js) test command: git repository: (https://github.com/jrief/django-angular/) keywords: author: license: (ISC) About to write to /Users/amitasthana/django-angular/package.json:

{ "name": "django-angular", "version": "1.0.0", "description": "Let Django play well with AngularJS", "main": "index.js", "directories": { "doc": "docs", "example": "examples" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "https://github.com/jrief/django-angular/" }, "author": "", "license": "ISC" }

Is this ok? (yes) (da) Amits-MacBook-Pro:django-angular amitasthana$ npm install angular@~1.5 --save django-angular@1.0.0 /Users/amitasthana/django-angular └── angular@1.5.11

(da) Amits-MacBook-Pro:django-angular amitasthana$ cd examples/ (da) Amits-MacBook-Pro:examples amitasthana$ ls manage.py pytest.ini server package.json requirements.txt test.sqlite (da) Amits-MacBook-Pro:examples amitasthana$ python manage.py runserver Performing system checks...

System check identified no issues (0 silenced). September 20, 2017 - 07:49:40 Django version 1.11.5, using settings 'server.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [2017-09-20 07:49:47,662 basehttp] INFO: "GET / HTTP/1.1" 302 0 [2017-09-20 07:49:48,141 basehttp] INFO: "GET /classic_form/ HTTP/1.1" 200 28291 [2017-09-20 07:49:48,195 basehttp] INFO: "GET /static/js/djng-forms.js HTTP/1.1" 304 0 [2017-09-20 07:49:48,211 basehttp] WARNING: "GET /static/node_modules/bootstrap/dist/css/bootstrap.css HTTP/1.1" 404 1748 [2017-09-20 07:49:48,221 basehttp] WARNING: "GET /static/node_modules/angular/angular.js HTTP/1.1" 404 1706 [2017-09-20 07:49:48,222 basehttp] INFO: "GET /static/css/djangular-demo.css HTTP/1.1" 304 0 [2017-09-20 07:49:48,224 basehttp] INFO: "GET /static/djng/css/bootstrap3.css HTTP/1.1" 304 0 [2017-09-20 07:49:48,224 basehttp] INFO: "GET /static/js/djng-tutorial.js HTTP/1.1" 304 0 [2017-09-20 07:49:48,225 basehttp] INFO: "GET /static/djng/css/styles.css HTTP/1.1" 304 0 [2017-09-20 07:49:49,037 basehttp] WARNING: "GET /static/node_modules/angular/angular.js HTTP/1.1" 404 1706 [2017-09-20 07:50:06,423 basehttp] WARNING: "GET /static/node_modules/bootstrap/dist/css/bootstrap.css HTTP/1.1" 404 1748 ^C(da) Amits-MacBook-Pro:examples amitasthana$ ls manage.py pytest.ini server package.json requirements.txt test.sqlite (da) Amits-MacBook-Pro:examples amitasthana$ npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults.

See npm help json for definitive documentation on these fields and exactly what they do.

Use npm install <pkg> --save afterwards to install a package and save it as a dependency in the package.json file.

Press ^C at any time to quit. name: (django-angular) version: (1.1.0) git repository: keywords: license: (MIT) About to write to /Users/amitasthana/django-angular/examples/package.json:

{ "name": "django-angular", "version": "1.1.0", "description": "Demo for django-angular", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Jacob Rief", "license": "MIT", "dependencies": { "angular": "~1.5.11", "bootstrap": "^3.3.7", "ng-file-upload": "^12.2.13" } }

Is this ok? (yes) (da) Amits-MacBook-Pro:examples amitasthana$ npm install angular@~1.5 --save django-angular@1.1.0 /Users/amitasthana/django-angular/examples └── angular@1.5.11

npm WARN django-angular@1.1.0 No repository field. (da) Amits-MacBook-Pro:examples amitasthana$ npm install angular@~1.5 --save django-angular@1.1.0 /Users/amitasthana/django-angular/examples └── angular@1.5.11

npm WARN django-angular@1.1.0 No repository field. (da) Amits-MacBook-Pro:examples amitasthana$ ./manage.py runserver Performing system checks...

System check identified no issues (0 silenced). September 20, 2017 - 07:54:57 Django version 1.11.5, using settings 'server.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [2017-09-20 07:55:08,209 basehttp] INFO: "GET / HTTP/1.1" 302 0 [2017-09-20 07:55:08,452 basehttp] INFO: "GET /classic_form/ HTTP/1.1" 200 28291 [2017-09-20 07:55:08,474 basehttp] INFO: "GET /static/js/djng-forms.js HTTP/1.1" 304 0 [2017-09-20 07:55:08,485 basehttp] INFO: "GET /static/css/djangular-demo.css HTTP/1.1" 304 0 [2017-09-20 07:55:08,486 basehttp] INFO: "GET /static/djng/css/bootstrap3.css HTTP/1.1" 304 0 [2017-09-20 07:55:08,487 basehttp] INFO: "GET /static/js/djng-tutorial.js HTTP/1.1" 304 0 [2017-09-20 07:55:08,487 basehttp] INFO: "GET /static/djng/css/styles.css HTTP/1.1" 304 0 [2017-09-20 07:55:08,488 basehttp] WARNING: "GET /static/node_modules/bootstrap/dist/css/bootstrap.css HTTP/1.1" 404 1748 [2017-09-20 07:55:09,009 basehttp] INFO: "GET /static/node_modules/angular/angular.js HTTP/1.1" 200 1221184

adrienbrunet commented 6 years ago

Hi, could you provide a bit less output in the future, it's harder to read and does not really help to understand tour problem.

adrienbrunet commented 6 years ago

It looks like it's more a django related problem than a django-angular one. I suggest you to ask for support on StackOverFlow, irc or any channel that seems appropriate. You can (and should) first see the django docs on How to handle static files.

We sadly can"t afford to give support for django only related problem.

Hope this helps a bit.