Whenever in django I click run it notifies me that 'Package operation failed'.
Whenever in django I click run it notifies me that 'Package operation failed'. Please help me with this.Suggest me what should i do???
Voters
sahil1234
How to clear packages??I am a beginner.Please help me
TheForArkLD
@sahil1234 ,use reply :)
@coderash
@coderash
coderash
Try clearing all packages and re-downloading them.
Very funny to see this article I just FINALLY solved this problem THIS MORNING LITERALLY.
1.) Create a Django project USING THE REPLIT DJANGO TEMPLATE
2.) Delete all other files EXCEPT manage.py and package files ( poetry.lock and pyproject.toml )
3.) Drag and drop your project from your local machine into your replit IDE EXCEPT your local manage.py file, leave that one.
--> This is the main part <--
4.) CHANGE THE REPLIT manage.py function here:
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '<yourproject_name>.settings')
...
...
That is all.
I also found a replit article that said to add the following;
X_FRAME_OPTIONS = '*'
and
ALLOWED_HOSTS = ['cb1a0754-b29b-4fef-a985-935aff18927d.id.repl.co'] that to your allowed hosts.
I DID NOT do this and mine ran well and is still running but I just I should include that here.
PEACE!!