Getting Django and Subversion to work together on Dreamhost - django

Does anyone know how to get Django and Subversion to work together on Dreamhost?
I've been following this tutorial to install Django (which uses Passenger WSGI):
http://wiki.dreamhost.com/Django
After I got Django to work, Subversion stopped working. Has anyone ran into this problem?

I had the same problem. My solution for now has been to move the Subversion link to a different subdomain.
In my case, I'm only using Django for 1 subdomain in my whole domain (dom1.myurl.com), so I just created a dom2.myurl.com subdomain, and set my SVN path to use it instead.

Related

Django perpetual 404s when visiting project directory URL

I have a very strange problem with Django and OLS. I am using the OpenLitespeed Django one click install droplet on Digital Ocean. In both my custom app and the example app in the droplet, if I visit a URL that matches the django project directory (in the example app, this is /demo/), then any subsequent page visits give a 404 error, no matter what URL you do. To reproduce, I've spun up a completely clean install of the droplet, then do the following steps:
Go to / -> see "Hello world!" as expected
Go to /demo/ -> also see "Hello world!" even though this should be a 404, as this URL is not specified in the urls.py or anywhere else
Go back to / -> 404! It seems to be looking for /demo/demo/ which doesn't exist
Trying any other URL also results in a 404.
The only way to get back to the normal behavior is to restart the OLS process. Everything then functions as expected unless any URL that starts with the project directory name is visited, in which case the whole thing crashes and returns 404s again.
Any help that can be provided to try and further troubleshoot this or possible fixes is greatly appreciated!
Versions:
OLS 1.6.9
Django 2.2 and 3.0
Python 3.6
Thanks for the bug reporting. It's a bug of "virtual context settings for wsgi" and should already fixed on version 1.6.11. If it's not on the repository, you can run the following command to upgrade it.
/usr/local/lsws/admin/misc/lsup.sh -v 1.6.11
Best,
Eric

installing GeoDjango on Heroku

I am trying to build a webapp which uses GeoDjango. The app is to be hosted on Heroku, but I am facing issues in it. I am using this buildpack but then this error is coming. Figured out that this is happening because of Cedar 14 but I am not clear as to what should I do next.
Also I tried using this buildpack but as discussed here, this issue can be resolved by using the buildpath as
$ heroku config:add BUILDPACK_URL=https://github.com/cyberdelia/heroku-geo-buildpack.git#1.3
I tried the same but now it is not detecting it as a Python app and now I am facing the issue of "django import error - No module named core.management " missing, which is because its not installing Django.
Any help will be greatly appreciated.
I figured out the solution to this problem myself only.
To add multiple values for a BUILDPACK_URL, one needs to use a buildpack which can add support for mutiple BUILDPACK_URL.
So I used this. One can write like
$ heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
After this create a file .buildpacks and add to it the following
https://github.com/cyberdelia/heroku-geo-buildpack.git#e1b845b
https://github.com/heroku/heroku-buildpack-python.git
Note that #e1845b is because of this comment, which mentions that it is because of some caching issues.

On Dreamhost, how can I get "django-admin startproject" to correctly set up a project in the way django 1.4 is supposed to?

I'm hosting my website on Dreamhost and I've actually managed to get django working for the most part. The one thing I'm still struggling with is to get django-admin to behave like the version from 1.4 instead of 1.2 (which is what dreamhost runs). I set up a virtualenv and such following these instructions http://blog.oscarcp.com/?p=167 . Any help is appreciated!
It sounds like you're not entering into your virtualenv before you run django-admin. What does django-admin.py --version say?

How to use django "site" framework on google app engine

I'm going to answer my question. I ask this so that other people who is still searching on how to create a django "site" will have a clear answer.
The django documentation had show how to use the django site framework. But strangely, after googling for quite a while, I can't find a good instruction on how to install the site framework. We all know to install an app, we put 'django.contrib.sites' on the INSTALLED_APP list. But how to add the site? Using the admin interface will result in error that say that the site framework is installed but no site is configured (Duhh!). So, we have to assign SITE_ID on the setting.py. But what is the id? From some source, we know that the it has installed a default site by the domain example.com. But still what is the id? setting it to 0 or 1 will also result in error.
Just read the link:
http://www.allbuttonspressed.com/projects/djangoappengine
Definitely the best tutorial I have found:
Flying with Django on GAE
With this I had my site on appspot after about half an hour.
The answer is....
First, put 'django.contrib.sites' on the installed app list like usual.
Then run
python manage.py syncdb
(At you project directory that is). Then, run:
python manage.py shell
Then, use the following sequence of code:
>>>import django.contrib.sites.models as mod
>>>mod.Site.objects.all().count()
Make sure it prints out 1. If it doesn't you probably haven't run syncdb properly.
>>>msite=mod.Site.objects.all().get()
>>>msite.pk
It will print your default site id. SITE_ID (in setting.py.)to the number given. That should do it. At least on development server.
ps: Strangely, mine is 383L. Not 0 or 1. This is probably google app engine with django nonrel specific.

How do I install an open source django-application?

I want to install an existing django app, djangopeople.net. The code is at http://github.com/simonw/djangopeople.net.
I installed django and I understand how to create a new django project.
But how do you deploy an existing app? I know how this works in Rails or Symfony, but I don't really get the django concept here.
Where do I put the files? Which scripts do I run?
Thanks for the steps.
Why is this any different from deploying your own applications? Just put them somewhere in your PYTHONPATH and set up mod_wsgi or whatever to serve them.