Skip to content
Sign upLog in
← Back to Community
Repl.it: Package operation failed. Django
Profile icon
vaibhavsolanke

after creating and running django repl, not getting the landing page but instead error Repl.it: Package operation failed. in console. how can I run the app ?

Voters
Profile icon
vaibhavsolanke
Comments
hotnewtop
Profile icon
fixXxerTech

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!!

Profile icon
PattanAhmed

@vaibhavsolanke
Hi,
Better to use normal Python repl instead of Django.
You can run Django there too.

To create a Python Repl, Click here
and
Transfer all these codes to that newly created Repl.

That's it
Thanks!

Hope this helps

Profile icon
vaibhavsolanke

@PattanAhmed
what command can be used to install django and start project ? normal commands arent working in python console of repl

Profile icon
PattanAhmed

@vaibhavsolanke
Ah...
No need of commands.

Just import the Django Library
It will automatically download the required packages for you.

Profile icon
k9chelsea2

I think it means that the packages, updates cant load :/