Ember-cli taking a long time to build after app migration - ember.js

I recently migrated an ember app that I was compiling using bower to ember-cli. It had already grown pretty large, but I was running into issues with my current dev environment and ember-cli seems like the cleaner solution.
Unfortunately, after updating the files for the ember-cli interface, the build isn't working. I have left it running for 5 minutes at 100% CPU, and it reached two dots after Building.. and stopped.
I am using Sublime text, but I updated my preferences under http://www.ember-cli.com/#commonissues. I added broccoli-sass using npm and ember-data.model-fragments using ember install:addon. Below is my package.json
{
"name": "frontend",
"version": "0.0.0",
"description": "Small description for frontend goes here",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember test"
},
"repository": "",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.0.0",
"broccoli-sass": "git://github.com/aexmachina/broccoli-sass#sources-content",
"ember-cli": "0.1.11",
"ember-cli-6to5": "^3.0.0",
"ember-cli-app-version": "0.3.0",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-htmlbars": "^0.6.0",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-qunit": "0.3.0",
"ember-cli-uglify": "1.0.1",
"ember-data": "1.0.0-beta.14.1",
"ember-data-model-fragments": "0.2.7",
"ember-export-application-global": "^1.0.0",
"express": "^4.8.5",
"glob": "^4.0.5"
}
}
and here is my app file tree. I'm wondering if it has something to do with all the folders I added (objects, definitions, libraries, etc).
app
├── app.js
├── components
│   ├── dual-slider.js
│   ├── scroll-arrow.js
│   ├── single-slider.js
│   └── square-div.js
├── controllers
│   ├── application.js
│   ├── authentication
│   │   ├── login.js
│   │   └── signup.js
│   ├── demos
│   │   ├── derivatives.js
│   │   ├── integrals.js
│   │   └── revolutions.js
│   ├── flash.js
│   ├── index.js
│   ├── lessons
│   │   ├── index.js
│   │   ├── new
│   │   │   ├── create-step.js
│   │   │   ├── index.js
│   │   │   └── step.js
│   │   ├── new.js
│   │   ├── show
│   │   │   ├── index.js
│   │   │   └── step.js
│   │   └── show.js
│   └── subjects
│   ├── index.js
│   └── show.js
├── definitions
│   ├── animationKeys.js
│   ├── stepArray.js
│   └── typeKeys.js
├── helpers
│   ├── focus-input.js
│   └── slider-label-input.js
├── index.html
├── initializers
│   └── session-setup.js
├── libraries
│   └── mathAnimationLibrary
│   ├── dist
│   │   ├── display-library.js
│   │   └── vendor
│   │   ├── math.js
│   │   ├── three.js
│   │   ├── trackballControls.js
│   │   └── zgentilis_bold.typeface.js
│   └── src
│   ├── DisplayLibrary.js
│   └── functions
│   ├── create2DFunction.js
│   ├── createAxis.js
│   ├── createIntegralDisplay.js
│   ├── createRotationFunction.js
│   ├── createSurface.js
│   ├── mathEnvironment.js
│   └── showDerivative.js
├── mixins
│   └── animation.js
├── models
│   ├── animation-params.js
│   ├── animation.js
│   ├── choice.js
│   ├── equation-part.js
│   ├── equation.js
│   ├── explanation.js
│   ├── instruction.js
│   ├── lesson-step-type.js
│   ├── lesson-step.js
│   ├── lesson.js
│   ├── multiple-choice.js
│   ├── special-animation-params.js
│   ├── subject.js
│   └── user.js
├── objects
│   ├── flash-queue.js
│   ├── flash.js
│   └── session.js
├── router.js
├── routes
│   ├── index.js
│   ├── lessons
│   │   ├── index.js
│   │   ├── new
│   │   │   ├── create-step.js
│   │   │   ├── index.js
│   │   │   └── step.js
│   │   ├── new.js
│   │   ├── show
│   │   │   ├── index.js
│   │   │   └── step.js
│   │   └── show.js
│   ├── logout.js
│   └── subjects
│   ├── index.js
│   └── show.js
├── serializers
│   ├── application.js
│   └── lesson.js
├── styles
│   ├── app.scss
│   ├── reset.css
│   └── sass
│   ├── authentication
│   │   └── authentication.scss
│   ├── colors.scss
│   ├── components
│   │   ├── scroll-arrow.scss
│   │   ├── slider.scss
│   │   └── square-div.scss
│   ├── helpers
│   │   └── flash.scss
│   ├── lessons
│   │   ├── multiple-choice.scss
│   │   └── show.scss
│   ├── main.scss
│   ├── mixins.scss
│   └── root
│   ├── demos.scss
│   ├── header.scss
│   └── index.scss
├── templates
│   ├── about
│   │   └── index.hbs
│   ├── application.hbs
│   ├── backend.hbs
│   ├── components
│   │   ├── dual-slider.hbs
│   │   ├── scroll-arrow.hbs
│   │   ├── single-slider.hbs
│   │   └── square-div.hbs
│   ├── demos
│   │   ├── derivatives.hbs
│   │   ├── index.hbs
│   │   ├── integrals.hbs
│   │   └── revolutions.hbs
│   ├── index.hbs
│   ├── lessons
│   │   ├── equationViewer.hbs
│   │   ├── index.hbs
│   │   ├── multipleChoice.hbs
│   │   ├── new
│   │   │   ├── createStep.hbs
│   │   │   ├── index.hbs
│   │   │   └── step.hbs
│   │   ├── new.hbs
│   │   ├── show
│   │   │   ├── index.hbs
│   │   │   └── step.hbs
│   │   └── show.hbs
│   ├── login.hbs
│   ├── shared
│   ├── signup.hbs
│   └── subjects
│   ├── index.hbs
│   └── show.hbs
└── views
├── demos
│   ├── derivatives.js
│   ├── integrals.js
│   └── revolutions.js
├── flash.js
└── lessons
├── equationViewer.js
└── multipleChoice.js
It's also possible that I missed an import/export somewhere in the file transfer. Would this fail silently as I am seeing or would it raise an error?
I appreciate any insight that you might have.

So apparently there is already some discussion about this on the issues board. Particularly, ember-cli-6to5 is apparently messing with build times in the recent version of ember-cli. After removing that component (you lose functionality aside from modules) it builds much faster. See this discussion for more detail https://github.com/ember-cli/ember-cli/issues/3136.

Related

i cannot properly link boost.JSON to my project using CMake

Tree level overview of my project:
├── build
│   ├── build.ninja
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   │   ├── 3.18.0-rc1
│   │   ├── cmake.check_cache
│   │   ├── CMakeError.log
│   │   ├── CMakeOutput.log
│   │   ├── CMakeTmp
│   │   ├── cmake.verify_globs
│   │   ├── hftbot.dir
│   │   ├── Makefile2
│   │   ├── progress.marks
│   │   ├── rules.ninja
│   │   ├── TargetDirectories.txt
│   │   └── VerifyGlobs.cmake
│   ├── cmake_install.cmake
│   ├── compile_commands.json
│   ├── details.json
│   ├── external
│   │   └── json
│   ├── hftbot
│   ├── Makefile
│   └── src
│   ├── CMakeFiles
│   ├── cmake_install.cmake
│   └── Makefile
├── build.sh
├── CMakeLists.txt
├── configure.sh
├── details.json
├── external
│   ├── asio
│   │   ├── CMakeLists.txt
│   │   ├── doc
│   │   ├── example
│   │   ├── include
│   │   ├── index.html
│   │   ├── meta
│   │   ├── test
│   │   └── tools
│   ├── CMakeLists.txt
│   └── json
│   ├── bench
│   ├── build
│   ├── CHANGELOG.md
│   ├── check
│   ├── cmake
│   ├── CMakeLists.txt
│   ├── CONTRIBUTING.md
│   ├── doc
│   ├── example
│   ├── fuzzing
│   ├── include
│   ├── index.html
│   ├── Jamfile
│   ├── LICENSE_1_0.txt
│   ├── meta
│   ├── README.md
│   ├── src
│   └── test
├── run.sh
└── src
├── CMakeLists.txt
├── httpClient.cpp
└── WebsocketClient.cpp
https://github.com/boostorg/json
i cloned this project to "external/json" directory from root directory.
I added following commands in CMakeLists.txt in the root directory
target_include_directories(${PROJECT_NAME} PUBLIC "external/json/include")
target_link_libraries(${PROJECT_NAME} PUBLIC boost_json)
And when i add this :
#include <boost/json.hpp>
#include <boost/json/src.hpp>
it says that source boost/json.hpp and boost/json/src.hpp is not found.

How can I link locally installed SDK's static library in my C++ project?

I have been working on a C++ project which depends on RPLidar SDK. I have already installed the SDK as per the instructions in the README. (FYI: I couldn't install it in the /usr/local/ directory using sudo make install command). As per the SDK documentation:
When developing via RPLIDAR SDK, developers only need to include SDK’s
external header files (under sdk\include) into their own source code and link the
application with SDK’s static library (rplidar_driver.lib or rplidar_driver.a).
So, in my CMakeLists.txt, I have already added:
include_directories(/home/milan/rplidar_sdk/sdk/sdk/include/)
However, I couldn't find rplidar_driver.lib or rplidar_driver.h. Here, is the directory structure of the SDK:
.
├── docs
│   ├── ReleaseNote.v1.10.0.md
│   | ...
│   └── ReleaseNote.v1.9.1.md
├── LICENSE
├── README.md
├── sdk
│   ├── app
│   │   ├── frame_grabber
│   │   │   ├── AboutDlg.cpp
│   │   │   ├── AboutDlg.h
│   │   │   ├── drvlogic
│   │   │   │   ├── common.h
│   │   │   │   ├── lidarmgr.cpp
│   │   │   │   └── lidarmgr.h
│   │   │   ├── framegrabber.cpp
│   │   │   ├── framegrabber.h
│   │   │   ├── framegrabber.rc
│   │   │   ├── FreqSetDlg.cpp
│   │   │   ├── FreqSetDlg.h
│   │   │   ├── MainFrm.cpp
│   │   │   ├── MainFrm.h
│   │   │   ├── ref
│   │   │   │   └── wtl
│   │   │   │   ├── atlapp.h
│   │   │   │   ├── atlcrack.h
│   │   │   │   ├── atlctrls.h
│   │   │   │   ├── atlctrlw.h
│   │   │   │   ├── atlctrlx.h
│   │   │   │   ├── atlddx.h
│   │   │   │   ├── atldlgs.h
│   │   │   │   ├── atldwm.h
│   │   │   │   ├── atlfind.h
│   │   │   │   ├── atlframe.h
│   │   │   │   ├── atlgdi.h
│   │   │   │   ├── atlmisc.h
│   │   │   │   ├── atlprint.h
│   │   │   │   ├── atlresce.h
│   │   │   │   ├── atlres.h
│   │   │   │   ├── atlribbon.h
│   │   │   │   ├── atlscrl.h
│   │   │   │   ├── atlsplit.h
│   │   │   │   ├── atltheme.h
│   │   │   │   ├── atluser.h
│   │   │   │   ├── atlwince.h
│   │   │   │   └── atlwinx.h
│   │   │   ├── res
│   │   │   │   ├── rplidar.ico
│   │   │   │   └── Toolbar.bmp
│   │   │   ├── resource.h
│   │   │   ├── scanView.cpp
│   │   │   ├── scanView.h
│   │   │   ├── SerialSelDlg.cpp
│   │   │   ├── SerialSelDlg.h
│   │   │   ├── stdafx.cpp
│   │   │   ├── stdafx.h
│   │   │   ├── TcpChannelSelDlg.cpp
│   │   │   └── TcpChannelSelDlg.h
│   │   ├── Makefile
│   │   ├── simple_grabber
│   │   │   ├── main.cpp
│   │   │   └── Makefile
│   │   └── ultra_simple
│   │   ├── main.cpp
│   │   └── Makefile
│   ├── cross_compile.sh
│   ├── mak_common.inc
│   ├── mak_def.inc
│   ├── Makefile
│   ├── obj
│   │   └── Linux
│   │   └── Release
│   │   ├── sdk
│   │   │   └── src
│   │   │   ├── arch
│   │   │   │   └── linux
│   │   │   │   ├── net_serial.o
│   │   │   │   ├── net_socket.o
│   │   │   │   └── timer.o
│   │   │   ├── hal
│   │   │   │   └── thread.o
│   │   │   └── rplidar_driver.o
│   │   ├── simple_grabber
│   │   │   └── main.o
│   │   └── ultra_simple
│   │   └── main.o
│   ├── output
│   │   └── Linux
│   │   └── Release
│   │   ├── librplidar_sdk.a
│   │   ├── simple_grabber
│   │   └── ultra_simple
│   ├── sdk
│   │   ├── include
│   │   │   ├── rplidar_cmd.h
│   │   │   ├── rplidar_driver.h
│   │   │   ├── rplidar.h
│   │   │   ├── rplidar_protocol.h
│   │   │   └── rptypes.h
│   │   ├── Makefile
│   │   └── src
│   │   ├── arch
│   │   │   ├── linux
│   │   │   │   ├── arch_linux.h
│   │   │   │   ├── net_serial.cpp
│   │   │   │   ├── net_serial.h
│   │   │   │   ├── net_socket.cpp
│   │   │   │   ├── thread.hpp
│   │   │   │   ├── timer.cpp
│   │   │   │   └── timer.h
│   │   │   ├── macOS
│   │   │   │   ├── arch_macOS.h
│   │   │   │   ├── net_serial.cpp
│   │   │   │   ├── net_serial.h
│   │   │   │   ├── net_socket.cpp
│   │   │   │   ├── thread.hpp
│   │   │   │   ├── timer.cpp
│   │   │   │   └── timer.h
│   │   │   └── win32
│   │   │   ├── arch_win32.h
│   │   │   ├── net_serial.cpp
│   │   │   ├── net_serial.h
│   │   │   ├── net_socket.cpp
│   │   │   ├── timer.cpp
│   │   │   ├── timer.h
│   │   │   └── winthread.hpp
│   │   ├── hal
│   │   │   ├── abs_rxtx.h
│   │   │   ├── assert.h
│   │   │   ├── byteops.h
│   │   │   ├── event.h
│   │   │   ├── locker.h
│   │   │   ├── socket.h
│   │   │   ├── thread.cpp
│   │   │   ├── thread.h
│   │   │   ├── types.h
│   │   │   └── util.h
│   │   ├── rplidar_driver.cpp
│   │   ├── rplidar_driver_impl.h
│   │   ├── rplidar_driver_serial.h
│   │   ├── rplidar_driver_TCP.h
│   │   └── sdkcommon.h
│   └── workspaces
│   ├── vc10
│   │   ├── frame_grabber
│   │   │   ├── frame_grabber.vcxproj
│   │   │   └── frame_grabber.vcxproj.filters
│   │   ├── rplidar_driver
│   │   │   ├── rplidar_driver.vcxproj
│   │   │   └── rplidar_driver.vcxproj.filters
│   │   ├── sdk_and_demo.sln
│   │   ├── simple_grabber
│   │   │   ├── simple_grabber.vcxproj
│   │   │   └── simple_grabber.vcxproj.filters
│   │   └── ultra_simple
│   │   ├── ultra_simple.vcxproj
│   │   └── ultra_simple.vcxproj.filters
│   └── vc14
│   ├── frame_grabber
│   │   ├── frame_grabber.vcxproj
│   │   └── frame_grabber.vcxproj.filters
│   ├── rplidar_driver
│   │   ├── rplidar_driver.vcxproj
│   │   └── rplidar_driver.vcxproj.filters
│   ├── sdk_and_demo.sln
│   ├── simple_grabber
│   │   ├── simple_grabber.vcxproj
│   │   └── simple_grabber.vcxproj.filters
│   └── ultra_simple
│   ├── ultra_simple.vcxproj
│   └── ultra_simple.vcxproj.filters
└── tools
└── cp2102_driver
└── CP210x_Windows_Drivers.zip
Now, in my main.cpp, I have this line: #include <rplidar.h>. I can successfully run cmake .. command in the build directory of my project. However, upon running make command, it's giving me this error:
In file included from /home/milan/<project>/src/main.cpp:3:0:
/home/milan/rplidar_sdk/sdk/sdk/include/rplidar.h:38:10: fatal error: hal/types.h: No such file or directory
#include "hal/types.h"
^~~~~~~~~~~~~
compilation terminated.
CMakeFiles/<project>.dir/build.make:81: recipe for target 'CMakeFiles/<project>.dir/src/main.cpp.o' failed
make[2]: *** [CMakeFiles/<project>.dir/src/main.cpp.o] Error 1
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/<project>.dir/all' failed
make[1]: *** [CMakeFiles/<project>.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2
Here is my complete CMakeLists.txt:
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(<project>)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
include_directories(include)
include_directories(/home/milan/rplidar_sdk/sdk/sdk/include/)
add_executable(${PROJECT_NAME} src/main.cpp)
How can I fix this?
Since you already compiled the library, create an IMPORTED target that references the sdk/include and sdk/src directories as include path:
add_library(rplidar STATIC IMPORTED)
set_property(TARGET rplidar
PROPERTY IMPORTED_LOCATION /home/milan/rplidar_sdk/output/Linux/Release/librplidar_sdk.a)
target_include_directories(rplidar INTERFACE
/home/milan/rplidar_sdk/sdk/sdk/include/
/home/milan/rplidar_sdk/sdk/sdk/src/)
You may even need to add the sdk/arch/linux directory to the include path.
And now you can link that library to your main file by doing:
target_link_libraries(${PROJECT_NAME} rplidar)
If someone is directly looking for the updated CMakeLists.txt then here it is (special thanks to #Botje):
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(<project_name>)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
SET(CMAKE_CXX_FLAGS -pthread)
include_directories(include)
add_executable(${PROJECT_NAME} src/main.cpp src/another_src_file.cpp)
## RPLidar
# Update the following path variable as per the RPLidar SDK installation in your system!
set(RPLIDAR_SDK_PATH "/home/milan/rplidar_sdk/")
add_library(rplidar STATIC IMPORTED)
set_property(TARGET rplidar
PROPERTY IMPORTED_LOCATION ${RPLIDAR_SDK_PATH}/sdk/output/Linux/Release/librplidar_sdk.a)
target_include_directories(rplidar INTERFACE
${RPLIDAR_SDK_PATH}/sdk/sdk/include/
${RPLIDAR_SDK_PATH}/sdk/sdk/src/)
target_link_libraries(${PROJECT_NAME} rplidar)
Note: First, you have to build rplidar_sdk

Heroku and Django: Couldn't find that process type (web)

I know this has been asked a lot of times but none of the solutions seem to work. I am trying to run a Django app in Heroku but am running into issues when I try to scale dynos.
➜ main-website git:(master) heroku ps:scale web=1
Scaling dynos... !
▸ Couldn't find that process type (web).
The issue seems to be related to ProcFile. This is what I have configured in my root directory (same as requirements.txt etc).
web: gunicorn main-website.wsgi:application --log-file -
What am I missing or doing wrong so I can correct this?
Project Structure
➜ main-website git:(master) tree -L 3
.
├── app
│   ├── about
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── __init__.py
│   │   ├── migrations
│   │   ├── models.py
│   │   ├── __pycache__
│   │   ├── tests.py
│   │   ├── urls.py
│   │   └── views.py
│   ├── app
│   │   ├── asgi.py
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── contact
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── __init__.py
│   │   ├── migrations
│   │   ├── models.py
│   │   ├── __pycache__
│   │   ├── tests.py
│   │   ├── urls.py
│   │   └── views.py
│   ├── core
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── __init__.py
│   │   ├── migrations
│   │   ├── models.py
│   │   ├── __pycache__
│   │   ├── tests
│   │   ├── tests.py
│   │   └── views.py
│   ├── db.sqlite3
│   ├── home
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── __init__.py
│   │   ├── migrations
│   │   ├── models.py
│   │   ├── __pycache__
│   │   ├── static
│   │   ├── tests.py
│   │   ├── urls.py
│   │   └── views.py
│   ├── manage.py
│   ├── privacy
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── __init__.py
│   │   ├── migrations
│   │   ├── models.py
│   │   ├── __pycache__
│   │   ├── tests.py
│   │   ├── urls.py
│   │   └── views.py
│   ├── static
│   │   ├── app
│   │   ├── css
│   │   ├── images
│   │   └── scripts
│   └── templates
│   ├── about.html
│   ├── contact.html
│   ├── footer.html
│   ├── header.html
│   ├── home.html
│   ├── layout.html
│   ├── privacy.html
│   └── slider.html
├── docker-compose.yml
├── Dockerfile
├── LICENSE
├── ProcFile
└── requirements.txt
The file name is Procfile not ProcFile.
Then try this web: gunicorn main-website.wsgi:application --log-file -

How can i create a zipped file made of a choice of FileFields/ImageFields when i save my model object?

edit: the code to create the zip file and add it to my zip_press_kit field actually works, but i still can't get the url to download it in my template (see points 4 and 5 to see what appends)
1) I have a model:
class Book(models.Model):
...
press_kit = models.FileField(upload_to='press_kit/',
verbose_name="Dossier de presse",
blank=True,
null=True,
default=None)
high_res_cover = models.ImageField(upload_to='high_res_covers/',
verbose_name="Couverture HD",
blank=True)
zip_press_kit = models.FileField(upload_to='zips/',
blank=True,
null=True)
I just gave the fields i'm interested into.
So when i save my new Book object in the django-admin i want to check if i have a high_res_cover OR a press_kit, and if so, create a zip_press_kit that would be a zip file containing the high_res_cover and/or the press_kit.
2) I have a save method:
def save(self, *args, **kwargs):
zip_file_name = f"{slugify(f'{self.title}-{self.id}')}.zip"
if self.high_res_cover or self.press_kit:
with ZipFile(f'{MEDIA_ROOT}zips/{zip_file_name}', 'w') as zip_file:
if self.high_res_cover:
zip_file.write(f'{MEDIA_ROOT}{self.high_res_cover}', os.path.basename(f'{MEDIA_ROOT}/{self.high_res_cover}'))
if self.press_kit:
zip_file.write(f'{MEDIA_ROOT}{self.press_kit}', os.path.basename(f'{MEDIA_ROOT}/{self.press_kit}'))
self.zip_press_kit = File(open(f'{MEDIA_ROOT}/zips/{zip_file_name}', 'rb'))
os.remove(f'{MEDIA_ROOT}/zips/{zip_file_name}')
else:
self.zip_press_kit = None
super(Book, self).save(*args, **kwargs)
This code works when my book already exists and I call save on it but when i want to get the URL of the file in my template i get something like 'localhost:8000/Users/me/Desktop/ProjectFIle.../'.
3) Tree of the project:
.
├── Entremonde
│   ├── __init__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   ├── settings.cpython-37.pyc
│   │   ├── urls.cpython-37.pyc
│   │   └── wsgi.cpython-37.pyc
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── Pipfile
├── Pipfile.lock
├── __pycache__
│   └── manage.cpython-37.pyc
├── books
│   ├── __init__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   ├── admin.cpython-37.pyc
│   │   ├── apps.cpython-37.pyc
│   │   ├── models.cpython-37.pyc
│   │   ├── urls.cpython-37.pyc
│   │   └── views.cpython-37.pyc
│   ├── admin.py
│   ├── apps.py
│   ├── management
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   └── __init__.cpython-37.pyc
│   │   └── commands
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-37.pyc
│   │   │   └── books_init.cpython-37.pyc
│   │   └── books_init.py
│   ├── migrations
│   │   ├── 0001_initial.py
│   │   ├── 0002_book_display.py
│   │   ├── __init__.py
│   │   └── __pycache__
│   │   ├── 0001_initial.cpython-37.pyc
│   │   └── __init__.cpython-37.pyc
│   ├── models.py
│   ├── static
│   │   └── books
│   │   └── js
│   ├── templates
│   │   └── books
│   │   ├── authors.html
│   │   ├── book.html
│   │   └── catalogue.html
│   ├── tests.py
│   ├── urls.py
│   └── views.py
├── contacts
│   ├── __init__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   ├── admin.cpython-37.pyc
│   │   ├── apps.cpython-37.pyc
│   │   ├── models.cpython-37.pyc
│   │   ├── urls.cpython-37.pyc
│   │   └── views.cpython-37.pyc
│   ├── admin.py
│   ├── apps.py
│   ├── migrations
│   │   ├── 0001_initial.py
│   │   ├── 0002_contact_postal_code.py
│   │   ├── __init__.py
│   │   └── __pycache__
│   │   ├── 0001_initial.cpython-37.pyc
│   │   ├── 0002_contact_postal_code.cpython-37.pyc
│   │   └── __init__.cpython-37.pyc
│   ├── models.py
│   ├── templates
│   │   └── contacts
│   │   ├── contacts.html
│   │   └── esapce-pro.html
│   ├── tests.py
│   ├── urls.py
│   └── views.py
├── db.json
├── manage.py
├── media
│   ├── covers
│   │   ├── ...
│   │   └── 25RUPTURE-Couverture_fisher_600px_web.jpg
│   ├── ebooks
│   ├── high_res_covers
│   │   └── HDj_tschichold-nouvelle_typo-couv.jpg
│   ├── posters_events
│   ├── press_kit
│   │   ├── ...
│   │   └── DPentremonde-dossierdepresse_fisher-2.pdf
│   └── zips
│   └── le-realisme-capitaliste-none.zip
├── news
│   ├── __init__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   ├── admin.cpython-37.pyc
│   │   ├── apps.cpython-37.pyc
│   │   ├── models.cpython-37.pyc
│   │   ├── urls.cpython-37.pyc
│   │   └── views.cpython-37.pyc
│   ├── admin.py
│   ├── apps.py
│   ├── migrations
│   │   ├── 0001_initial.py
│   │   ├── __init__.py
│   │   └── __pycache__
│   │   ├── 0001_initial.cpython-37.pyc
│   │   └── __init__.cpython-37.pyc
│   ├── models.py
│   ├── templates
│   │   └── news
│   │   └── rencontres.html
│   ├── tests.py
│   ├── urls.py
│   └── views.py
├── static
│   ├── css
│   │   ├── authors.css
│   │   ├── elements.css
│   │   ├── entremonde-style.css
│   │   ├── font.css
│   │   └── style.css
│   └── js
│   ├── author.js
│   └── script.js
└── templates
└── base.html
4) how i import the url in my template (also tried with book.zip_press_kit.url ):
<div id="press-kits">
{% for book in books_with_press_kit %}
{{ book.title }}<br>
{% endfor %}
</div>
5) What i get when i click the link:
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/Users/pshop/Desktop/Entremonde/media/zips/le-realisme-capitaliste-2_QAeRykR.zip

No module names URLs on Django with mod_wsgi?

I am trying to run a Django project using Apache2 mod_wsgi on my Debian 6 machine. This project runs fine if I start this project with the development server. But now I get this error:
Exception Type: ImportError at /
Exception Value: No module named urls
My project name is genalytics. There's only one app called fileupload. I have this available on my settings.py:
ROOT_URLCONF = 'genalytics.urls'
Here's the tree structure of my project:
genalytics/
├── fileupload
│   ├── backend.py
│   ├── backend.pyc
│   ├── backends.py
│   ├── backends.pyc
│   ├── django.wsgi
│   ├── encrypt.py
│   ├── encrypt.pyc
│   ├── forms.py
│   ├── forms.pyc
│   ├── functions.py
│   ├── functions.pyc
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── middleware.py
│   ├── middleware.pyc
│   ├── models.py
│   ├── models.pyc
│   ├── static
│   │   ├── admin
│   │   │   ├── css
│   │   │   │   ├── base.css
│   │   │   │   ├── changelists.css
│   │   │   │   ├── dashboard.css
│   │   │   │   ├── forms.css
│   │   │   │   ├── ie.css
│   │   │   │   ├── login.css
│   │   │   │   ├── rtl.css
│   │   │   │   └── widgets.css
│   │   │   ├── img
│   │   │   │   ├── changelist-bg.gif
│   │   │   │   ├── changelist-bg_rtl.gif
│   │   │   │   ├── chooser-bg.gif
│   │   │   │   ├── tool-right.gif
│   │   │   │   ├── tool-right_over.gif
│   │   │   │   ├── tooltag-add.gif
│   │   │   │   ├── tooltag-add_over.gif
│   │   │   │   ├── tooltag-arrowright.gif
│   │   │   │   └── tooltag-arrowright_over.gif
│   │   │   └── js
│   │   │   ├── actions.js
│   │   │   ├── actions.min.js
│   │   │   ├── admin
│   │   │   │   ├── DateTimeShortcuts.js
│   │   │   │   ├── ordering.js
│   │   │   │   └── RelatedObjectLookups.js
│   │   │   ├── calendar.js
│   │   │   ├── collapse.js
│   │   │   └── urlify.js
│   │   ├── css
│   │   │   ├── datepicker.css
│   │   │   ├── datePicker.css
│   │   │   ├── jquery-ui.css~
│   │   │   ├── pro_dropline.css
│   │   │   ├── pro_dropline_ie.css
│   │   │   ├── screen.css
│   │   │   └── screen.css~
│   │   ├── endless_pagination
│   │   │   └── js
│   │   │   ├── endless.js
│   │   │   ├── endless_on_scroll.js
│   │   │   └── endless-pagination.js
│   │   │   ├── transfer.png
│   │   │   ├── ui-icons_454545_256x240.png
│   │   │   ├── upload.png
│   │   │   └── up.png
│   │   ├── js
│   │   │   ├── endless-pagination.js
│   │   │   ├── jquery
│   │   │   │   ├── Copy of custom_jquery.js
│   │   │   │   ├── custom_jquery.js
│   │   │   │   ├── date.js
│   │   │   │   ├── jquery-1.4.1.min.js
│   │   │   │   ├── jquery.bind.js
│   │   │   │   ├── jquery.datePicker.js
│   │   │   │   ├── jquery.dimensions.js
│   │   │   │   ├── jquery.filestyle.js
│   │   │   │   ├── jquery.pngFix.pack.js
│   │   │   │   ├── jquery.selectbox-0.5.js
│   │   │   │   ├── jquery.selectbox-0.5_style_2.js
│   │   │   │   ├── jquery.selectbox-0.5_style_3.js
│   │   │   │   ├── jquery.tablesorter.js
│   │   │   │   ├── jquery.tooltip.js
│   │   │   │   ├── jquery.usermode.js
│   │   │   │   ├── ui.checkbox.js
│   │   │   │   └── ui.core.js
│   │   │   ├── jquery-1.9.1.js
│   │   │   ├── jquery.js
│   │   │   ├── jquery-latest.js
│   │   │   ├── jquery.pajinate.js
│   │   │   ├── jquery.tablesorter.js
│   │   │   ├── jquery-ui-1.10.3.custom.min.js
│   │   │   ├── test.js~
│   │   │   └── transfer.js
│   │   ├── login.css
│   │   ├── PIE.htc
│   │   ├── style.css
│   │   └── style.css~
│   ├── svn-commit.tmp
│   ├── tasks.py
│   ├── tasks.py~
│   ├── tasks.pyc
│   ├── templates
│   │   ├── ajax.html
│   │   ├── base.html
│   │   ├── create_session.html
│   │   ├── create_session.html~
│   │   ├── deleted_files.html
│   │   ├── edit_session.html
│   │   ├── file_info.html
│   │   ├── footer.html
│   │   ├── forgot_password.html
│   │   ├── form.html
│   │   ├── header.html
│   │   ├── list_files.html
│   │   ├── list_session.html
│   │   ├── list_session.html~
│   │   ├── login_backend.html
│   │   ├── message_forgot.html
│   │   ├── nav.html
│   │   ├── new_password.html
│   │   ├── notify.html
│   │   ├── overview.html
│   │   ├── overview.html~
│   │   ├── password_successful.html
│   │   ├── reform.html
│   │   ├── registration
│   │   │   ├── password_reset_complete.html
│   │   │   ├── password_reset_confirm.html
│   │   │   ├── password_reset_done.html
│   │   │   ├── password_reset_email.html
│   │   │   └── password_reset_form.html
│   │   ├── right.html
│   │   ├── search_result.html
│   │   ├── shared_by_me.html
│   │   ├── shared_with_me.html
│   │   ├── style.css
│   │   ├── synced.html
│   │   ├── test.html
│   │   ├── test.html~
│   │   ├── thanks.html
│   │   ├── uploaded_files.html
│   │   ├── uploaded_files.html~
│   │   └── uploaded_notify.html
│   ├── tests.py
│   ├── views.py
│   ├── views.py~
│   └── views.pyc
├── genalytics
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── settings.py
│   ├── settings.py~
│   ├── settings.pyc
│   ├── urls.py
│   ├── urls.pyc
│   ├── wsgi.py
│   ├── wsgi.py~
│   └── wsgi.pyc
└── manage.py
Content of httpd.conf of Apache:
Listen 8000
<VirtualHost *:8000>
ServerName NFS
DocumentRoot /opt/genalytics
WSGIScriptAlias / /opt/genalytics/genalytics/wsgi.py
<Directory /opt/genalytics/genalytics>
Order allow,deny
Allow from all
</Directory>
Alias /static /opt/genalytics/fileupload/static
</VirtualHost>
wsgi.py content:
import os
import sys
sys.path.append('/opt/genalytics')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "genalytics.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
I am using Django 1.5. Thank you!
You might want to change this line in your wsgi.py:
sys.path.append('/opt/genalytics')
to:
sys.path.insert(0, '/opt/genalytics')