-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cannot run in a django project on apache #420
Comments
Not a known issue AFAIK. I'm afraid I have no experience with Django, but some of the other maintainers may be able to help. |
@Gloin1313 Thanks for reply. from django.db import models
from moviepy.editor import VideoFileClip
class Video(models.Model):
pass and here is my project wsgi.py: import os
from os.path import join, dirname, abspath
from django.core.wsgi import get_wsgi_application
import sys
PROJECT_DIR = dirname(dirname(abspath(__file__)))
sys.path.insert(0, PROJECT_DIR)
os.environ["DJANGO_SETTINGS_MODULE"] = "DjangoTest.settings"
application = get_wsgi_application() I didn't change any other things in project or app except for adding app to 'INSTALLED_APPS' and migrate. My apache site configure: <VirtualHost *:8001>
WSGIScriptAlias / /home/wen/workspace/Pycharm/DjangoTest/DjangoTest/wsgi.py
<Directory /home/wen/workspace/Pycharm/DjangoTest/DjangoTest>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost> Still I cannot visit the django admin site without comment |
The general rule is "don't use moviepy.editor in production". Moviepy.editor is a special module of moviepy which loads ALL the features and tries starting Pygame to allow live previews, it is a bit heavy and could become heavier in the future. Instead, try importing everything you need separately from its location:
|
@Zulko Thanks, very helpful. from moviepy.video.io.VideoFileClip import * is enough. |
Is your problem solved now? |
@Gloin1313 Yeah, thanks for your help : ) |
Hi there, I'm having some issues when attempting to use moviepy in a Django project on apache.
I'm using moviepy in a model to create thumbnail for uploading video. It works fine with django 'runserver' command, but when the project is deployed on apache, I cannot get any HttpResponse from any url, and there is nothing in apache error log. But if I delete the line 'from moviepy.editor import *', other urls can be visited.
Is there a known issue? Or is there something I need to do with apache or ffmpeg?
Thanks.
The text was updated successfully, but these errors were encountered: