43👍
First off, you are getting that error because you are starting a project within the same directory as the cloned project, this directory already contains an app with the name ig_miner_app
hence the name conflict.
As regards steps to running the project by other users , this should work.
clone the project
git clone https://github.com/erinallard/instagram_miner.git
create and start a a virtual environment
virtualenv env --no-site-packages
source env/bin/activate
Install the project dependencies:
pip install -r requirements.txt
create a file named “secrets.sh”
touch secrets.sh
(mac and linux)
obtain a secret from MiniWebTool key and add to secrets.sh
export SECRET_KEY='<secret_key>'
add secrets.sh to .gitignore file
create a postgres db and add the credentials to settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'db_name',
'USER': 'name',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
}
}
then run
python manage.py migrate
create admin account
python manage.py createsuperuser
then
python manage.py makemigrations ig_miner_app
to makemigrations for the app
then again run
python manage.py migrate
to start the development server
python manage.py runserver
and open localhost:8000 on your browser to view the app.
I believe this should get the app up and running on others’ machines. Let me know if you get stuck on any of these steps so I make edits, if not, you can just use it and add any other relevant info I might not have added.
1👍
While my hope is that this issue has been resolved by now, if I may, let’s revisit something real quick– I’m sure others have made and, are currently making this mistake.
I tried ‘django-admin startproject ig_miner_app . but am getting this error code:
"CommandError: " yadda yadda yadda …
Django actually has amazing documentation. The guys behind it were writers and journalists and not your typical CS guys.
When learning something new, read the documentation. Run through the to-do app tutorial. Here’s why:
django-admin startproject
This has already been satisfied if you are pulling a working copy of a pre-existing Application. Your concern should be with this file first and foremost: requirements.txt
. This is where the devDependencies state their demands, if you will, similar to package.json
.
- [Django]-URL-parameters and logic in Django class-based views (TemplateView)
- [Django]-Django TypeError: 'RelatedManager' object is not iterable
- [Django]-Is there a way to filter a queryset in the django admin?
- [Django]-Using Django auth UserAdmin for a custom user model
- [Django]-Where should utility functions live in Django?
- [Django]-Django set DateTimeField to database server's current time
0👍
As you said, once you clone the repo, you have to install the requirements
pip install -r requirements.txt
After that you have to configure the database. Add the details to settings.py
Once it has been done and you have the keys and secrets, you have to make migrations and then migrate.
cd into the app directory and run
python manage.py makemigrations
to create migration files for the models already defined in the codes you have cloned. after that you have to run
python manage.py migrate
to apply the migrations which in effect creates the database tables.
Now you make any changes in models or add extra models or fields, you have to run the last two commands again.
- [Django]-Performing a getattr() style lookup in a django template
- [Django]-Django's ModelForm unique_together validation
- [Django]-Django type object Http404 has no attribute get
0👍
My IDE seems to auto-activate a venv if it resides inside the project directory which caused me to continually run into the error when I cloned from git.
ModuleNotFoundError: No module named ''
I had to manually delete the original venv and create a new virtual env then ran these commands. Worked like a PyCharm after 🙂
pip install -r requirements.txt
python manage.py collectstatic
- [Django]-Django MySQL error when creating tables
- [Django]-How to duplicate virtualenv
- [Django]-How can I upgrade specific packages using pip and a requirements file?
0👍
- Create virtualenv and activate it.
- Install all dependencies.
- cd into the project’s home directory.
- run $ python manage.py runserver.
- [Django]-List field in model?
- [Django]-Error: "dictionary update sequence element #0 has length 1; 2 is required" on Django 1.4
- [Django]-How to set-up a Django project with django-storages and Amazon S3, but with different folders for static files and media files?
-1👍
I take the following steps after cloning the project from GitHub:
pip3 install virtualenv
virtualenv -p python3 env
source env/bin/activate
pip install django
django-admin startproject <mysite>
python manage.py startapp polls
python manage.py runserver
on terminal: python manage.py makemigrations <app_name>
python manage.py migrate
These work fine on my system.
- [Django]-Django 1.4 – can't compare offset-naive and offset-aware datetimes
- [Django]-Django setUpTestData() vs. setUp()
- [Django]-How can I return HTTP status code 204 from a Django view?