Search Results

Search found 15813 results on 633 pages for 'django settings'.

Page 119/633 | < Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >

  • how to use SQL wildcard % with Queryset extra>select?

    - by tylias
    I'm trying to add weights to search terms I'm using to filter a queryset. Using the '%' wildcard is causing me some problems. I'm using the extra() modifier to add a weight parameter to the queryset, which I will be using to inform a sort ordering. (See http://docs.djangoproject.com/en/1.1/ref/models/querysets/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none ) Here's the gist of the code: def viewname(request) ... exact_matchstrings="" exact_matchstrings.append("(accountprofile.first_name LIKE '" + term + "')") exact_matchstrings.append("(accountprofile.first_name LIKE '" + term + '\%' + "')") extraquerystring = " + ".join(exact_matchstrings) return_queryset = return_queryset.extra( select = { 'match_weight': extraquerystring }, ) The effect I'm going for is that if the search term matches exactly, the weight associated with the record is 2, but if the term merely starts with the search term and isn't an exact match, the weight is 1. (for example, if 'term' = 'Jon', an entry with first_name='Jon' gets a weight of 2 but an entry with an entry with first_name = 'Jonathan' gets a weight of 1.) I can test the statement in SQL and it seems to work well enough. If I make this SQL query from the mysql shell, no problem: select (first_name like "Carl") + (first_name like "Car%") from accountprofile; But trying to run it via the extra() modifier in my view code and evaluating the resulting queryset gives me the following error: Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 68, in __repr__ data = list(self[:REPR_OUTPUT_SIZE + 1]) File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 83, in __len__ self._result_cache.extend(list(self._iter)) File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 238, in iterator for row in self.query.results_iter(): File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py", line 287, in results_iter for rows in self.execute_sql(MULTI): File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py", line 2369, in execute_sql cursor.execute(sql, params) File "/usr/local/lib/python2.6/dist-packages/django/db/backends/util.py", line 22, in execute sql = self.db.ops.last_executed_query(self.cursor, sql, params) File "/usr/local/lib/python2.6/dist-packages/django/db/backends/__init__.py", line 217, in last_executed_query return smart_unicode(sql) % u_params ValueError: unsupported format character ''' (0x27) at index 309 I've tried it escaping and not escaping % wildcard but that doesn't solve the problem. Doesn't seem to affect it at all, really. Any ideas?

    Read the article

  • Why does Celery work in Python shell, but not in my Django views? (import problem)

    - by TIMEX
    I installed Celery (latest stable version.) I have a directory called /home/myuser/fable/jobs. Inside this directory, I have a file called tasks.py: from celery.decorators import task from celery.task import Task class Submitter(Task): def run(self, post, **kwargs): return "Yes, it works!!!!!!" Inside this directory, I also have a file called celeryconfig.py: BROKER_HOST = "localhost" BROKER_PORT = 5672 BROKER_USER = "abc" BROKER_PASSWORD = "xyz" BROKER_VHOST = "fablemq" CELERY_RESULT_BACKEND = "amqp" CELERY_IMPORTS = ("tasks", ) In my /etc/profile, I have these set as my PYTHONPATH: PYTHONPATH=/home/myuser/fable:/home/myuser/fable/jobs So I run my Celery worker using the console ($ celeryd --loglevel=INFO), and I try it out. I open the Python console and import the tasks. Then, I run the Submitter. >>> import fable.jobs.tasks as tasks >>> s = tasks.Submitter() >>> s.delay("abc") <AsyncResult: d70d9732-fb07-4cca-82be-d7912124a987> Everything works, as you can see in my console [2011-01-09 17:30:05,766: INFO/MainProcess] Task tasks.Submitter[d70d9732-fb07-4cca-82be-d7912124a987] succeeded in 0.0398268699646s: But when I go into my Django's views.py and run the exact 3 lines of code as above, I get this: [2011-01-09 17:25:20,298: ERROR/MainProcess] Unknown task ignored: "Task of kind 'fable.jobs.tasks.Submitter' is not registered, please make sure it's imported.": {'retries': 0, 'task': 'fable.jobs.tasks.Submitter', 'args': ('abc',), 'expires': None, 'eta': None, 'kwargs': {}, 'id': 'eb5c65b4-f352-45c6-96f1-05d3a5329d53'} Traceback (most recent call last): File "/home/myuser/mysite-env/lib/python2.6/site-packages/celery/worker/listener.py", line 321, in receive_message eventer=self.event_dispatcher) File "/home/myuser/mysite-env/lib/python2.6/site-packages/celery/worker/job.py", line 299, in from_message eta=eta, expires=expires) File "/home/myuser/mysite-env/lib/python2.6/site-packages/celery/worker/job.py", line 243, in __init__ self.task = tasks[self.task_name] File "/home/myuser/mysite-env/lib/python2.6/site-packages/celery/registry.py", line 63, in __getitem__ raise self.NotRegistered(str(exc)) NotRegistered: "Task of kind 'fable.jobs.tasks.Submitter' is not registered, please make sure it's imported." It's weird, because the celeryd client does show that it's registered, when I launch it. [2011-01-09 17:38:27,446: WARNING/MainProcess] Configuration -> . broker -> amqp://GOGOme@localhost:5672/fablemq . queues -> . celery -> exchange:celery (direct) binding:celery . concurrency -> 1 . loader -> celery.loaders.default.Loader . logfile -> [stderr]@INFO . events -> OFF . beat -> OFF . tasks -> . tasks.Decayer . tasks.Submitter Can someone help?

    Read the article

  • How to store wiki sites (vcs)

    - by Eugen
    Hello, as a personal project I am trying to write a wiki with the help of django. I'm a beginner when it comes to web development. I am at the (early) point where I need to decide how to store the wiki sites. I have three approaches in mind and would like to know your suggestion. Flat files I considered a flat file approach with a version control system like git or mercurial. Firstly, I would have some example wikis to look at like http://hatta.sheep.art.pl/. Secondly, the vcs would probably deal with editing conflicts and keeping the edit history, so I would not have to reinvent the wheel. And thirdly, I could probably easily clone the wiki repository, so I (or for that matter others) can have an offline copy of the wiki. On the other hand, as far as I know, I can not use django models with flat files. Then, if I wanted to add fields to a wiki site, like a category, I would need to somehow keep a reference to that flat file in order to associate the fields in the database with the flat file. Besides, I don't know if it is a good idea to have all the wiki sites in one repository. I imagine it is more natural to have kind of like a repository per wiki site resp. file. Last but not least, I'm not sure, but I think using flat files would limit my deploying capabilities because web hosts maybe don't allow creating files (I'm thinking, for example, of Google App Engine) Storing in a database By storing the wiki sites in the database I can utilize django models and associate arbitrary fields with the wiki site. I probably would also have an easier life deploying the wiki. But I would not get vcs features like history and conflict resolving per se. I searched for django-extensions to help me and I found django-reversion. However, I do not fully understand if it fit my needs. Does it track model changes like for example if I change the django model file, or does it track the content of the models (which would fit my need). Plus, I do not see if django reversion would help me with edit conflicts. Storing a vcs repository in a database field This would be my ideal solution. It would combine the advantages of both previous approaches without the disadvantages. That is; I would have vcs features but I would save the wiki sites in a database. The problem is: I have no idea how feasible that is. I just imagine saving a wiki site/source together with a git/mercurial repository in a database field. Yet, I somehow doubt database fields work like that. So, I'm open for any other approaches but this is what I came up with. Also, if you're interested, you can find the crappy early test I'm working on here http://github.com/eugenkiss/instantwiki-test

    Read the article

  • Android - Using PreferenceScreen to display and save settings to/from ContentProvider

    - by Donal Rafferty
    I have my own custom Content Provider that loads a datasbase which contains the settings information for my application. I load the settings from the ContentProvider on the creation of my Settings activity. My Settings activity is made up of a PreferenceScreen and Dialog based EditText's. The following code shows how I use the preference screen and edit texts. So as you can see from the first image this works and displays the menu with the information underneath. The problem is in image two, when I click on a choice in the menu the dialog pops up but it is empty, I would like to be able to load the data from my content provider into the edit text in the dialog, so in image one it shows "Donal" as the user name so in image two "Donal" should also appear in the edit text in the dialog. I would also like to be able to listen to the OK button in the dialog so when a user changes a setting I can update the data in my content provider. Can anyone help me with what I'm trying to do? Code // Root PreferenceScreen root = getPreferenceManager().createPreferenceScreen(this); // Dialog based preferences PreferenceCategory dialogBasedPrefCat = new PreferenceCategory(this); dialogBasedPrefCat.setTitle(R.string.dialog_based_preferences); root.addPreference(dialogBasedPrefCat); // Edit text preference EditTextPreference editTextPref = new EditTextPreference(this); editTextPref.setDialogTitle(R.string.dialog_title_edittext_preference); editTextPref.setKey("edittext_preference"); editTextPref.setTitle(R.string.title_edittext_preference); editTextPref.setSummary(name); dialogBasedPrefCat.addPreference(editTextPref); Image One Image Two

    Read the article

  • Update database settings in properties file in Spring

    - by mvg
    Hi all, I am trying to create a Database Manager page which shows the database details on page load and updates the database settings when the user press submit I followed this tutorial and set the database settings in properties file. I managed to update the database settings in properties file programmatically. When I retrieved the database settings using the following code DriverManagerDataSource databaseSource = (DriverManagerDataSource)context.getBean("dataSource"); databaseSource.getUsername(); I managed to get the old value and unable to get the new value This is the mapping in applicationContext.xml file <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>classpath:/bundle/database.properties</value> </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> I checked the properties file and found it to be updated with the latest input. What am I missing? Thanks in advance P.S I am using JSF1.2 with Spring 3 Update Just making my requirement simple. I am creating a setparate dbsettings page, so that when user wishes to connect to different database he/she can just enter the details in dbsettings page and connect

    Read the article

  • Windows mobile 6.0 network settings

    - by Gauls
    Hi I am using Windows mobile 6.0 classic PDA's , I want to use wireless to access my service on the server(Win 2008), what should be my settings in the PDA network management? here's what my settings which works for some PDA's and for some it works for some time and stops? and for some PDA's similar settings does not work at all?? "Programs that connect to the internet..." = ISP "Programs that connect to a private network..." = My Work Network BTW what is this My work network ??? i don't understand as my PDA's use wireless (with proxy) i wud guess ISP to both should work right? but when i change second option to ISP as well the PDA that can connect to internet and server thru PDA IE but not through .netCF application will not get connected at all, but will work fine (apart from .netCF application accessing the server) if i change the second option back to My work network, so basically PDA is not using the first option of ISP at all ?? All i want to know is 1.) correct settings for WM 6.0 classic wirelessly accesing server 2008 with proxy 2) explain what is my work network ? Thanks gauls

    Read the article

  • Creating Settings form using TreeView in C#

    - by Kiran Chandrashekhar
    I am developing the settings form for the software developed in C#. I was looking at how different software have implemented their settings form. In most of the cases that I came across, they seem to be using Treeview on the left pane of the form and configuration settings on the right pane. Ref URL : http://2.bp.blogspot.com/-nMfQoLurxwM/UDXfiZKd4DI/AAAAAAAAAME/IRf6kmxay4w/s1600/bild1.jpg I was wondering, how the different controls are designed/displayed on the right pane. Do they hide all the controls depending which node is selected in the TreeView something like this : if (treeView1.SelectedNode == treeView1.Nodes[0]) { this.groupBox1.Visible = true; this.button1.Visible = true; this.textBox1.Visible = true; this.textBox2.Visible = true; this.label1.Visible = true; this.label2.Visible = true; this.label3.Visible = true; } else { this.groupBox1.Visible = false; this.button1.Visible = false; this.textBox1.Visible = false; this.textBox2.Visible = false; this.label1.Visible = false; this.label2.Visible = false; this.label3.Visible = false; this.groupBox2.Visible = true; this.button2.Visible = true; this.textBox3.Visible = true; this.textBox3.Visible = true; this.labe4.Visible = true; this.label5.Visible = true; this.label6.Visible = true; // bool success = selectColor(); } Is my understanding correct ? Or do we have a better design approach for creating a settings form. Thanks

    Read the article

  • Saving user settings in Metro app using C#

    - by jitendra garg
    I want to write user selected settings in Metro app, in Local Folder. I have done the code as below, but it is not working. The code to save settings: void OnUnloaded(object sender, RoutedEventArgs args) { //code to save app settings. var localSettings = ApplicationData.Current.LocalSettings; localSettings.Values["playerPosition"] = playerPosition; localSettings.Values["aiPosition"] = aiPosition; localSettings.Values["selectedLevel"] = selectedLevel; } The code to read settings: var localSettings = ApplicationData.Current.LocalSettings; if ((localSettings.Values["playerPosition"]) == null) { localSettings.Values["playerPosition"] = 1; localSettings.Values["aiPosition"] = 1; localSettings.Values["selectedLevel"] = "1"; playerPosition = aiPosition = 1; selectedLevel = "1"; } else { playerPosition = (int)localSettings.Values["playerPosition"]; aiPosition = (int)localSettings.Values["aiPosition"]; selectedLevel = (string)localSettings.Values["selectedLevel"]; ---- Clearly I am supposed to save this localSettings variable in a file. But, I am unable to find the code to do that. Also, is Unload event a good place to do it, or should I move it to OnNavigatedFrom event?

    Read the article

  • Using gentoo, how does one stick -9999 ebuild to a specific svn revision?

    - by hurikhan77
    As an example given the django-9999 ebuild, to match the developers environment I need to checkout R12120 from trunk. Installing Django manually is not option due to package management reasons. But there is also no ebuild in portage for 1.2 beta versions. So I did the following: ESVN_OPTIONS="-r12120" emerge -1a django Which installed the required revision from svn. But this is cumbersome in a way. Is there some way to define this statically per ebuild, eg something like: DJANGO_SVN_REV="12120" in make.conf. This would be much cleaner in my eyes. Because next time I need to rebuild django for whatever reason, I need to remember: "Oh I wanted this to stick to a specific revision" and next question will be "err, f&!#$?%, what was it again?" What's the best way to go here? Keep in mind: Manually installing packages without package manager knowledge is no option Working around with manual emerge variable prefixing is no option Setting up a /etc/portage/package.env would be a way to go (as described here) but that seems pretty unsupported and kludgy to me and thus unpreferable Modifying make.conf would be a way to go Keeping the ebuild in an overlay would be an option

    Read the article

  • Graphite not running

    - by River
    I'm currently trying to install graphite 0.9.9 on a gentoo box using these instructions from the graphite wiki. Essentially, it fronts graphite using apache and mod_wsgi. Everything seems to have gone well, except that apache / the graphite webapp never seem to return a response to the web browser (the browser continuously waits to load the page). I've turned on the graphite debug info, but the only message in the log files is this, repeated over and over again in info.log (with the pid always changing): Thu Feb 23 01:59:38 2012 :: graphite.wsgi - pid 4810 - reloading search index These instructions have worked for me before to set up graphite on an Ubuntu machine. I suspect that mod_wsgi is dying, but I have confirmed that mod_wsgi works fine when not serving the graphite webapp. This is what my graphite.conf vhost file looks like: WSGISocketPrefix /etc/httpd/wsgi/ <VirtualHost *:80> ServerName # Server name DocumentRoot "/opt/graphite/webapp" ErrorLog /opt/graphite/storage/log/webapp/error.log CustomLog /opt/graphite/storage/log/webapp/access.log common # I've found that an equal number of processes & threads tends # to show the best performance for Graphite (ymmv). WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120 WSGIProcessGroup graphite WSGIApplicationGroup %{GLOBAL} WSGIImportScript /opt/graphite/conf/graphite.wsgi process-group=graphite application-group=%{GLOBAL} WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi Alias /content/ /opt/graphite/webapp/content/ <Location "/content/"> SetHandler None </Location> # XXX In order for the django admin site media to work you # must change @DJANGO_ROOT@ to be the path to your django # installation, which is probably something like: # /usr/lib/python2.6/site-packages/django Alias /media/ "/usr/lib64/python2.6/site-packages/django/contrib/admin/media/" <Location "/media/"> SetHandler None </Location> # The graphite.wsgi file has to be accessible by apache. It won't # be visible to clients because of the DocumentRoot though. <Directory /opt/graphite/conf/> Order deny,allow Allow from all </Directory> </VirtualHost>

    Read the article

  • Debugging nginx URL rewrite: How do I figure out where the problem is?

    - by pjmorse
    I have a specific URL pattern on a site which needs to be redirected to the HTTPS version. This is a Django site; Nginx checks each URL in memcached, and if it doesn't find a cached version it proxies the request to Apache/mod_python for Django to render the page. The relevant configuration block is rewrite ^/certificate https://mysite.com/certificate ; rewrite ^/([a-zA-Z]{2})/certificate https://mysite.com/certificate ; ...and it doesn't appear to be working at all. Nginx is: $ nginx -V nginx version: nginx/0.7.65 built by gcc 4.2.4 (Ubuntu 4.2.4-1ubuntu4) TLS SNI support disabled configure arguments: --prefix=/usr/local/nginx --pid-path=/var/run/nginx.pid --with-http_gzip_static_module --with-http_ssl_module How can I figure out if the problem is my patterns not matching, or a more obscure configuration problem? (The site is localized to three languages, and the localization is in the URL string, e.g. /US/news/, /DE/about, etc. It tracks localization in the session as well, defaulting to US, so if you just requested /news Django will rewrite to /US/news unless the user has a cookie indicating they're using a different localization. Django handles this, though, not Nginx.)

    Read the article

  • ApplicationSettingsBase.Upgrade() Not Upgrading User Settings after Recompiling with .NET 4.0

    - by Mageuzi
    I have a C# program that is using the standard ApplicationSettingsBase to save its user settings. This was working fine under .NET 3.5. And the provided Upgrade() method would properly "reload" those settings whenever a new version of my program was created. Recently, I recompiled the program with .NET 4.0. My program's version number also increased. But, when I run this version, Upgrade() doesn't seem to to detect any previous version settings, and does not "reload" them. It starts blank. As a test, I recompiled yet again, going back to .NET 3.5. And this time, the Upgrade() method started working again. Is there a way to allow Upgrade() to work when switching frameworks? Is there something else I am missing? Thanks.

    Read the article

  • iphone - Programmatically set (System-wide) proxy settings?

    - by Andrew
    I am new to iPhone development, so I'm sorry if this is a stupid question. I am developing an application whose purpose will be to route all iPhone activity through my company's proxy. Is there a way to programmatically set system-wide proxy settings in the iPhone (which will also take effect on the 3G connection)? I know there is a way to manually set proxy settings for each wifi connection. Detecting new networks and setting the proxy on them would be acceptable. However, I need to also be able to set the proxy on the 3G connection. Also, bonus: Is there a way to programmatically change the "Restrictions" settings? If anyone has any tips or can point me in the right direction, I would appreciate it. Thanks. EDIT: Please understand that this is for a legitimate purpose. Apple has to approve app store additions, so it's not like I'm trying to spread a virus. Please, constructive answers only.

    Read the article

  • WPF: Changing config file user settings at runtime?

    - by Poku
    Hey I'm trying to change some config file user settings values in my WPF application, but its only working partly. The value is changed correctly and the program runs fine with the value. I can even restart the program and the value is still the one i changed it to. The problem is that when i open the .exe.config file the value is still the old value. Im using this code to change the value: Properties.Settings.Default.ProjectNumber = varTestExample; Properties.Settings.Default.Save(); Where does this save code save the changes and how/where does the program read the value after i have run this code? If i run a clean version of the program the ProjectNumber value is correctly taken from the .exe.config file and if i change the value in the config file it is also change when i run the program. But as soon as i run the above code the program is not reading the value from the config file. Why?

    Read the article

  • Using icons in Android preferences

    - by hgpc
    I would like some of my preferences to have icons, like the Settings app. I guess one way of doing this would be to copy all the relevant code and resources from the Settings app, but it seems like overkill for a couple of icons. Also I don't like the idea of having to duplicate the code and resources in each project that requires settings icons. Has anyone solved this already with a simpler or resource-free approach?

    Read the article

  • UltiDev Cassini and <system.webServer> web.config settings

    - by Robert Koritnik
    MS Cassini Development Web Server is a nice product that executes web requests in a similar way that IIS7 does. Every request (event for static content) goes through the same .Net pipeline without exception. All custom HttpModule can handle any request. But sometimes you don't want these modules to execute for certain content (most often static content). In this regard, MS Cassini doesn't read/obey <system.webServer> web.config settings like IIS7 does. I'm particularly interested in these settings. <system.webServer> ... <handlers /> <modules /> </syste.webServer> Does UltiDev's Cassini (a separate payable product upgraded from MS Cassini) web server read these settings and execute as the web.config tells it to?

    Read the article

  • How to retain service settings through InstallShield upgrade install

    - by sjohnston
    I have an InstallScript project in IS2010. It has a handful of services that get installed. Some are C++ exes and use the "InstallShield Object for NT Services". Others are Java apps installed as services with Java Service Wrapper through LaunchAppAndWait command line calls. Tomcat is also being installed as a service through a call to its service.bat. When the installer runs in upgrade mode, the services are reinstalled, and the settings (auto vs. manual startup, restart on fail, log-on account, etc.) are reverted to the defaults. I would like to save the service settings before the file transfer and then repopulate them afterward, but I haven't been able to find a good mechanism to do this. How can I save and restore the service settings?

    Read the article

  • Margin animate problem with Monitor display settings

    - by Jake
    I have an issue with an animation on a webpage. I have this div with text inside of it that I set the margin using css and when the page is loaded I use jquery to animate the div to a certain part of the page. The problem is it works with my concrete pixel settings, but if I change the properties of the monitor display settings in screen resolution(pixels), the div does not animate to the appropriate spot and it doesn't even start off at the appropriate spot from the css. Sample code: #div{ position:absolute; top:20px; left:50px } $("#div").animate({marginLeft: "250px"},2000); Is there a way to have the settings of the animation margin end at the approriate position no matter what the screen resolution is?

    Read the article

  • Which JavaScript MVC framework to use for wysiwyg editing and floating context-sensitive settings pa

    - by ernests
    I'm developing a cms that allows editing everything on the page (generated server-side with a template engine) by just clicking on it — the area turns into input field, textarea or a full-featured tinyMCE editor, Template defines editable elements like "page heading", "copyright footer text", "image", "rich text block" etc. Along with that there's always a flotaing panel with several tabs, some of which contain general settings like page bacground color, font settings etc, but some are context sensitive (e.g., the clicking on "image" editable field triggers to display uploading/cropping/captioning interface in the floating panel). All settings in the panel are either simple inputs or sliders or checkboxes. I'm new to using MVC with javascript, and in fact haven't used it much before. jQuery is used as code library for the project. Should i use JavascriptMVC, SproutCore or anything else? Does any of them allow some kind of sandboxing (within bounds of commmon sense) to allow some javascript code by user-generated skins on my cms? thank you!

    Read the article

  • Optional group with PSToogleSwitch

    - by maxbareis
    Hi, I'd like to have a settings bundle behavior similar to the iPhone WiFi settings. If you select the toggle switch and set it to on, an optional group with the specific settings appears. How is this done? I haven't found any clue by now.

    Read the article

  • How do I access the ApplicationSettings section from another assembly?

    - by Calanus
    I have a dll that is referenced by the parent (executing) assembly. In the ApplicationSettings section of the app.config for the parent assembly I have some settings that can be accessed in the normal intellisense manner (e.g. Properties.Settings.Default.SMTPServer). How do I access these settings from the referenced dll? I obviously can't use intellisense as they are not in the same assembly!

    Read the article

  • Unable to access global variable defined in settings.php [Drupal]

    - by Senthil
    I am developing a website using Drupal 6.16. I want to define a variable in settings.php like $ge_path = 'some/path/here'; And I want to use it inside my modules. function mymodule_block(....) { global $ge_path; $fullPath = $ge_path . '/another/path'; doSomething($fullPath); } But I am getting NULL as the value of $ge_path. Why am I not able to access the global variable defines in settings.php? How can I get the proper value inside my module functions? The funny thing is, I am able to access $db_url['default'] and $db_url['mydatabase'] etc.. which are defined just two lines above $ge_path in settings.php!

    Read the article

  • Pros/cons of reading connection string from physical file vs Application object (ASP.NET)?

    - by HaterTot
    my ASP.NET application reads an xml file to determine which environment it's currently in (e.g. local, development, production). It checks this file every single time it opens a connection to the database, in order to know which connection string to grab from the Application Settings. I'm entering a phase of development where efficiency is becoming a concern. I don't think it's a good idea to have to read a file on a physical disk ever single time I wish to access the database (very often). I was considering storing the connection string in Application["ConnectionString"]. So the code would be public static string GetConnectionString { if (Application["ConnectionString"] == null) { XmlDocument doc = new XmlDocument(); doc.Load(HttpContext.Current.Request.PhysicalApplicationPath + "bin/ServerEnvironment.xml"); XmlElement xe = (XmlElement) xnl[0]; switch (xe.InnerText.ToString().ToLower()) { case "local": connString = Settings.Default.ConnectionStringLocal; break; case "development": connString = Settings.Default.ConnectionStringDevelopment; break; case "production": connString = Settings.Default.ConnectionStringProduction; break; default: throw new Exception("no connection string defined"); } Application["ConnectionString"] = connString; } return Application["ConnectionString"].ToString(); } I didn't design the application so I figure there must have been a reason for reading the xml file every time (to change settings while the application runs?) I have very little concept of the inner workings here. What are the pros and cons? Do you think I'd see a small performance gain by implementing the function above? THANKS

    Read the article

  • Using Application Settings and reading defaults from app.config

    - by Peter Goras
    Hi, I need to deploy a Windows Forms application using ClickOnce deployment. (VS2008, .NET 3.5) And I need to provide a configuration file for this app that any user can modify. For this reason, I am using Application Settings instead of standard appSetttings in app.config so I can separate the the user config from app config. see http://msdn.microsoft.com/en-us/library/ms228995(VS.80).aspx Creating a Settings.settings file using VS generated a class with hard-coded default values like this: [global::System.Configuration.DefaultSettingValueAttribute("blahblah")] public string MyProperty ... WTF? I want to read the default values from the app.config! So I created my own class deriving from ApplicationSettingsBase but I cannot get this to read values from the app.config. Any ideas?

    Read the article

  • Do not use IE browser settings when using a proxy with Indy

    - by JD
    Hi At one of our customer sites, we have a Delphi 2007 application that makes a number of HTTPS requests using indy components. All requests are made using the proxy settings the client provides. For this to work, in IE we have to put the URL's in the trusted zones section. After a month due to security settings the trusted zones are cleared. This means we have to re-add the URLs again to make our application work. Is there a way of bypassing IE settings or using a client side HTTP stack so we do not go through the browser to make https requests? JD

    Read the article

< Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >