Search Results

Search found 5330 results on 214 pages for 'django auth'.

Page 114/214 | < Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >

  • Install "Massive Coupon"

    - by ffffff
    I'want to install "Massive Coupon" http://github.com/robstyles/Massive-Coupon---Open-source-groupon-clone I've set up apache2 + mod_wsgi + mysql on Ubuntu 9 And written the following settings.py # Django settings for massivecoupon project. import socket, os . . DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'grouponpy' # Or path to database file if using sqlite3. DATABASE_USER = 'grouponpy' # Not used with sqlite3. DATABASE_PASSWORD = 'password' # Not used with sqlite3. DATABASE_HOST = 'localhost' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. What I have to do additional then?

    Read the article

  • redirection problem for my sites.

    - by redirect-p
    I have a site example.com and another one test.example.com. Both have different configuration file. But when I enter url test.example.com it will redirect to example.com. configuration file for example.com <VirtualHost *:80> ServerName example.com ServerAlias www.example.com DirectoryIndex index.html DocumentRoot my-document-path Options -Indexes ErrorDocument 404 /errors/404.html ErrorDocument 403 /errors/404.html <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython PythonPath "['path', 'path'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE example.settings PythonInterpreter example PythonAutoReload On PythonDebug On </Location> </VirtualHost>

    Read the article

  • How to deploy local project to Amazon

    - by Nai
    I have a small webapp written in Python/Django which works fine on my local machine. I've been tinkering and setting up my server on the free tier of Amazon EC2 by following online tutorials. However, the tutorials I have found so far shows you how to setup your instance and stops there. So my question is, how do I get my local webapp onto my Amazon instance? FYI, I'm a sys admin/web dev. noob. Thanks.

    Read the article

  • Which user account should be used for WSGIDaemonProcess?

    - by Nathan S
    I have some Django sites deployed using Apache2 and mod_wsgi. When configuring the WSGIDaemonProcess directive, most tutorials (including the official documentation) suggest running the WSGI process as the user in whose home directory the code resides. For example: WSGIScriptAlias / /home/joe/sites/example.com/mod_wsgi-handler.wsgi WSGIDaemonProcess example.com user=joe group=joe processes=2 threads=25 However, I wonder if it is really wise to run the wsgi daemon process as the same user (with its attendant privileges) which develops the code. Should I set up a service account whose only privilege is read-only access to the code in order to have better security? Or are my concerns overblown?

    Read the article

  • Is it possible to manually specify an alternative Procfile on Heroku?

    - by BillyBBone
    I have a repository which can be deployed in two modes: one is a front-end web application, while the other is a data manipulating process which runs non-stop, 24x7. The application runs on Django and connects to a Postgres database. For architectural reasons that I won't go into, I'd like to deploy the app in front-end mode inside as one Heroku application, and deploy the same app (i.e. the same git repo) in the data agent mode, as another Heroku application. Both applications will share the same Postgres connection string, and thus the data agent will feed the front-end app. Is it possible to maintain two separate Procfiles in one repo? This would cause the 3 appropriate dynos to start in front-end mode, and would spin up another process entirely in the other mode.

    Read the article

  • How come my Apache can't read my media folder, but it can load the site? (static files don't work)

    - by Alex
    Alias /media/ /home/matt/repos/hello/media <Directory /home/matt/repos/hello/media> Options -Indexes Order deny,allow Allow from all </Directory> WSGIScriptAlias / /home/matt/repos/hello/wsgi/django.wsgi /media is my directory. When I go to mydomain.com/media/, it says 403 Forbidden. And, the rest of my site doesn't work because all static files are 404s. Why? The page loads. Just not the media folder. Edit: hello is my project folder. I have tried 777 all my permissions of that folder.

    Read the article

  • Can I optimize this mod_wsgi / apache file better?

    - by tomwolber
    Hi! I am new to Django/Python/ mod_wsgi, and I was wondering if I could optimize this file to reduce memory usage: ServerRoot "/home/<foo>/webapps/django_wsgi/apache2" LoadModule dir_module modules/mod_dir.so LoadModule env_module modules/mod_env.so LoadModule log_config_module modules/mod_log_config.so LoadModule mime_module modules/mod_mime.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule wsgi_module modules/mod_wsgi.so LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined CustomLog /home/<foo>/logs/user/access_django_wsgi.log combined ErrorLog /home/<foo>/logs/user/error_django_wsgi.log KeepAlive Off Listen 12345 MaxSpareThreads 3 MinSpareThreads 1 MaxClients 5 MaxRequestsPerChild 300 ServerLimit 4 HostnameLookups Off SetEnvIf X-Forwarded-SSL on HTTPS=1 ThreadsPerChild 5 WSGIDaemonProcess django_wsgi processes=5 python-path=/home/<foo>/webapps/django_wsgi:/home/<foo>/webapps/django_wsgi/lib/python2.6 threads=1 WSGIPythonPath /home/<foo>/webapps/django_wsgi:/home/<foo>/webapps/django_wsgi/lib/python2.6 WSGIScriptAlias /auctions /home/<foo>/webapps/django_wsgi/auctions.wsgi WSGIScriptAlias /achievers /home/<foo>/webapps/django_wsgi/achievers.wsgi

    Read the article

  • Nginx proxy to s3 bucket gets 400 Invalid Argument

    - by elssar
    I have a Django app in which I serve media files through an nginx proxy to s3. The relevant python code response = HttpResponse() response['X-Accel-Redirect'] = '/s3_redirect/%s' % filefield.url.replace('http://', '') response['Content-Disposition'] = 'attachment; filename=%s' % filefield.name return response The nginx block for the internal redirect is location ~* ^/s3_redirect/(.*) { internal; set $full_url http://$1; proxy_pass $full_url; And the request logged by s3 is. REST.GET.OBJECT <media file> "GET <media file>" 400 InvalidArgument 354 - 4 - "http://<referer>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1" - I, for the life of me, can't figure out what's wrong. The url send to nginx by the app is valid, it works in the browser. And nginx is sending a request to s3.

    Read the article

  • mod_rewrite rules to run fcgi for different subdomains

    - by Anthony Hiscox
    On my shared hosting server (Hostmonster) I have django (actually pinax) setup so that a .htaccess mod_rewrite rule rewrites the request to a pinax.fcgi file: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ pinax.fcgi/$1 [QSA,L] What I would like to do is have a different pinax.fcgi file get called depending on the domain used (or subdomain), something like this: RewriteCond %{HTTP_HOST} ^subdomain\.domain\.com$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ pinax2.fcgi/$1 [QSA,L] RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ pinax.fcgi/$1 [QSA,L] This is stored in a .htaccess file in my ROOT public_html folder (not in the public_html/subdomain/ folder), but unfortunately just results in internal redirect errors. How can I write these rules so that they use a different fcgi file for different domains?

    Read the article

  • Serving static web files off a non-standard port

    - by Nimmy Lebby
    I'm close to deploying a Django project to production. I'm looking over some infrastructure decisions. Something that came up was serving static files with a different server such as lighttpd. However, we're starting off with a single dedicated server so our only option would be to use a non-standard port for the static file webserver. Is there precedence for this? I.e. Does anyone "big" do this? Any particular port I should use or shy away from using? Can anyone thing of some downsides of going this route?

    Read the article

  • What port should I use for my reverse proxy to Apache 2 from nginx?

    - by meder
    I have nginx setup as the defacto port 80. I want to setup django+mod_wsgi on Apache2. I'm worried if I leave Apache2 as 80 it will cause a conflict. Is it better to avoid the headache and change Apache to a different port? server { listen 80; server_name work.domain.org; access_log /www/work.domain.org/log/access.log; error_log /www/work.domain.org/log/error.log; location / { proxy_pass http://127.0.0.1:8080/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Magic-Header "secret"; client_max_body_size 10m; } }

    Read the article

  • lighttpd not reliable

    - by schneck
    Hi there, I have a lighttpd running which serves a django-based webservice. It was running well for some months, but from today on, it returns a 410 sometimes, and sometimes fails silently. To test, I make a curl-call, which most time runs fine; it returns some json test-data. Some times. however, it does not return any data, but the call seems to have run well, since I don't get an error code. When I post to my webservice via third-party-packaged like boto, I sometimes get a "410 gone" - but I do not find any entry in the lighttpd error log. Any ideas what the problem could be or how to avoid this? Thanks a lot

    Read the article

  • Can I optimize this mod_wsgi / apache file better?

    - by tomwolber
    I am new to Django/Python/ mod_wsgi, and I was wondering if I could optimize this file to reduce memory usage: ServerRoot "/home/<foo>/webapps/django_wsgi/apache2" LoadModule dir_module modules/mod_dir.so LoadModule env_module modules/mod_env.so LoadModule log_config_module modules/mod_log_config.so LoadModule mime_module modules/mod_mime.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule wsgi_module modules/mod_wsgi.so LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined CustomLog /home/<foo>/logs/user/access_django_wsgi.log combined ErrorLog /home/<foo>/logs/user/error_django_wsgi.log KeepAlive Off Listen 12345 MaxSpareThreads 3 MinSpareThreads 1 MaxClients 5 MaxRequestsPerChild 300 ServerLimit 4 HostnameLookups Off SetEnvIf X-Forwarded-SSL on HTTPS=1 ThreadsPerChild 5 WSGIDaemonProcess django_wsgi processes=5 python-path=/home/<foo>/webapps/django_wsgi:/home/<foo>/webapps/django_wsgi/lib/python2.6 threads=1 WSGIPythonPath /home/<foo>/webapps/django_wsgi:/home/<foo>/webapps/django_wsgi/lib/python2.6 WSGIScriptAlias /auctions /home/<foo>/webapps/django_wsgi/auctions.wsgi WSGIScriptAlias /achievers /home/<foo>/webapps/django_wsgi/achievers.wsgi

    Read the article

  • cakephp phone number validation

    - by hellosheikh
    i am new to cakephp 2.x so i dont know how to do this .. i want to login the user from his email address and phone number..what my intention is if the number in database is this "12345" and the user is trying to login through this number "+12345" he can be login into the system.. i have written a code but i dont know how can i use this or to adjust my code within the auth component as the auth component is autometically logging the user .. here is my controller public function beforeFilter() { parent::beforeFilter(); $this->Auth->authenticate = array( 'Authenticate.Cookie' => array( 'fields' => array( 'username' => 'email', 'password' => 'password' ), 'userModel' => 'User', 'scope' => array('User.active' => 1) ), 'Authenticate.MultiColumn' => array( 'fields' => array( 'username' => 'email', 'password' => 'password' ), 'columns' => array('email', 'mobileNo'), 'userModel' => 'User', ) ); } public function login() { if ($this->Auth->login() || $this->Auth->loggedIn()) { $this->redirect('/users/dashboard'); }else{ $this->layout='logindefault'; $this->set('title_for_layout', 'Account Login'); /*$this->Auth->logout(); $cookie = $this->Cookie->read('Auth.User'); */ if ($this->request->is('post')) { if ($this->Auth->login() || $this->Auth->loggedIn()) { if ($this->Session->check('Auth.User')){ $this->_setCookie($this->Auth->user('idUser')); $this->redirect('/users/dashboard'); } }else { $this->Session->setFlash('Incorrect Email/Password Combination'); } }} } here is the code which i am trying to add .. $mobileNo='+123456789'; if (strpos($mobileNo,'+') !== false) { $mobileNo=str_replace("+", "",$mobileNo); } ?

    Read the article

  • IE7 not digesting JSON: "parse error" [resolved]

    - by Kenny Leu
    While trying to GET a JSON, my callback function is NOT firing. $.ajax({ type:"GET", dataType:'json', url: myLocalURL, data: myData, success: function(returned_data){alert('success');} }); The strangest part of this is that my JSON(s) validates on JSONlint this ONLY fails on IE7...it works in Safari, Chrome, and all versions of Firefox, (EDIT: and even in IE8). If I use 'error', then it reports "parseError"...even though it validates! Is there anything that I'm missing? Does IE7 not process certain characters, data structures (my data doesn't have anything non-alphanumeric, but it DOES have nested JSONs)? I have used tons of other AJAX calls that all work (even in IE7), but with the exception of THIS call. An example data return (EDIT: This is a structurally-complete example, meaning it is only missing a few second-tier fields, but follows this exact hierarchy)here is: {"question":{ "question_id":"19", "question_text":"testing", "other_crap":"none" }, "timestamp":{ "response":"answer", "response_text":"the text here" } } I am completely at a loss. Hopefully someone has some insight into what's going on...thank you! EDIT Here's a copy of the SIMPLEST case of dummy data that I'm using...it still doesn't work in IE7. { "question":{ "question_id":"20", "question_text":"testing :", "adverse_party":"none", "juris":"California", "recipients":"Carl Chan" } } EDIT 2 I am starting to doubt that it is a JSON issue...but I have NO idea what else it could be. Here are some other resources that I've found that could be the cause, but they don't seem to work either: http://firelitdesign.blogspot.com/2009/07/jquerys-getjson.html (Django uses Unicode by default, so I don't think this is causing it) Anybody have any other ideas? ANSWER I finally managed to figure it out...mostly via tedious trial-and-error. I want to thank everyone for their suggestions...as soon as I have 15 rep, I'll upvote you, I promise. :) There was basically no way that you guys could have figured it out, because the issue turned out to be a strange bug between IE7 and Django (my research didn't bring up any similar issues). We were basically using Django template language to generate our JSON...and in the midst of this particular JSON, we were using custom template tags: {% load customfilter %} { "question":{ "question_id":"{{question.id}}", "question_text":"{{question.question_text|customfilterhere}}" } } As soon as I deleted anything related to the customfilter, IE7 was able to parse the JSON perfectly! We still don't have a workaround yet, but at least we now know what's causing it. Has anyone seen any similar issues? Once again, thank you everyone for your contributions.

    Read the article

  • GAE, Python 2.5, Python 2.6 Side-by-side on windows

    - by Software Enthusiastic
    Hi On my development system, I have python 2.6, python 1.1 and GAE. I have three projects running on python 2.6 and django 1.1. And 1 project using GAE, Python 2.6 and django 1.1. I have heard that, my set-up for running GAE using python 2.6 may create some head scratching problems while deploying it on the production server, because GAE supports only python 2.5. And using 2.6 is not recommended. Can I develop GAE application using python 2.6? If not what should be the solution, I am using Window vista as my development system.

    Read the article

  • Inherit a parent class docstring as __doc__ attribute

    - by Reinout van Rees
    There is a question about Inherit docstrings in Python class inheritance, but the answers there deal with method docstrings. My question is how to inherit a docstring of a parent class as the __doc__ attribute. The usecase is that Django rest framework generates nice documentation in the html version of your API based on your view classes' docstrings. But when inheriting a base class (with a docstring) in a class without a docstring, the API doesn't show the docstring. It might very well be that sphinx and other tools do the right thing and handle the docstring inheritance for me, but django rest framework looks at the (empty) .__doc__ attribute. class ParentWithDocstring(object): """Parent docstring""" pass class SubClassWithoutDoctring(ParentWithDocstring): pass parent = ParentWithDocstring() print parent.__doc__ # Prints "Parent docstring". subclass = SubClassWithoutDoctring() print subclass.__doc__ # Prints "None" I've tried something like super(SubClassWithoutDocstring, self).__doc__, but that also only got me a None.

    Read the article

  • Matplotlib and WSGI/mod_python not working on Apache.

    - by Luiz C.
    Everything works as supposed to on the Django development server. In Apache, the django app also works except when matplotlib is used. Here's the error I get: No module named multiarray. Exception Type: ImportError Exception Value: No module named multiarray Exception Location: /usr/share/pyshared/numpy/core/numerictypes.py in <module>, line 81 Python Executable: /usr/bin/python Python Version: 2.6.4 From the python shell, both statements work: import numpy.core.multiarray and import multiarray. Any ideas? Thanks As I'm looking over the numpy files, I found the multiarray module, which has an extension of 'so'. My guess, is that mod_python is not reading these files.

    Read the article

  • Qooxdoo REST JSON request problem - unexpected token and then timeout

    - by freiksenet
    Hello! I am learning Qooxdoo framework and I am trying to make it work with a small Django web service. Django webservice just returns JSON data like this: { "name": "Football", "description": "The most popular sport." } Then I use the following code to query that url: var req = new qx.io.remote.Request(url, "GET", "application/json"); req.toggleCrossDomain(); req.addListener("completed", function(e) { alert(e.getContent()); }); req.send(); Unfortunately when I execute the code I get unexpected token error and then request timeouts. Uncaught SyntaxError: Unexpected token : Native.js:91013011 qx.io.remote.RequestQueue[246]: Timeout: transport 248 Native.js:91013011 qx.io.remote.RequestQueue[246]: 5036ms > 5000ms Native.js:91013013 qx.io.remote.Exchange[248]: Timeout: implementation 249 JSLint reports that this is a valid JSON, so I wonder why Qooxdoo doesn't parse it correctly.

    Read the article

  • what do i need to do so that mod_wsgi will find libmysqlclient.16.dylib? (osx 10.7 with apache mod_wsgi)

    - by compound eye
    I am trying to run django on osx 10.7 (lion) with apache mod_wsgi and virtualenv. My site works if I use the django testing server: (baseline)otter:hello mathew$ python manage.py runserver but it doesn't work when I run apache. The core of the error seems to be Library not loaded: libmysqlclient.16.dylib I think its to do with the path apache is using to locate libmysqlclient.16.dylib when I run otool in the lib directory it looks good otter:lib mathew$ pwd /usr/local/mysql/lib otter:lib mathew$ otool -L libmysqlclient.16.dylib libmysqlclient.16.dylib: libmysqlclient.16.dylib (compatibility version 16.0.0, current version 16.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1) but from outside it can't find it otter:lib mathew$ cd / otter:/ mathew$ otool -L libmysqlclient.16.dylib otool: can't open file: libmysqlclient.16.dylib (No such file or directory) if i manually set DYLD_LIBRARY_PATH otool works otter:lib mathew$ DYLD_LIBRARY_PATH=/usr/local/mysql/lib otter:lib mathew$ otool -L libmysqlclient.16.dylib libmysqlclient.16.dylib: libmysqlclient.16.dylib (compatibility version 16.0.0, current version 16.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1) When I run the django testing server, my .bash_profile sets up the virtualenv and the path to the mysql dynamic library export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_LIBRARY_PATH export PATH When i run apache it finds my virtualenv paths, but it doesn't seem to find the dynamic library path. I tried adding this path to /usr/sbin/envvars DYLD_LIBRARY_PATH="/usr/lib:/usr/local/mysql/lib:$DYLD_LIBRARY_PATH" export DYLD_LIBRARY_PATH and to /private/etc/paths.d/libmysql /usr/local/mysql/lib then restarted the machine but that has not changed the error message. Error loading MySQLdb module: dlopen(/usr/local/python_virtualenv/baseline/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib I don't think is a permissions issue: -rwxr-xr-x 1 root wheel 3787328 4 Dec 2010 libmysqlclient.16.dylib drwxr-xr-x 39 root wheel 1394 18 Nov 21:07 / drwxr-xr-x@ 15 root wheel 510 24 Oct 22:10 /usr drwxrwxr-x 20 root admin 680 2 Nov 20:22 /usr/local drwxr-xr-x 20 mathew admin 680 9 Nov 21:58 /usr/local/python_virtualenv drwxr-xr-x 6 mathew admin 204 2 Nov 21:36 /usr/local/python_virtualenv/baseline drwxr-xr-x 4 mathew admin 136 2 Nov 21:26 /usr/local/python_virtualenv/baseline/lib drwxr-xr-x 52 mathew admin 1768 2 Nov 21:26 /usr/local/python_virtualenv/baseline/lib/python2.7 drwxr-xr-x 18 mathew admin 612 4 Nov 21:20 /usr/local/python_virtualenv/baseline/lib/python2.7/site-packages -rwxr-xr-x 1 mathew admin 66076 2 Nov 21:18 /usr/local/python_virtualenv/baseline/lib/python2.7/site-packages/_mysql.so What do i need to do so that mod_wsgi will find libmysqlclient.16.dylib? apache and mysql are both 64 bit: otter:lib mathew$ file /usr/sbin/httpd /usr/sbin/httpd: Mach-O universal binary with 2 architectures /usr/sbin/httpd (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/sbin/httpd (for architecture i386): Mach-O executable i386 otter:lib mathew$ otter:lib mathew$ file /usr/local/mysql/lib/libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib: Mach-O 64-bit dynamically linked shared library x86_64

    Read the article

  • Requires a valid Date or x-amz-date header?

    - by Jordan Messina
    I'm getting the following error when attempting to upload a file to S3: S3StorageError: <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>AWS authentication requires a valid Date or x-amz-date header</Message><RequestId>7910FF83F3FE17E2</RequestId><HostId>EjycXTgSwUkx19YNkpAoY2UDDur/0d5SMvGJUicpN6qCZFa2OuqcpibIR3NJ2WKB</HostId></Error> I'm using Django with Django-Storages and Imagekit My S3 settings in my settings.py looks as follows: locale.setlocale(locale.LC_TIME, 'en_US') DEFAULT_FILE_STORAGE = 'backends.s3.S3Storage' AWS_ACCESS_KEY_ID = '************************' AWS_SECRET_ACCESS_KEY = '*****************************' AWS_STORAGE_BUCKET_NAME = 'static.blabla.com' AWS_HEADERS = { 'x-amz-date': datetime.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT'), 'Expires': 'Thu, 15 Apr 2200 20:00:00 GMT', } from S3 import CallingFormat AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN Thanks for any help you can give!

    Read the article

  • How to get field name......

    - by user229538
    Recently i have implemented django-sphinx search on my website. It is working fine of each separate model. But now my client requirement has changed. To implement that functionality i need field name to whom search is made. suppose my query is: "select id, name,description from table1" and search keyword is matched with value in field "name". So i need to return that field also. Is it possible to get field name or any method provided by django-sphinx which return field name. Please help me...

    Read the article

  • Pass a captured named regular expression to URL dictionary in generic view

    - by Trent Jurewicz
    I am working with a generic view in Django. I want to capture a named group parameter in the URL and pass the value to the URL pattern dictionary. For example, in the URLConf below, I want to capture the parent_slug value in the URL and pass it to the queryset dictionary value like so: urlpatterns = patterns('django.views.generic.list_detail', (r'^(?P<parent_slugs>[-\w])$', 'object_list', {'queryset':Promotion.objects.filter(category=parent_slug)}, 'promo_promotion_list'), ) Is this possible to do in one URLConf entry, or would it be wiser if I create a custom view to capture the value and pass the queryset directly to the generic view from my overridden view?

    Read the article

  • JSP template inheritance

    - by Ryan
    Coming from a background in Django, I often use "template inheritance", where multiple templates inherit from a common base. Is there an easy way to do this in JSP? If not, is there an alternative to JSP that does this (besides Django on Jython that is :) base template <html> <body> {% block content %} {% endblock %} </body> <html> basic content {% extends "base template" %} {% block content %} <h1>{{ content.title }} <-- Fills in a variable</h1> {{ content.body }} <-- Fills in another variable {% endblock %} Will render as follows (assuming that conten.title is "Insert Title Here", and content.body is "Insert Body Here") <html> <body> <h1>Insert title Here <-- Fills in a variable</h1> Insert Body Here <-- Fills in another variable </body> <html>

    Read the article

  • FieldError when annotating over foreign keys

    - by X_9
    I have a models file that looks similar to the following: class WithDate(models.Model): adddedDate = models.DateTimeField(auto_now_add=True) modifiedDate = models.DateTimeField(auto_now=True) class Meta: abstract = True class Match(WithDate): ... class Notify(WithDate): matchId = models.ForeignKey(Match) headline = models.CharField(null=True, blank=True, max_length=10) For each Match I'm trying to get a count of notify records that have a headline. So my call looks like matchObjs = Match.objects.annotate(notifies_made=Count('notify__headline__isnull')) This keeps throwing a FieldError. I've simplified the query down to matchObjs = Match.objects.annotate(notifies_made=Count('notify')) And I still get the same FieldError... I've seen this work in other cases (other documentation, other SO questions like this one) but I can't figure out why I'm getting an error. The specific error that is returned is as follows: Cannot resolve keyword 'notify' into field. Choices are: (all fields from Match model) Does anyone have a clue as to why I can't get this annotation to work across tables? I'm baffled after looking at the other SO question and various Django docs where I've seen this done. Edit: I am using Django 1.1.1

    Read the article

< Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >