Jump to content

rapture

Members
  • Posts

    18
  • Joined

  • Last visited

rapture's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. The following are some posts I have found at Django Users mailing list, about deploying Django without shell access.They include hints on what i mentioned above: Ivan Sagalaev Shell access is highly recommended for initial app setup, otherwise you would have to write and upload small scripts each time you create or change database layout. Walterbyrd What I usually do is develop an app on my home linux box, then transfer that app to the remote host. Of course I have to create the same database, with the same name on the host. Eric Abrahamsen Django is a Python library like any other, so you'll need to be able to add new libraries to your webhost's python installation. Whether you do that as a svn checkout or upload a directory doesn't matter, but you will need access to the python installation (or be able to talk them into installing the library themselves). Django doesn't really need to be compiled/executed, if you can just get the source directory uploaded, into a place that's accessible to the python path, that will be enough. Once you've got django installed, your own website is a similar deal: a set of files in a directory that needs to be on the python path. If you can install django you can install your own website. If you cant do one, you can't do the other. Larrik Jaerico I'll bet a lot of the mailing list will faint when they see this, but I've gotten it to work pretty easily by just dropping the django directory directly into my project directory. Darryl Ross >Is there any way to get django to not process files in a dir (i'm trying to install phpMyAdmin to look at the DB)? In apache's config file I use the following inside my virtualhost block: Alias /phpmyadmin/ /home/httpd/phpMyAdmin/ <Location /phpmyadmin/> SetHandler none </Location> Change path to suit. Michael Josephson In terms of having shell access, it would be handy in terms of being able to run django-admin.py commands but you can probably work around this. e.g. do a "django-admin.py sql" on your local development machine and create the schema using whatever method you normally use to access the database. Carlos Yoder Since I don't have shell access (they don't support ssh for 'security reasons'), I understand I won't be able to use manage.py, so "syncdb" will have to be via phpMyAdmin or similar, and so on. Darryl Ross Create a view that imports django and puts django.VERSION into the context. A simple (untested) way in the urls.py by using the generic views is: import django from django.conf.urls.defaults import * urlpatterns = patterns('' (r'^private/info/$', 'django.views.generic.simple.direct_to_template', {'template': 'info.html', 'extra_context': {'version': django.VERSION'}}), ) And then you just need to create a simple info.html: <html> <head> <title>Info!</title> </head> <body> The django version is {{version}}. </body> </html> > I don't think you can do django with only ftp access Sure you can, if django is installed into the server by the hosting company. I'm in the process of getting a django hosting company in Australia going and it's not that hard to run a django site without shell access. Gabor Farkas regarding the ftp+syncdb problem: then probably the easiest way is to syncdb somewhere else, and then dump the database to a file, and restore it on the servage-database. also to make python know about django, is nothing magical. as you see in the dreamhost-wiki django howto, they simple create a suitable django-fastcgi python script, and inside they add the django-dir to sys.path. alex.gaynor@gmail.com I don't think that is true, the only time I needed root was when I was symlinking django into /usr/lib/python2.5/site-packages/ but since you can put it anywhere on your python path, you just need to symlink it somewhere that's on your path and doesn't require root, since you need a location like this to run any python software this doesn't seem like an issue to me. Andrew Ingram It is possible to get django running without root access but you will need certain levels of permissions to do things like adding libraries to the python path, there are guides to installing Django on shared hosting environments like dreamhost where they don't give you root - though they do give you more access than the average shared host might. My personal feelings are that if you're trying to do things properly you're going to want complete control over your server config and access to services like memcached. Whilst you can get Django running on a range of hosting solutions I can't see myself doing anything more than a simple blog without looking into a VPS or dedicated server with root access. Dan Ellis The only thing you really /need/ root for is having some web server process (usually Apache or lighttpd, for example) bind to port 80. Everything else can be done without it. In fact, in any typical set up, once port 80 has been bound to you're not running as root any more anyway. Daniel Roseman > Hi. > I have a problem with django project that is beeing hosting in a server where i have no shell access... so how can i do syncdb there. > doing mysql dumps in development db and updating hosting mysql is kinda slow.. > Is it possible do this run syncdb script over web? > Alan You could have a view that does django.core.management.call_command('syncdb'). Make sure you've got proper authentication on it though. viestards Because many hosting providers does not allow shell access, I decided to create web version of syncdb. I made this simple function, and looks like it works def db_sync(request): from django.core import management management.syncdb() return HttpResponse("Db sync in progress.") Brian Jackson you can run sqlall on your local copy and then just paste the resulting sql into whatever admin you have for the database server Steven Armstrong Haven't tried this, but in theory something like this should/could work. def my_syncdb_view(request): # check if user has permission to run this here # prepare to capture output of syncdb() import sys orig_stdout = sys.stdout orig_stderr = sys.stderr from cStringIO import StringIO sys.stdout = StringIO() sys.stderr = StringIO() from django.core.management import syncdb syncdb() # rewind stringio instances sys.stdout.seek(0) sys.stderr.seek(0) output = [] output.append("<h3>Output:</h3>") output.append('<pre>') output.append(sys.stdout.read()) output.append('</pre>') output.append("<h3>Errors:</h3>") output.append('<pre>') output.append(sys.stderr.read()) output.append('</pre>') # set stdout and stderr back just in case sys.stdout = orig_stdout sys.stderr = orig_stderr return HttpResponse('\n'.join(output)) Kenneth Gonsalves you can create everything, directory structure etc etc offline on your dev machine and upload it to your production machine (too much to expect svn on that?). You could also pipe the sqlall to a file and create a script to initialise/update your database which you can run using phppgadmin or whatever. Ideally, if there is some way you could use svn on your production machine, you could do everything on your local machine and just svn up whenever you want changes. Even creating a superuser can be done by creating an sql script offline. Deryck Hodge My hosting provider doesn't offer shell access, and I run Django for my personal site. I did what's mentioned above -- built the site initially on my own box, uploaded files via ftp, loaded the initial mysql via phpmyadmin. For the stuff I really needed to run via shell, I did something like: import os import commands os.chdir('/dir/on/srv') out = commands.getoutput("some command") print 'Content-type: text/plain\r\n' print out I ran this as cgi and could run commands as needed and see their output. Like Kenneth says, not ideal for serious development, but for a personal site it's not bad. And now that it's up, I do everything through the Django admin anyway. It's hackish, but it works. Just an idea... Jason F.McBrayer If you can access the database provided by your hosting provider remotely, then you can use your local copy of your project to run syncdb: just modify your local settings.py to point to your database on your provider, and run syncdb there. Vance Dubberly You'll need to insert all the appropriate paths but it would look something like this: os.system('/path/to/python /path/to/manage.py syncdb'); n00m You need no at all to ask the hoster to install Django on his machine. Apache (etc) + installed mod_python is quite enough to get your django app running. The django package (and e.g. PIL) can be copied to there along with your django web dirs, as if it's a part of your web site/app. Example: htdocs/my_dirs/django/... my_django_app/ ... settings.py urls.py PIL/ ... ... LoadModule python_module modules/mod_python.so <Location /> SetHandler mod_python PythonPath "['htdocs/my_dirs'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE my_django_app.settings PythonDebug On </Location> Mr.Carra I'm wondering if it's possible to deploy custom django application with django embedded? ie that user have to only run install script on they web server and it would "locally" install webaplication. Michael Newman You can put Django where ever as long as you add it to your python path then.
  2. True, but free hosting is really a great way for new web designers and young people to learn about hosting and cpanel and whatnot. Also, a lot of people don't make profits from their site and maybe don't have any other source of income (young people, again) to even pay 1-10 dollars a month. I have found heliohost to be a great free host so far, my downtimes have been low and there are no ads. If I wanted I could buy a domain and point heliohost to it, making my pages look exactly like a paid host. I think free hosting is what should become the default for non profiting sites.I mean look it from this point of view that we are here to help a free host to compete with paid hosts.And also if these free hosts had not existed,those paid hosting prices would have never become rediculous.
  3. perhaps this is too much in sys.path must be the way to django, I did not know, and uploaded their Actually simbairk is not using the django that's installed on the server in python "lib/site-packages" folder which is normally used as where 3rd party packages are installed.He is using the django ,he himself has uploaded to his account by changing the python path to point to his uploaded django folder. It seems this kind of using django can be accompllished on any hosting that's just offering python too.Look at this link:Setting up Django at Webreus.nl It seems there are two ways of using databases without shell access: 1.using python scripts(which can be used for running other cammands of shell too);An example of such script is script.py file ,simbairk has used. 2.some kind of replicating your home database in your hosting account using for example phpmyadmin ,etc. I'll explain these more in the near future. By the way ,simbairk ,whould you please send us your urls.py file too?
  4. Are you sure? But I saw one of your pages with debug= True when I browsed to your site.
  5. Oh I'm very happy you did it simbairk.Actually I know very little django.Now I'm going to play with it more and I'll come back to ask you my questions.I need so much help Thank you very much for your contribution By the way set debug and template_debug in settings.py file to False when making your site available on the internet.It's a security advice
  6. If any of you is successful to run your site please let me know.Look at this topic:is There Anyone Who is Running a Django Powered Website? Look at the following topic too please.You may be able to help me:How to Deploy a Django Powered Blog(in a specific example)? Thank You
  7. No there is no new errors in my error_log after refreshing.In fact I had also refreshed it several times before. I doubted it means refreshing because it's a simple task to do, simpler for you to do it yourself instead of asking me to do And I should mention that English is not my native language, so It's sometimes hard for me to convey my meaning or get what you mean.Excuse me! Update: I have some good news.I've found someone at heliohost who is running his website using django with database.He manipulates syncdb through a function call in a python script.Here is his post:simbairk post Now I'm persuaded it's possible to have this blog project running on my account.So I'm going to go through it and make it work for me.I'll come back by 4 or 5 days and tell you if I will still have been encountering problems in running it. Thank you for your help thus far
  8. I chose heliohost because of this feature.Django is not a CMS but is a Framework so you shouldn't compare it to CMSes, you can just compare it to other frameworks like RORI don't know any kind of programming language other than C and C++ that I have forgotten very much since I haven't never used them in action.I just learnt them theoretically.I'm going to learn python soon and you know django is based on pythonI think it's the best framework at least for my needs Thank you for asking
  9. What do you mean by loading the page again? Hey I'm a complete newbie , so please give me help in layman's terms. And may be it's my fault that want to have a django based website soon while I know very little about it.I'm going to learn python and django completely and even learn linux sever but I thought I may find someone kind enough here to help me to have such website before actually knowing how it's working. I know you are a free service and this means that you don't have to give any kind of support at all but when you claim you support django for building a website you should provide a sample example of a django project that is hosted by you successfully. And what I'm afraid from is not being able to run such a website even after gaining the required knowledge.I mean I'm afraid this kind of website be an impossible one to be hosted by heliohost. Do you give me an assurance that having a django powered website is practical on your host? And is there anything else about django that paid hostings are offering that you don't offer? And is this extra options they offer necessary to build any or every kind of website with django? I mean do you believe any django website that can be hosted by them, can be hosted by heliohost too? I really like your hosting because I like the idea behind this service.It's like the idea behind the open source movement.I really appreciate you and I'm really hoping to have my django powered site on heliohost.org soon Thank you very much for your dedication to this freedom And I know this is off topic,but I'm curious to know how you are earning a living?!!!
  10. Hello I wanted to know if there is anyone who is running a Django powered website at heliohost? I mean using Django framework with a database to build a website. I'm going to make such a website but before that I need to be assured it's possible at heliohost If you believe it's possible please let me know I doubt it and I need to be persuaded Thank you all
  11. So you mean I'm fine if If I upload the db file on my cmputer to my project folder at heliohost and use the following settings in my settings.py file. DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = os.path.join(os.path.dirname(__file__), 'db') DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. Ok if this is the case I shouldn't have any database problems. So why am I getting error browsing to my page?Is your Apache server really serving my django project? What is that 500 internal server error?
  12. I'm not going to run manage.py at heliohost.I'm looking forward to an alternative.For example making a db file in my home computer and copy its content to a db file i have created in heliohost.something like this.Don't you have any suggestion? I'm so ignorant about databases.Can't I have a database file the same as the one I have in my home computer? These are the only settings django needs to communicate with a database: DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = os.path.join(os.path.dirname(__file__), 'db') DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. I mean I think it's enough for example for me to first synchronize my home db file.Then make the same kind of db file in heliohost which contains the same tables in my home db file(so the db file in heliohost is some kind of a copy of my db file at home).And at last give above settings their right values. What do you think? I think this is a very basic project.I mean it's something very normal.And you are saying that you support django framework.I want to know how this normal project can be deployed.Isn't there anyone in this hosting who uses databases with django? and I think any useful django project must have a database.So if there is anyone who is running a django powered website on your host , he must know my answer.And if there is no such person then I think you shouldn't claim supporting Django framework on your hosting.
  13. Are the folks over at CentOS saying we should stay at 2.4 yet?I think you should at least upgrade to 2.5.Please look into it again
  14. [sat Jan 30 00:02:06 2010] [error] [client 92.242.204.175] File does not exist: /home/jazbe/public_html/404.shtml [sat Jan 30 00:02:06 2010] [error] [client 92.242.204.175] File does not exist: /home/jazbe/public_html/favicon.ico these are my error log I know you don't allow command prompt access.I'm asking so how should this synchronization be accomplished without using command prompt? I'm completely unsure of how I can setup the required database.Please explain what steps i should take to do it.
×
×
  • Create New...