Django remove source files and how to running pyc files?

136 views Asked by At

In Django project, I don't share the views.py to client. like to remove views.py source files from Django, only pyc files there. But when i remove source file, it gives me ImportError, it should refer pyc file, but it is not refering them. How to solve this problem?

1

There are 1 answers

1
baliao On

Sorry, confuse everybody a lot, I fixed the problem like this:

  1. python -m compileall path/to/project
  2. python manage.pyc runserver, we can run Django even removed the source code (*.py)