Team project via Git repo

43 views
Skip to first unread message

rhc.o...@gmail.com

unread,
Oct 13, 2015, 5:57:50 PM10/13/15
to Django users
Hi folks

I'm a Django newbie (have found it very helpful!), so please excuse the naivete. I have a question regarding team work on a Django project via GitHub.

I followed your excellent tutorial and have a virtual Python v2.7 environment with Django 1.8.5 installed in it (FWIW: I thought I installed Django 1.11, but django-admin --version shows 1.8.5). I then created my app using "django-admin startproject foo" and got the project subdirectory as expected. A quick check of the server showed the "Welcome to Django" page.

I then added a bunch of model definitions and customized the admin page. I verified that everything was okay by looking at the admin web page on my localhost - the customized page is there, and I was able to add some test data for one of the models. At this point, others want to pitch in to help, and so I bundled everything in my project subdirectory (including manage.py and the initial sqlite3 db) into a git repo and pushed it up to GitHub.

The other team members also setup a virtual environment with Django, using the same versions, and activated it. They then cloned the GitHub repo and got all the project files as expected, and the directory structure looks exactly the same.

However, when they runserver in the project, they only get the "Welcome to Django" page. The project admin and login page doesn't show up. I've verified that all the model and settings info is correct, but we haven't been able to get the info to show on the web page.

Any suggestions on what we are doing wrong? I'm assuming a team can share a Django project, but suspect we aren't collecting all the relevant files or not getting the other team's environment set correctly.

Thanks
Ralph

rhc.o...@gmail.com

unread,
Oct 13, 2015, 8:38:23 PM10/13/15
to Django users
Just to update: we also tried simply copying the entire virtual environment across, correcting for any differences in path. Still go the same behavior.

We'd really welcome some advice on this one as otherwise we won't be able to use Django - we need a way to collaborate on implementation.

Thanks
Ralph

Jonathan Querubina

unread,
Oct 13, 2015, 8:43:56 PM10/13/15
to django...@googlegroups.com
Have you installed any dependencies via "pip" ?

If not and all the code has been done under your djando apps, the problem could be on the git. Have you checked .gitignore ?

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b13c6d50-2a22-40bf-a78d-752a7305914a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ralph Castain

unread,
Oct 13, 2015, 8:57:17 PM10/13/15
to django...@googlegroups.com
On Oct 13, 2015, at 5:42 PM, Jonathan Querubina <jot...@me.com> wrote:

Have you installed any dependencies via "pip” ?

Only Django itself was installed via “pip” - we went thru the binaries and edited the path. We also uninstalled Django and reinstalled it on the host using “pip”, but the behavior is the same.


If not and all the code has been done under your djando apps, the problem could be on the git. Have you checked .gitignore ?

We don’t have a .gitignore at this time as we weren’t sure what should be ignored. We also tried just copying the environment (no Git involved), and had the same result. So my guess is that there is some static file or something that needs refreshing so Django recognizes the project.

The “welcome” page indicates that we have DEBUG=TRUE in our settings, but that we haven’t configured any URLs. Is the URL in a static file, perchance?


You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/MlbkfJcJo08/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.

Jonathan Querubina

unread,
Oct 13, 2015, 9:06:43 PM10/13/15
to django...@googlegroups.com
No, if debug is true, you do not have to worry about statics yet

Are you activating the env before the runserver command?

Sent from my iPhone

Jonathan Querubina

unread,
Oct 13, 2015, 9:37:22 PM10/13/15
to django...@googlegroups.com
This is a long shot, but, do you have .pyc files on the repository? If yes, try removing *.pyc

Sent from my iPhone

Aaron C. de Bruyn

unread,
Oct 13, 2015, 10:00:55 PM10/13/15
to django...@googlegroups.com
Without knowing too much about your environment, I figured I'd tell
you how I do it on my Debian-derivative systems.

* Install python-virtualenv and virtualenvwrapper - These tools help
you create isolated python environments under your home folder under
'.virtualenv'.
* Create a virtualenv for the project. If my project name is CarSite
I run 'mkvirtualenv carsite'. (After the virtualenv is created it
should leave you *inside* the virtual environment)
* Install the latest version of Django into your virtual env by
running 'pip install django'
* Create your project by going in to your code folder (this is
different than your virtualenv) "cd ~/code" and then creating the
project "django-admin startproject carsite"
* Go in to the carsite directory "cd ~/code/carsite"
* Create a requirements.txt file for other developers ('pip freeze >
requirements.txt')
* Turn it into a git repo "git init ."
* Commit your new project (or make changes, then commit) "git commit
-m 'My first commit'"
* Connect it to github by following their directions (something like
'git remote add origin g...@github.com:username/carsite.git' and then
'git push -u origin master')

Now other developers should be able to start working on the project by
doing the following:
* cd ~/code
* git clone g...@github.com:username/carsite.git carsite
* cd ~/code/carsite
* mkvirtualenv -r requirements.txt

-A

Aaron C. de Bruyn

unread,
Oct 13, 2015, 10:02:29 PM10/13/15
to django...@googlegroups.com
Oops--almost forgot. Create a .gitignore in your ~/code/carsite file
before you commit your changes and push them to GitHub.

https://www.gitignore.io

-A

Ralph Castain

unread,
Oct 14, 2015, 1:25:55 AM10/14/15
to django...@googlegroups.com
I’ll give these, and the suggestions from Jonathan, a try tomorrow when I arrive after travel and let you know how it goes.

Thanks!!!
> You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/MlbkfJcJo08/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEE%2BrGoGodgTTRgc2muk16%2BpF_mRnm55ChKZ%3DZbPMH--QvXWpQ%40mail.gmail.com.

Ralph Castain

unread,
Nov 9, 2015, 4:35:18 PM11/9/15
to django...@googlegroups.com
My apologies for the long, long delay in finally responding. Your advice worked like a charm!!

Thanks a lot to all who responded.
Ralph
> You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/MlbkfJcJo08/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEE%2BrGriRkeB5hZCd713eGvn05BzFnKUG3ASYN8T8vhS0rMdYg%40mail.gmail.com.

m1chael

unread,
Nov 9, 2015, 5:13:05 PM11/9/15
to django...@googlegroups.com
What ended up solving your issue, Ralph? ~Mike
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/AFCFFFEF-C79E-4D69-B13F-47FB05A59644%40open-mpi.org.

Ralph Castain

unread,
Nov 9, 2015, 5:39:44 PM11/9/15
to django...@googlegroups.com
The primary issue was that I naively placed all the code in the same location as the virtual environment. I subsequently wound up slurping the environment code into the repo, which broke as soon as it was transitioned to a new location.

The “secret” was to put the code in a separate location from the virtual environment, and use the mkvirtualenv -r requirements.txt trick Aaron mentioned. As soon as I did that, I was able to migrate pretty simply.

So it had nothing to do with Django itself - just had to cleanly separate the environment from the code.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAuoY6M%3DwOXrZ4gzsz3Sn78ar8qBh70Y9MKahjr%2Bi6Wd1rwtXw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages