Reputation: 4249
I am a new to Django and have 0 experience with this framework.
I cloned a project from git it came with requirements.txt file, but I am not sure how to run it. Do I need to create virtual environment first and clone the project into the directory of the virtual environment, and then install the requirements?
Do I need to clone the project first into some folder and then create the virtual environment inside this folder and then install the requirements?
Do I need to use any special IDE to run the project? I tried opening the project in PyCharm, without creating a virtual environment first, and it asked me if I want to install the requirements.
I would be glad if someone could explain what is the correct way to run an already existing project.
Upvotes: 7
Views: 22032
Reputation: 81
1.Grab a copy of the project.
git clone new_project.git
2.Create a virtual environment and install dependencies.
mkvirtualenv new_project pip install -r requirements.txt
3.Duplicate new_project/new_project/local_settings_example.py and save as local_settings.py.
4.Enter your database settings in local_settings.py.
5.Initialize your database.
python ./manage.py syncdb python ./manage.py migrate
6.If your app has a custom user model, you'll need to create a new superuser for the admin.
python ./manage.py createsuperuser
7.Run the development server to verify everything is working.
python ./manage.py runserver
Upvotes: 2
Reputation: 2910
Let's come to your doubts one by one :
pip install -r requirements.txt
python manage.py runserver
and open in the browser.P.S: If you are completely new to python, I would recommend using the conda python distribution. You can create new virtual envt. using conda create
as well.
Upvotes: 8