Search Results

Search found 6362 results on 255 pages for 'django urls'.

Page 19/255 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How to locally test Django's Sites Framework

    - by Off Rhoden
    Django has the sites framework to support multiple web site hosting from a single Django installation. EDIT (below is an incorrect assumption of the system) I understand that middleware sets the settings.SITE_ID value based on a lookup/cache of the request domain. ENDEDIT But when testing locally, I'm at http://127.0.0.1:8000/, not http://my-actual-domain.com/ How do I locally view my different sites during development?

    Read the article

  • Using ckEditor on selective text areas in django admin forms

    - by Rahul
    Hi, I want to apply ckeditor on specific textarea in django admin form not on all the text areas. Like snippet below will apply ckeditor on every textarea present on django form: class ProjectAdmin(admin.ModelAdmin): formfield_overrides = {models.TextField: {'widget': forms.Textarea(attrs={'class':'ckeditor'})}, } class Media: js = ('ckeditor/ckeditor.js',) but i want it on a specific textarea not on every textarea.

    Read the article

  • django internationalisation

    - by ha22109
    Hello , I am doing django admin internationalization .I am able to do it perfectly.But my concern is that in the address bar it is showing the app label in tranlated form which is not in us acii .Is this the problem with django or i m doing something wrong.

    Read the article

  • Django 1.2 and south problem

    - by alexarsh
    Hi, I was using python 2.5 and django 1.0.2. But I moved to python 2.6 and django 1.2 recently and I'm getting the following error now during the migrate: http://slexy.org/view/s2HCFJj0yL After running migrate several times, it eventually passes. I have 5 different apps under migration and I thought it can be dependencies issue. But I have no migrations calling other apps. So what can be the problem? Regards, Arshavski Alexander.

    Read the article

  • displaying list of registered user in django-admin

    - by theactiveactor
    My Book model has an author attribute which today is simply a CharField. The value for author should be one of the registered users of my Django site. When creating a new Book object in Django admin, I would like author to be displayed as a combo box showing all registered users. How would I go about achieving this?

    Read the article

  • BI with Django?

    - by Helmut
    Is there a way to develop Bi (Business Intelligence) solutions with Django? Therefore it should be possible to define models with more than one Datasource. Is anybody out there who has experienced BI with Django? How could it work ?

    Read the article

  • Is django orm & templates thread safe?

    - by Piotr Czapla
    I'm using django orm and templates to create a background service that is ran as management command. Do you know if django is thread safe? I'd like to use threads to speed up processing. The processing is blocked by I/O not CPU so I don't care about performance hit caused by GIL.

    Read the article

  • How do I uninstall Django Evolution?

    - by Rhubarb
    I installed it in my dev project. I would like to remove it and any trace of it in my database and my django app, not to mention my python install. I found it didn't quite do what I needed, but that's another topic, and I'm moving to South. Can I just delete the evolution tables in my django db, and remove it from the app settings? Or is there more to it?

    Read the article

  • Serve external template in Django

    - by AlexeyMK
    Hey, I want to do something like return render_to_response("http://docs.google.com/View?id=bla", args) and serve an external page with django arguments. Django doesn't like this (it looks for templates in very particular places). What's the easiest way make this work? Right now I'm thinking to use urllib to save the page to somewhere locally on my server and then serve with the templates pointing to there. Note: I'm not looking for anything particularly scalable here, I realize my proposal above is a little dirty.

    Read the article

  • Need "starting point" hints about adding "tabbed" interface to Django admin

    - by Edwin
    Hi, I'm new to the web development world - that means I'm new to javaScript/CSS. Now I'm building a web system with Python Django. I'm wondering would you like to give me some hints as the starting point for adding "tabbed" interface to Django admin? For example, there are 3 detail table for a master table, and I want to use 3 different tabs for editing that 3 detail tables in the 'edit' page for the master table. Thank you in advance!

    Read the article

  • Django template can't see CSS files

    - by Technical Bard
    I'm building a django app and I can't get the templates to see the CSS files... My settings.py file looks like: MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media') MEDIA_URL = '/media/' I've got the CSS files in /mysite/media/css/ and the template code contains: <link rel="stylesheet" type="text/css" href="/media/css/site_base.css" />` then, in the url.py file I have: # DEVELOPMENT ONLY (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/media'}), but the development server serves the plain html (without styles). What am I doing wrong?

    Read the article

  • Dynamically Delete inline formsets in Django

    - by BenMills
    Is it possible to have Django automatically delete formsets that are not present in the request? So for example if I had three inline formsets represented in HTML when I loaded my edit page and I use javascript to remove two of those when the request is processes Django sees that those two forms are no longer their and deletes them.

    Read the article

  • Storing dynamic fields in Django forms

    - by hekevintran
    Django's form library has a feature of form sets that allow you to process dynamically added forms. For example you would use form sets if your application has a list of bookmarks you could use form sets to process multiple forms that each represent a bookmark. What about if you want to dynamically add a field to a form? An example would be a survey creation page where you can dynamically add an unlimited number of questions. How do you handle this in Django?

    Read the article

  • django flatpage redirects

    - by Joe
    I want to make sure all of my flatpages have the "www" subdomain and redirect to it if they don't. I've looked at some middlewares that redirect to www, but 1. they usually redirect all urls to www and 2. the ones I've found don't work with flatpages. I don't want all of my site urls to redirect to include the www subdomian, just the flatpages. Anyone know how I should go about doing this? Thanks

    Read the article

  • Cookieless Django - Django with no cookies

    - by phoebebright
    As I'm writing a django site from government bodies I'm not going to be able to use cookies. I found this snippet http://djangosnippets.org/snippets/1540/ but it's currently not allowing users to login. Before I start debugging I wondered if anyone else has solved this problem with this snippet or in any other way?

    Read the article

  • Django OpenID django-openid-auth Login Error.

    - by gramware
    I get the following error when attempting to use django-openid-auth OpenID discovery error: No usable OpenID services found for *******@gmail.com I have followed the instructions that come with it, though it seems there is something I am missing. the installation is on my localhost.

    Read the article

  • No Module named django.core

    - by Sirish Kumar
    Hi, I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But now when I run django-admin.py I get the following error. How can I resolve this? Traceback (most recent call last): File "C:\Python25\Lib\site-packages\django\bin\django-admin.py", line 2, in <module> from django.core import management ImportError: No module named django.core

    Read the article

  • No Module named django.core

    - by Sirish Kumar
    Hi, I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But now when I run django-admin.py I get the following error. How can I resolve this? Traceback (most recent call last): File "C:\Python25\Lib\site-packages\django\bin\django-admin.py", line 2, in <module> from django.core import management ImportError: No module named django.core

    Read the article

  • Django - need to split a table across multiple locations [closed]

    - by MikeRand
    Hi all, I have a Django project to track our company's restructuring projects. Here's the very simple model: class Project(models.Model): code = models.CharField(max_length=30) description = models.CharField(max_length=60) class Employee(models.Model): project = models.ForeignKey(Project) employee_id = models.IntegerField() country_code = models.CharField(max_length=3) severance = models.IntegerField() Due to regulations in some European countries, I'm not allowed to keep employee-level severance information in a database that sits on a box outside of that country. In Django, how do I manage the need to have my Employee table split across multiple databases based on an Employee attribute (i.e. country_code) in a way that doesn't impact anything else in the project (e.g. views, templates, admin)? Thanks, Mike

    Read the article

  • Use the Django ORM in a standalone script (again)

    - by Rishabh Manocha
    I'm trying to use the Django ORM in some standalone screen scraping scripts. I know this question has been asked before, but I'm unable to figure out a good solution for my particular problem. I have a Django project with defined models. What I would like to do is use these models and the ORM in my scraping script. My directory structure is something like this: project scrape #scraping scripts ... test.py web django_project settings.py ... #Django files I tried doing the following in project/scrape/test.py: print os.path.join(os.path.abspath('..'), 'web', 'django_project') sys.path.append(os.path.join(os.path.abspath('..'), 'web', 'django_project')) print sys.path print "-------" os.environ['DJANGO_SETTINGS_MODULE'] = 'django_project.settings' #print os.environ from django_project.myapp.models import MyModel print MyModel.objects.count() However, I get an ImportError when I try to run test.py: Traceback (most recent call last): File "test.py", line 12, in <module> from django_project.myapp.models import MyModel ImportError: No module named django_project.myapp.models One solution I found around this problem is to create a symbolic link to ../web/govcheck in the scrape folder: :scrape rmanocha$ ln -s ../web/govcheck ./govcheck With this, I can then run test.py just fine. However, this seems like a hack, and more importantly, is not very portable (I will have to create this symbolic link everywhere I run this code). So, I was wondering if anyone has any better solutions for my problem?

    Read the article

  • Pydev and Django: Shell not finding certain modules?

    - by Rosarch
    I am developing a Django project with PyDev in Eclipse. For a while, PyDev's Django Shell worked great. Now, it doesn't: >>> import sys; print('%s %s' % (sys.executable or sys.platform, sys.version)) C:\Python26\python.exe 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] >>> >>> from django.core import management;import mysite.settings as settings;management.setup_environ(settings) Traceback (most recent call last): File "<console>", line 1, in <module> ImportError: No module named mysite.settings >>> The dev server runs just fine. What could I be doing wrong? The models module is also conspicuously absent: >>> import mysite.myapp.models Traceback (most recent call last): File "<console>", line 1, in <module> ImportError: No module named mysite.myapp.models On the normal command line, outside of PyDev, the shell works fine. Why could this be happening?

    Read the article

  • Django Database design -- Is this a good stragety for overriding defaults

    - by rh0dium
    Hi SO's I have a question on good database design practices and I would like to leverage you guys for pointers. The project started out simple. Hey we have a bunch of questions we want answered for every project (no problem) Which turned into... Hey we have so many questions can we group them into sections (yup we can do that) Which lead into.. Can we weight these questions and I don't really want some of these questions for my project (Yes but we are getting difficult) And then I'm thinking they will want to have each section have it's own weight.. Requirements So there's the requirements - For n number of project Allow a admin member the ability select the questions for a project Allow the admin member to re-weigh or use the default weights for the questions Allow the admin member to re-weight the sections Allow team members to answer the questions. So here is what I came up with. Please feel free to comment and provide better examples models.py from django.db import models from django.contrib.sites.models import Site from django.conf import settings class Section(models.Model): """ This describes the various sections for a checklist: """ name = models.CharField(max_length=64) description = models.TextField() class Question(models.Model): """ This simply provides a simple way to list out the questions. """ question = models.CharField(max_length=255) answer_type = models.CharField(max_length=16) description = models.TextField() section = models.ForeignKey(Section) class ProjectQuestion(models.Model): """ These are the questions relevant to the project """ question = models.ForeignKey(Question) answer = models.CharField(max_length=255) required = models.BooleanField(default=True) weight = models.FloatField(default = XXX) class Project(models.Model): """ Here is where we want to gather our questions """ questions = models.ManyToManyField(ProjectQuestion) Immediate questions: - When I start a project - any ideas on how to "pre-populate" the questions (and ultimately the weights) for the project? - Is there a generally accepted method for doing this process that I am missing? Basically the idea that you refer to the questions overide your own default weight, and store the answer? - It appears that a good chuck of the work will be done in the views and that a lot of checking will need to occur there? Is that OK? Again - feel free to give me better strategies!! Thanks

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >