Apache and wsgi => Where to put my djangoproject files? Please Help!

51 vues
Accéder directement au premier message non lu

doniyor

non lue,
14 mai 2012, 03:51:2314/05/2012
à django...@googlegroups.com
hi there, i need your help again, 

i configured my httpd.conf file, i told him where is my django.wsgi file. the directory is this: /usr/local/django/mysite/myproject.   What i dont understand is: during configuration, do i have to 'startproject'? or will i just copy my djangoproject in this 'django' folder? 

and.. my question is: how does apache finds my project actually? from which file? from wsgi script file? there are too many steps and docs are not clean to follow. what i did is this: 
1) installed mod_wsgi 
2) installed django
3) i created a folder 'django' under usr/local as shown in docs. 
4) in this django folder i did 'django-admin.py startproject mysite'
5) in this 'mysite' i created a folder 'apache', and in this apache folder i created my django.wsgi script file. 
6) then i copied my actual django project which i developed locally into mysite folder. 


can you please tell me where to put my djangosite and what is document root. if i put my djangosite on documentroot, files will be downloable, so where to put then??? :(( 

thanks 





 

kenneth gonsalves

non lue,
14 mai 2012, 04:06:3214/05/2012
à django...@googlegroups.com
On Mon, 2012-05-14 at 00:51 -0700, doniyor wrote:
> i configured my httpd.conf file, i told him where is my django.wsgi
> file.
> the directory is this: /usr/local/django/mysite/myproject. What i
> dont
> understand is: during configuration, do i have to 'startproject'? or
> will i
> just copy my djangoproject in this 'django' folder?

neither. The correct way to do it is to use a version control system
like git or mercurial and pull from the repository.
>
> and.. my question is: how does apache finds my project actually? from
> which
> file? from wsgi script file? there are too many steps and docs are
> not
> clean to follow. what i did is this:
> 1) installed mod_wsgi
> 2) installed django
> 3) i created a folder 'django' under usr/local as shown in docs.
> 4) in this django folder i did 'django-admin.py startproject mysite'
> 5) in this 'mysite' i created a folder 'apache', and in this apache
> folder
> i created my django.wsgi script file.
> 6) then i copied my actual django project which i developed locally
> into
> mysite folder.

as mentioned above, it is better to pull from a repository, but no 4. is
not necessary.

>
>
> can you please tell me where to put my djangosite and what is
> document
> root.

do not put it in docroot. Create a virtual host in apache and point the
virtual host to the location of the media files of the django project
using the Alias directive. Apache finds your project using the
WSGIScriptAlias directive.
--
regards
Kenneth Gonsalves

doniyor

non lue,
14 mai 2012, 04:19:4214/05/2012
à django...@googlegroups.com
so the docroot should remain as it was, right? what is actually docroot? is it the folder which the www needs to open the webpage? 

doniyor

non lue,
14 mai 2012, 04:22:1814/05/2012
à django...@googlegroups.com
by the way, i am just on terminal, accessing the remote server via PuTTy. so i should push the whole project to some repository and pull it into a project folder on server from repository, right? 



Am Montag, 14. Mai 2012 09:51:23 UTC+2 schrieb doniyor:

kenneth gonsalves

non lue,
14 mai 2012, 07:37:4814/05/2012
à django...@googlegroups.com
On Mon, 2012-05-14 at 01:22 -0700, doniyor wrote:
> by the way, i am just on terminal, accessing the remote server via
> PuTTy.
> so i should push the whole project to some repository and pull it into
> a
> project folder on server from repository, right?

right - but do not put the sensitive parts of your settings.py in the
repository - that is the only thing you need to edit manually on site.
--
regards
Kenneth Gonsalves

doniyor

non lue,
14 mai 2012, 08:56:5114/05/2012
à django...@googlegroups.com
oh okay, many thanks.. 

doniyor

non lue,
14 mai 2012, 09:13:0314/05/2012
à django...@googlegroups.com
hey lawgon, one more question. i did the steps. but still not working. could you please take a look into my whole project on server if i give you the access thru PuTty? 

now, there is nothing under docroot folder. just empty. and if i open browser, it is trying to show again the content of project where files are downloadable, but cannot show anything because the docroot is empty. why isnot it working i am burning like anything. 

doniyor

non lue,
14 mai 2012, 09:22:4514/05/2012
à django...@googlegroups.com
one more thing, there are wsgi.py and example.wsgi files. are they equivalent or they are different files? and where should they live ? 

kenneth gonsalves

non lue,
15 mai 2012, 01:35:4415/05/2012
à django...@googlegroups.com
On Mon, 2012-05-14 at 06:13 -0700, doniyor wrote:
> hey lawgon, one more question. i did the steps. but still not
> working.
> could you please take a look into my whole project on server if i give
> you
> the access thru PuTty?


no problem - send me the username, password and url offlist.
--
regards
Kenneth Gonsalves

doniyor

non lue,
15 mai 2012, 01:52:3215/05/2012
à django...@googlegroups.com
can you pls give me your email? 

if possible, your skype also, if you can, i would love to discuss it in skype.. sofar it is working now, but there are still some questions and hesitations... 

thanks :) 
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message