Skip to content
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

VSCode Breakpoints and Create auto Netbox User for developer and Chapter for Debeloper #80

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

LHBL2003
Copy link
Contributor

@LHBL2003 LHBL2003 commented Jul 15, 2024

I'm sorry, I've learned a lot in the last few days. But I'd say I'm done now. This extension is intended to help with the further development of the plugin.
Summary of what has been done so far.

README Chapter for Developer

In the README a chapter for developers was created to get a better start if someone wants to help.

Makefile dokumentation

Makefile comments have been added. And the Makefile has also been extended to include "make debug-vscode". This prepares the Docker project for the VSCode RUN AND DEBUG mode.

Support debugging in VSCode with breakpoints

The following files were created to support debugging in VSCode with breakpoints:

image

.dockerignore
.vscode/launch.json
.vscode/tasks.json
develop/docker-compose-debug.yml

More information can be found in the readme and in the files.

Automatically create the Netbox user admin with the password admin

The following files were created to achieve the automatic creation of the admin SuperUser user for Netbox. Makes it easier to get started with development and is only intended for Docker development.

First start
image

Secound start
image

develop/management/init.py
develop/management/commands/init.py
develop/management/commands/makesuperuser.py

The script file for creating the Netbox Admin is only distributed when using the Docker Compose development environment.
The docker-compose.yml file has also been adapted so that makesuperuser is also executed here.

The makesuperuser.py script is built in such a way that it checks whether a SuperUser has been created. If not, it is created. So if you start the container again, there is no error message that there is already a user.

I am therefore asking for a test now :D

Extension of the extension recommendation for Django, so that no errors are displayed in the HTML.
@k01ek
Copy link
Collaborator

k01ek commented Sep 5, 2024

Hi @LHBL2003 ! I don't think that root folder of this project its right place for vscode files. It's better to move it to develop folder or wiki. The same applies to the development part of readme.

@LHBL2003
Copy link
Contributor Author

LHBL2003 commented Sep 5, 2024

Hi @k01ek,

I think the wiki is a good idea. I've never done it here, but it seems simple in theory. But I believe that you have to create a wiki page first so that this function is available to others in the repository. When I create a test repository, I have the WIKI tab. This is not available for selection in your repository or in my fork.

I can have a look at whether you can move the .vcode folder. Alternatively, I would describe the files in the wiki. (Whereby the second is of course not quite as nice :)

Can you @k01ek please provide the WIKI section. It should certainly be enough to create a home page.

closed/reopened this pull: It was an oversight. I wrote it on my mobile phone :D

@LHBL2003 LHBL2003 closed this Sep 5, 2024
@LHBL2003 LHBL2003 reopened this Sep 5, 2024
@LHBL2003
Copy link
Contributor Author

LHBL2003 commented Sep 30, 2024

Hi @k01ek,

Request from you: move the “.vscode”

Unfortunately you can't move the “.vscode” folder. See also in the Git of vscode: microsoft/vscode#176354

I can only suggest 3 variants:

  • Leave the “.vscode” folder in the root folder. So that it works out of the box.
  • Remove the “.vscode” folder and in the new development documentation file: “README_Development.md”.
  • Move the “.vscode” folder to the “develop” folder and add information that this folder must be copied to the root folder for debugging.
    Which version do you prefer?

Request from you: WIKI

Since I have not heard anything from you about the Develop WIKI, I have created a separate “README_Development.md” file in the docs folder. The folder “README_Subpages” is there because there are more readme files for the “HTML Design” customization #84.

ModuleNotFoundError: No module named 'setuptools'

With the current version, “make debug” and “make debug-vscode” were no longer possible because “install setuptools” is now required. This will also be a problem in your version.
Fixed: 6eaff88

@cruse1977
Copy link
Member

or replace:

RUN python setup.py develop

with

RUN python -m pip install --editable .

@LHBL2003
Copy link
Contributor Author

LHBL2003 commented Nov 17, 2024

or replace:

RUN python setup.py develop

with

RUN python -m pip install --editable .

Hi @cruse1977
However, this would ensure that the plugin is no longer installed, as setup.py is no longer called.
So Netbox starts, but the plugin is missing in your suggestion.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants