Reputation: 2938
I'm currently on a Windows 7 environment developing a Pyramid web application. I had been developing this app on my Mac, but that's recently died, so I've had to move to my Windows machine.
I've set up everything I need; Python 2.7, Pyramid, pyramid_beaker, MongoDB, mongoengine, etc.
It seemed to be working while I was editing the templates. However, when I tried editing a view to add a new page to the app, it would not seem to be able to find it. I added the following routes:
config.add_route('info_about','/info/about')
config.add_route('info_contact','/info/contact')
config.add_route('info_copyright','/info/copyright')
config.add_route('info_privacy','/info/privacy')
config.add_route('info_terms','/info/terms')
...which are handled by a view_config decorator like so:
@view_config(route_name='info_about', renderer="myproject:templates/info/about.mako", permission='all')
def info_about(request):
<code goes here>
This is in an info.py
file in the view subfolder (which does contain an __init__.py
file). This method has worked when I was on my Mac, but now that I've tried on Windows, it doesn't seem to work (it throws a 404 Not Found page up when trying to access it).
After a little investigating, I found that the .pyc
version of info.py
(the compiled version) does not exist. info.py
is new and was added on the Windows machine. As a test, I tried editing a file created on the Mac and restarting the test server. It hasn't modified the .pyc
counterpart either, so I'm led to assume that Windows is not producing the .pyc
version of the python files.
Is this a common problem, and more importantly, is there a solution? (I have to assume there is...)
Upvotes: 1
Views: 290
Reputation: 22679
Sorry, your question is not clear enough. It seems you have some kind of read/write permission problems, and generating *.pyc has nothing to do with it.
*.pyc contains Python bytecode, in fact it is there just to load the original *.py files faster. Every time Python successfully reads a *.py file and is able to write(!) into the same directory, it creates a corresponding *.pyc file.
For more information see compiled python files.
Upvotes: 3