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

Enable to dev config to be overriden from Custom Config class instead of relying on command line arguments #866

Open
LohithBlaze opened this issue Jun 22, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@LohithBlaze
Copy link

Bug Description

in init.py in robyn, there is specific code to exit from the program if dev mode is overriden from a Config class, need this to removed for enabling dynamic development or production mode deployments.

    if self.config.dev:
        exit("Dev mode is not supported in the python wrapper. Please use the CLI. e.g. python3 -m robyn app.py --dev ")

Steps to Reproduce

class DevConfig(BaseRobynConfig):
"""Development Configuration"""

DEBUG = True
def __init__(self):
    super().__init__()
    self.dev = True

Creating an DevConfig object result in program being exited due to the above code.

Your operating system

Linux

Your Python version (python --version)

3.9

Your Robyn version

latest

Additional Info

No response

@LohithBlaze LohithBlaze added the bug Something isn't working label Jun 22, 2024
@sansyrox
Copy link
Member

@LohithBlaze , you don't need the dev code to be removed. You can just use robyn app.py --dev

@sansyrox
Copy link
Member

Hey @LohithBlaze 👋

As discussed on Discord, this is an interesting suggestion. I will be keen on implementing this feature. 😄

@i1619khz
Copy link

@sansyrox hi, sansyrox , I have a problem, Dev mode does not support the use of Python Wrapper, but I want to start the service through Pycharm's debug mode, What to do?

This way I don't need to breaking point debugging by running app.py through pycharm when I need to debug, which is currently not supported by the robyn cli

@sansyrox
Copy link
Member

Hey @i1619khz 👋

I don't use PyCharm tbh. Maybe @VishnuSanal can help

@VishnuSanal
Copy link
Contributor

Hey @i1619khz , there's an option to set CLI flags in run configurations menu, AFAIK. Try this https://www.jetbrains.com/help/pycharm/run-debug-configuration-python.html please let me know if your still stuck. :)

@i1619khz
Copy link

@VishnuSanal @sansyrox Thanks for your answer, I mainly want to know how to debug a service starting from cli

Hey @i1619khz , there's an option to set CLI flags in run configurations menu, AFAIK. Try this https://www.jetbrains.com/help/pycharm/run-debug-configuration-python.html please let me know if your still stuck. :)

Don't quite understand how to configure

@VishnuSanal
Copy link
Contributor

I mainly want to know how to debug a service starting from cli

I presume you meant how to set the --dev flag when running from pycharm.

Don't quite understand how to configure

image

this is how to do it, set all your flags in script params field.

@i1619khz
Copy link

@VishnuSanal I know, but it says :Dev mode is not supported in the python wrapper. Please use the Robyn CLI. e.g. python3 -m robyn app.py --dev, What I want to know is how to start in pycharm debug mode with dev enabled

@VishnuSanal
Copy link
Contributor

@i1619khz got you, please try the following:

image

@i1619khz
Copy link

@VishnuSanal Thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants