Add docs and configuration for intellij and pycharm (#525)

* add docs and configuration for intellij and pycharm

* add images and template settings
This commit is contained in:
Bernhard Posselt
2017-10-13 16:33:57 +02:00
committed by GitHub
parent 8fefd08083
commit 13ce7fce2a
17 changed files with 138 additions and 4 deletions

4
.gitignore vendored
View File

@ -11,8 +11,8 @@ tests/.coverage
build/
tests/report/
venv
.idea
*.iml
.idea/workspace.xml
.idea/tasks.xml
nextcloudappstore/local_settings.py
*.sqlite3
*.wp[ru]

6
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_9" default="false" project-jdk-name="Python" project-jdk-type="Python SDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/appstore.iml" filepath="$PROJECT_DIR$/appstore.iml" />
</modules>
</component>
</project>

26
.idea/runConfigurations/Server.xml generated Normal file
View File

@ -0,0 +1,26 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Server" type="Python.DjangoServer" factoryName="Django server">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
<env name="DJANGO_SETTINGS_MODULE" value="nextcloudappstore.settings.development" />
</envs>
<option name="SDK_HOME" value="$PROJECT_DIR$/venv/bin/python" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="appstore" />
<option name="launchJavascriptDebuger" value="false" />
<option name="port" value="8000" />
<option name="host" value="" />
<option name="additionalOptions" value="" />
<option name="browserUrl" value="" />
<option name="runTestServer" value="false" />
<option name="runNoReload" value="false" />
<option name="useCustomRunCommand" value="false" />
<option name="customRunCommand" value="" />
<method />
</configuration>
</component>

22
.idea/runConfigurations/Tests.xml generated Normal file
View File

@ -0,0 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Tests" type="DjangoTestsConfigurationType" factoryName="Django tests">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="$PROJECT_DIR$/venv/bin/python" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="appstore" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="TARGET" value="" />
<option name="SETTINGS_FILE" value="" />
<option name="CUSTOM_SETTINGS" value="false" />
<option name="USE_OPTIONS" value="false" />
<option name="OPTIONS" value="" />
<method />
</configuration>
</component>

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -9,7 +9,8 @@
- Add a createtestuser command for easily setting up users in development
- Automatically log in user on successful email confirmation, #400
- Added security category
- Added collaboration tag for info.xml, #521
- Added collaboration tag for info.xml, #521 and #524
- Added docs on how to configure IntelliJ/PyCharm and commit project configuration files
- **API (v1)**: future proof signatures by adding a **signatureDigest** field to each app release filled with the hashing algorithm
- **API (v1)**: add **discussion** field to each app that links to its forum

22
appstore.iml Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$" />
<option name="settingsModule" value="nextcloudappstore/settings/development.py" />
<option name="manageScript" value="manage.py" />
<option name="environment" value="&lt;map/&gt;" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />
</component>
</module>

BIN
docs/_static/img/idea1.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
docs/_static/img/idea2.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
docs/_static/img/idea3.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
docs/_static/img/idea4.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
docs/_static/img/idea5.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
docs/_static/img/idea6.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
docs/_static/img/idea7.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -84,3 +84,47 @@ and build the latest frontend::
yarn run build
IntelliJ IDEA Ultimate/PyCharm Setup
------------------------------------
You can use any editor/IDE that you want to. However if you are already using `IntelliJ IDEA Ultimate <http://www.jetbrains.com/idea/buy>`_ with the Python plugin or `PyCharm <http://www.jetbrains.com/pycharm/buy>`_ you can import a fully installed project with the following steps:
.. note:: The configuration uses the **Django** Facet which is only included in the commercial IDE releases.
In the project window click "Open" and select the cloned **appstore** folder:
.. image:: _static/img/idea1.png
:alt: project window
.. image:: _static/img/idea2.png
:alt: open project window
Afterwards you are presented with the main window. From here, click on the project settings icon:
.. image:: _static/img/idea3.png
:alt: main window
Then you need to add a new SDK. To do that click on **New...** -> **Python SDK** -> **Add Local** and select the Python executable **venv/bin/python** in your local **venv** folder:
.. image:: _static/img/idea4.png
:alt: project settings
.. image:: _static/img/idea5.png
:alt: add sdk
In your project settings go to **SDKs** and select your recently added Python SDK. Rename it to **Python** and close the project window by clicking **OK**.
.. image:: _static/img/idea6.png
:alt: rename sdk
You are now ready to start developing. You can start the server by choosing the run configuration **Server** and run all tests by selecting the run configuration **Tests**.
.. note:: Should you have issues with unrecognized imports just invalidate your caches by going to your global menu and clicking **File** -> **Invalidate Caches / Restart** -> **Invalidate and Restart**
IntelliJ IDEA Ultimate Specific Setup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To enable support for Django templates, open your IDE settings by clicking **File** -> **Settings**. Then go to **Languages and Frameworks** -> **Python Template Languages** and select **Django** in the drop down menu on the right. Confirm your changes by clicking **OK**
.. image:: _static/img/idea7.png
:alt: set Python templates to Django

View File

@ -10,4 +10,3 @@
<p>{% trans 'The page you are looking for does not exist!' %}</p>
{% endblock %}