Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get app to load #3

Closed
jimbofreedman opened this issue Nov 16, 2015 · 2 comments
Closed

Can't get app to load #3

jimbofreedman opened this issue Nov 16, 2015 · 2 comments

Comments

@jimbofreedman
Copy link

jimbo@mako:~/dev$ mkvirtualenv -p /usr/bin/python3.4 gulptest
Running virtualenv with interpreter /usr/bin/python3.4
Using base prefix '/usr'
New python executable in gulptest/bin/python3.4
Also creating executable in gulptest/bin/python
Installing setuptools, pip, wheel...done.
(gulptest)jimbo@mako:~/dev$ pip install django django-gulp
Collecting django
  Using cached Django-1.8.6-py2.py3-none-any.whl
Collecting django-gulp
  Using cached django_gulp-2.1.1-py2.py3-none-any.whl
Collecting psutil==2.2.1 (from django-gulp)
Collecting futures==2.2.0 (from django-gulp)
  Using cached futures-2.2.0-py2.py3-none-any.whl
Collecting ansicolors==1.0.2 (from django-gulp)
Collecting env-tools==2.0 (from django-gulp)
  Using cached env_tools-2.0.0-py2.py3-none-any.whl
Collecting tini>=3.0.0 (from env-tools==2.0->django-gulp)
  Using cached tini-3.0.1-py2.py3-none-any.whl
Collecting six>=1.9.0 (from tini>=3.0.0->env-tools==2.0->django-gulp)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting configparser>=3.5.0b2 (from tini>=3.0.0->env-tools==2.0->django-gulp)
Installing collected packages: django, psutil, futures, ansicolors, six, configparser, tini, env-tools, django-gulp
Successfully installed ansicolors-1.0.2 configparser-3.5.0b2 django-1.8.6 django-gulp-2.1.1 env-tools-2.0.0 futures-2.2.0 psutil-2.2.1 six-1.10.0 tini-3.0.1
(gulptest)jimbo@mako:~/dev$ django-admin startproject gulptest
(gulptest)jimbo@mako:~/dev$ cd gulptest
(gulptest)jimbo@mako:~/dev/gulptest$ npm install gulp
npm WARN engine [email protected]: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.25","npm":"1.4.21"})
[email protected] node_modules/gulp
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
(gulptest)jimbo@mako:~/dev/gulptest$ echo "INSTALLED_APPS += ('django_gulp',)" >> gulptest/settings.py
(gulptest)jimbo@mako:~/dev/gulptest$ echo "var gulp = require('gulp'); gulp.task('default', function() { console.log('Gulp is working') });" > gulpfile.js
(gulptest)jimbo@mako:~/dev/gulptest$ gulp
[06:49:10] Using gulpfile ~/dev/gulptest/gulpfile.js
[06:49:10] Starting 'default'...
Gulp is working
[06:49:10] Finished 'default' after 95 μs
(gulptest)jimbo@mako:~/dev/gulptest$ ./manage.py migrate
Operations to perform:
  Synchronize unmigrated apps: staticfiles, django_gulp, messages
  Apply all migrations: contenttypes, admin, auth, sessions
Synchronizing apps without migrations:
  Creating tables...
    Running deferred SQL...
  Installing custom SQL...
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... 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 sessions.0001_initial... OK
(gulptest)jimbo@mako:~/dev/gulptest$ ./manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
November 16, 2015 - 06:49:17
Django version 1.8.6, using settings 'gulptest.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

I've spent a bit of time trying to work out why this wasn't loading in my existing project, and eventually decided to just see if I could get it working in an empty project. These are the steps I've taken.

When I try and inspect manually in the shell, everything seems fine:

C(gulptest)jimbo@mako:~/dev/gulptest$ ./manage.py shell
Python 3.4.3 (default, Mar 26 2015, 22:03:40)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.conf import settings
>>> print(settings.INSTALLED_APPS)
('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_gulp')
>>> from django_gulp.management.commands import runserver
>>> print(runserver)
<module 'django_gulp.management.commands.runserver' from '/home/jimbo/.virtualenvs/gulptest/lib/python3.4/site-packages/django_gulp/management/commands/runserver.py'>

... but on runserver, nothing gulp-related happens.

I tried cloning the repo and putting the django_gulp folder into my project directly - it seems that django_gulp/__init__.py executes, but django_gulp/management/__init.py__ does not (I put print statements in them)

Do you have any ideas what might be going on? Have you encountered this?

@jimbofreedman
Copy link
Author

Poking around the repo, and #1 solves my issue.

@beaugunderson
Copy link
Owner

I'm going to update #1, needed to do some research to further specify where in the INSTALLED_APPS list django_gulp needs to be; it doesn't need to be first but it does need to come before django.contrib.staticfiles. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants