Question

I recently purchased the IntelliJ-IDEA 13 for use of downloading the Python plugin (which I am told has the same code-base as PyCharm) and working on a python web project (specifically Flask). I thought it would be a near seamless transfer from Sublime text but I am having some trouble.

So here is my problem: I am trying to import an existing Python application (as said earlier that is using Flask) but I cannot set the file correct file structure when importing my project.

My existing/current project is set up as so (it is modeled after most Flask applications):

/Base Directory
    /app
        /static
            *CSS/JS/IMGs go here*
        /templates
            *Templates go here*
        __init__.py
        forms/models/routes.py
    run.py

If you want to see the actual project, it is available on my GitHub Project Page.

IntelliJ apparently has the feature to import existing code into a project, however whenever I go to Import Project, and selecting my Base Directory folder, it always turns out like this:

When I try to Import a Project

When I create a New Project -> Flask Project (or any other Python project type) it ends up looking like this:

When I create a New Flask Project

The latter is more of what I am looking for (seeing the other files inside of the project, instead of just the root folder).

So my question is: Is there a way to adapt my current file structure to work with IntelliJ/PyCharm or vice-versa (and be able to work with the other files)? Or is there a quick fix or mistake that I am making?

Thank you in advance, and remember my project page is here.

-EpicDavi

Was it helpful?

Solution

Old Solution

I have found a temporary solution for this for the time being.

I ended up just creating a new project and copying the files from the old one into the new one. This lets me get the project panel like the other projects but is still a hassle moving files around.

This is of course not perfect, seeing as my original project is on GitHub and will have to synchronize the files any time I want to commit.

Edit. Newer Solution

Instead of doing the above, I have found that if you create a new Python project inside of the directory of choice (in my case being the Base Directory) with no other settings, it will set up the project in that area with the necessary files. Everything is running smoothly for me.

OTHER TIPS

Not fully sure but wouldn't the Refactor > Move be an option for this case ?

If you use Flask you need: Settings -> Project -> Project Structure and Mark as Sourses you project folder enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top