Tag Archives: django

How do I run Django and PHP together on one Apache server?

Questions: I can currently run either Django through mod_wsgi or PHP on my Apache server. My Django projects run at: http://localhost and source is at C:/django_proj My PHP projects run at: http://php.localhost and source is at C:/web If I turn both on, php.localhost and localhost go to the Django project. I’ve already set them up… Read More »

How to use HTML5 color picker in Django admin

Questions: I’m trying to implement the HTML5 colorpicker in Django’s admin page. Here is my model: #model.py … class Category(models.Model): … color = models.CharField(max_length=7) Here is the form: #form.py from django.forms import ModelForm from django.forms.widgets import TextInput from .models import Category class CategoryForm(ModelForm): class Meta: model = Category fields = ‘__all__’ widgets = { ‘color’:… Read More »

Django csrf token + Angularjs

Questions: I have django running on an apache server using mod_wsgi, as well as an angularjs app served directly by apache, not by django. I would like to make POST calls to the django server (running rest_framework) but I am having problems with the csrf token. Is there someway to set the token from the… Read More »

Error: Target WSGI script not found or unable to stat when run django on apache

Questions: i have a problem when run django on apache: htdocs/blog/apps/homepage/urls.py: url(r’^$’, ‘index’, name=”h_index”), url(r’^about/$’, ‘about’, name=”h_about”), url(r’^contact/$’, ‘contact’, name=”h_contact”), url(r’^archive/$’, ‘archive’, name=”h_archive”), htdocs/blog/urls.py (r’^’, include(‘apps.homepage.urls’)), django.wsgi: import os import os.path import sys sys.path.append(‘D:/Coding/xampp/htdocs’) sys.path.append(‘D:/Coding/xampp/htdocs/blog’) os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘blog.settings’ import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() httpd.conf: Alias /static/ “D:/Coding/xampp/htdocs/blog/static/” WSGIScriptAlias /blog/ “D:/Coding/xampp/htdocs/blog/django.wsgi” when i run “localhost/blog”, it’s… Read More »

How to debug Django PayPal IPN?

Questions: I’m using this django app to implement PayPal IPN. I’m testing it using PayPal’s IPN simulator, but it’s telling me IPN delivery failed. HTTP error code 500: Internal Server Error So how can I debug this and see what’s really going on? I’ve dug into code: @require_POST def ipn(request, item_check_callable=None): “”” PayPal IPN endpoint… Read More »

Run a shell command from Django

Questions: I’m developing a web page in Django (using apache server) that needs to call a shell command to enable/dissable some daemons. I’m try to do it with os.system(service httpd restart 1>$HOME/out 2>$HOME/error) and this command doesn’t return anything. Any idea how can i fix this? Answers: I’ll skip the part where I strongly advise… Read More »