-
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
Update project layout to match Django #1250
Comments
Thanks Alex - please go right ahead! |
+1 on this one! Remember the fabfile, wsgi.py, and the files inside deploy/ (because they make assumptions regarding the project layout). I can help you out with that once you're done with the general refactoring if you like :) |
Great, I'll try to get to this tonight. |
That didn't happen - but I'll put aside some time over the weekend to do this. I think it would be good to get it in before the 1.8 release. |
No worries, thanks a lot! I'll be travelling back to AU over the next couple of days, so at this stage the release probably wouldn't be until early next week at the absolute earliest anyway, so no rush. |
OK, I'm in the middle of working on this now. The new project layout requires replacing placeholders in path names: settings.py, urls.py etc live in Since version 1.4, Django has built in project template functionality which we can work on top of, and in doing so replace most of Django's startproject source and the superclass TemplateCommand are worth reading. Two problems that I can see with this:
The other alternative is to add code to mezzanine_project.py to support placeholders in paths, instead of using Django's machinery. But I really feel the better option would be to change what we need to in order to standardise and make use of what Django provides. |
For now, I'm just going to update mezzanine_project.py so that we can at least get the basic directory structure updated, and look at making the other changes later. |
Thanks for the update Alex - I'd the same plan of one day replacing mezzanine-project with Django's new (now old) project template support, but like you said baby steps would be fine too. Not too attached to Mezzanine's multi-project-template thing either, I think Cartridge is the only thing that ever leveraged that, and like you said things would be less complex if it just had its own entire project template. |
Cool that makes things easier. It actually looks like it will be easier to update to use the Django stuff than change mezzanine_project.py anyway: since so much lives in the project app, all that stuff needs to be templated, and that's all provided for in the default Django project template. |
Awesome! Another thing we'll need to at least verify still works is the built-in fabfile. Hopefully it just works out of the box, but might need some minor tweaks for the new layout. It's a bit involved if you haven't used it before (setting up a virtual machine etc) so I'll take a look at that - just wanted to make note of it. |
Yep - some of the paths will need to be changed at the very least. This is the default Django project template. I'm planning to put the fabfile into the project root, and the |
I wonder if the deploy directory should go in the project root too? Not sure. |
Like technically manage.py, fabfile.py and "deploy" dir don't get "deployed". |
Eg they're tools, not part of the Python package that gets created inside the project root. |
Sounds good to me, I'll go with that. |
See patch in #1265. |
Closed by #1256 |
I really look forward to this to happen. Is there any eta? |
As soon as we have time to put out a release which should be soon (I need to merge TinyMCE4). That said, the new project layout patch has been merged so if you are comfortable using this repository's master branch, you can use it today. |
Great, where should I download the hottest versions? |
Sorry, that was a dumb question. I mean how do I install the particular version into the virtual environment? |
Probably the simplest way is to do:
I think you can also add an URL to a zip file to your requirements.txt and it will work out. Alternative you can install directly from git: Bear in mind that the latest version requires at least Django 1.7. Good luck! |
Many thanks. I'll give it a try. |
I used to deploy Mezzanine on Heroku. In that case, how do I specify the version in the "requirements.txt"? |
I think simply putting Alternatively you can pin to a specific commit with a requirements line like this:
(That's the most recent commit as of now) |
Tried to deploy the newest version of Mezzanine on Heroku, and it worked! |
My pleasure. Keep an eye out for the official release. |
Uhhhhh, tinymce seems not ready yet. |
Is there any version already having TinyMCE 4? It's kind of urgent. My customer's site is unable to edit anything in the admin page :-( |
TinyMCE really isn't there. Any update? |
You probably missed the answer from #1336 |
In the spirit of "Mezzanine is just Django" I think we should update the project layout to match Django's default, and go through the project template's settings.py to see if any of the Django defaults need updating.
I'm volunteering to do the work; just opening the issue here to get consensus.
The text was updated successfully, but these errors were encountered: